{"id":13995262,"url":"https://github.com/iddm/cargo-grammarly","last_synced_at":"2025-05-14T18:32:16.983Z","repository":{"id":57553231,"uuid":"190805387","full_name":"iddm/cargo-grammarly","owner":"iddm","description":"Check the doc comments' grammar","archived":false,"fork":false,"pushed_at":"2022-10-09T13:37:19.000Z","size":24,"stargazers_count":8,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-17T16:15:40.695Z","etag":null,"topics":["check","comments","doc","grammar","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iddm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"vityafx"}},"created_at":"2019-06-07T20:33:41.000Z","updated_at":"2024-05-09T18:32:44.000Z","dependencies_parsed_at":"2022-09-26T18:50:58.454Z","dependency_job_id":null,"html_url":"https://github.com/iddm/cargo-grammarly","commit_stats":null,"previous_names":["iddm/cargo-grammarly","vityafx/cargo-grammarly"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iddm%2Fcargo-grammarly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iddm%2Fcargo-grammarly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iddm%2Fcargo-grammarly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iddm%2Fcargo-grammarly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iddm","download_url":"https://codeload.github.com/iddm/cargo-grammarly/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225305760,"owners_count":17453442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["check","comments","doc","grammar","rust"],"created_at":"2024-08-09T14:03:19.712Z","updated_at":"2024-11-19T06:26:33.555Z","avatar_url":"https://github.com/iddm.png","language":"Rust","funding_links":["https://github.com/sponsors/vityafx"],"categories":["Rust"],"sub_categories":[],"readme":"# `cargo grammarly`\n\n[![](https://meritbadge.herokuapp.com/cargo-grammarly)](https://crates.io/crates/cargo-grammarly) [![](https://travis-ci.org/vityafx/cargo-grammarly.svg?branch=master)](https://travis-ci.org/vityafx/cargo-grammarly)\n\n# Warning\nThe command is still at alpha stage. Do not expect too much.\n\n# Description\n\nImprove the quality of your documentation. Use correct English words and grammar, let literally anyone understand\nyour documentation, allow anyone to use your code, reduce the amount of time people need to spent to understand\nhow the crate works and what it does. Good examples are necessary but correct spelling and understandable\nexplanation worths not less.\n\nTo check your code for grammar and spelling mistakes, the [`grammarly crate`](https://crates.io/crates/grammarly) is used.\n\n# How it works\n\nThe utility simply grabs all the doc comments (`///`, `//!`, `#![doc = \"text\"]` and\n`#[doc = \"text\"]`) from your crate's source code and sends it to the grammarly grammar\nchecking bot using the `grammarly` crate. If there are any mistakes in your texts, they\nare printed using the way the `rustc` compiler prints its warning and errors.\n\nThe doc comments are parsed using the `syn` and `proc_macro2` crates. These are used\nspecifically to know where in the code these comments are. Doing it with regular\nexpressions would waste a lot of time.\n\n# Caveats\n\n## Rate limits\n\nThe grammarly service has its [rate limits](https://www.grammarbot.io/quickstart), and on `06/06/19` these are:\n    \n\u003e Request Limits\n\u003e\n\u003e Grammar Bot offers the most generous free limits on grammar and spelling check, but it's not unlimited.\n\u003e With an API key, you can receive 250 requests/day (~7500/mo) at no cost. Without an API key, requests are\n\u003e limited to 100 per day per IP address (~3000/mo).  Contact us for paid options if you need higher volumes.\n\nThe crate tries hard to minimize the times it sends the requests to the grammarly service, but make sure you\nunderstand the rate limits and that the utility sometimes may not give you any hints.\n    \n## Documentation text hints\n\n1. Always put the dot at the end of a sentence.\n2. If you are registered on the service, it is better to use your account in the service instead, because it does\nnot have any rate limits.\n3. Don't use the \\`\\` markdown symbols very often, because the grammarly does not handle them correctly.\n\n\n# Configuring\n\nThe utility works out of the box, however, if you want to use your own API key,\nyou may want to put it in the `.env` file or as an environment variable as:\n\n    GRAMMARLY_API_KEY=99999999\n\n# Installing and Using\n\nCompile the code as shown in the previous section, then put the `cargo-grammarly` executable in your PATH.\n\nMy favorite way of doing this is I have a pre-existing directory in `~/bin` that contains little scripts of mine, that dir is added to my PATH in my `.bashrc` so that it's always available, and then I symlink the release version from where it exists to that directory:\n\n    ln -s [starting directory]/cargo-grammarly/target/release/cargo-grammarly ~/bin/\n\nOnce you've done that, because of the way cargo is set up to use third party extensions, in any other Rust project of yours, you should be able to run:\n\n    cargo grammarly\n\nand all the documentation and comments of this crate will be checked for grammar.\n\n# License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiddm%2Fcargo-grammarly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiddm%2Fcargo-grammarly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiddm%2Fcargo-grammarly/lists"}