{"id":26776213,"url":"https://github.com/dustinblackman/languagetool-code-comments","last_synced_at":"2025-04-16T01:43:24.339Z","repository":{"id":59855888,"uuid":"527365438","full_name":"dustinblackman/languagetool-code-comments","owner":"dustinblackman","description":"languagetool-code-comments integrates the LanguageTool API to parse, spell check, and correct the grammar of your code comments!","archived":false,"fork":false,"pushed_at":"2024-02-12T02:23:48.000Z","size":548,"stargazers_count":34,"open_issues_count":4,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T03:34:14.338Z","etag":null,"topics":["cli","developer-tools","languagetool","languagetool-linter","neovim","null-ls","rust"],"latest_commit_sha":null,"homepage":"","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/dustinblackman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-08-22T00:53:48.000Z","updated_at":"2025-01-28T23:55:10.000Z","dependencies_parsed_at":"2023-01-24T23:45:23.392Z","dependency_job_id":"a77cb070-f603-45f9-9019-183374a7dd79","html_url":"https://github.com/dustinblackman/languagetool-code-comments","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dustinblackman%2Flanguagetool-code-comments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dustinblackman%2Flanguagetool-code-comments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dustinblackman%2Flanguagetool-code-comments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dustinblackman%2Flanguagetool-code-comments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dustinblackman","download_url":"https://codeload.github.com/dustinblackman/languagetool-code-comments/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249182821,"owners_count":21226123,"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":["cli","developer-tools","languagetool","languagetool-linter","neovim","null-ls","rust"],"created_at":"2025-03-29T03:34:22.456Z","updated_at":"2025-04-16T01:43:24.300Z","avatar_url":"https://github.com/dustinblackman.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=center\u003elanguagetool-code-comments\u003c/h1\u003e\n\n![languagetool-code-comments](.github/banner.png)\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/dustinblackman/languagetool-code-comments/ci.yml?branch=main)](https://github.com/dustinblackman/languagetool-code-comments/actions)\n[![Release](https://img.shields.io/github/v/release/dustinblackman/languagetool-code-comments)](https://github.com/dustinblackman/languagetool-code-comments/releases)\n[![Coverage Status](https://coveralls.io/repos/github/dustinblackman/languagetool-code-comments/badge.svg?branch=main)](https://coveralls.io/github/dustinblackman/languagetool-code-comments?branch=main)\n\n\u003e `languagetool-code-comments` integrates the LanguageTool API to parse, spell check, and correct the grammar of your code comments!\n\n- [Overview](#Overview)\n- [Install](#Install)\n  - [MacOS](#macos)\n  - [Debian / Ubuntu](#debian--ubuntu)\n  - [Fedora / CentOS](#fedora--centos)\n  - [Nix](#nix)\n  - [Arch Linux](#arch-linux)\n  - [Windows](#windows)\n  - [Manual](#manual)\n  - [Source](#source)\n- [Usage](#Usage)\n  - [CLI](#cli)\n  - [Neovim](#neovim)\n  - [Visual Studio Code](#visual-studio-code)\n- [Development](#Development)\n  - [Setup](#setup)\n  - [Adding a new language](#adding-a-new-language)\n\n## Overview\n\nNever will you submit a PR where you fat-fingered `// This is a hck` in your code again. LTCC can be integrated directly in your editor, or used in a linting fashion in your CI pipelines. Caching is built in to speed up processing new and edited docs.\n\nUsing the power of [Tree Sitter](https://tree-sitter.github.io/tree-sitter/#available-parsers), LTCC easily integrates with several programming languages. And if privacy is a concern, and you have some spare hardware lying around, LanguageTool offers a [great way](https://dev.languagetool.org/http-server) to self-host your own instance.\n\n![screenshot](.github/screenshot.jpg)\n\n\u003c!-- command-help start --\u003e\n\n```\nlanguagetool-code-comments v0.6.3\nIntegrates the LanguageTool API to parse, spell check, and correct the grammar of your code\ncomments!\n\nUSAGE:\n    languagetool-code-comments \u003cSUBCOMMAND\u003e\n\nOPTIONS:\n    -h, --help       Print help information\n    -V, --version    Print version information\n\nSUBCOMMANDS:\n    cache         Functionality around the LanguageTools result cache.\n    check         Parses source code comments from the provided file and passes them to\n                      LanguageTool, returning grammar and spelling mistakes if any.\n    completion    Generates shell completions\n    help          Print this message or the help of the given subcommand(s)\n\nSUPPORTED LANGUAGES:\n  - astro\n  - bash\n  - cpp\n  - css\n  - dockerfile\n  - elixir\n  - go\n  - hcl\n  - html\n  - javascript\n  - jsx\n  - lua\n  - make\n  - nix\n  - python\n  - rust\n  - sql\n  - toml\n  - tsx\n  - typescript\n  - yaml\n```\n\n\u003c!-- command-help end --\u003e\n\n## Install\n\n### MacOS\n\n```sh\nbrew install dustinblackman/tap/languagetool-code-comments\n```\n\n### Debian / Ubuntu\n\n```sh\ncurl -s https://apt.dustinblackman.com/KEY.gpg | apt-key add -\ncurl -s https://apt.dustinblackman.com/dustinblackman.list \u003e /etc/apt/sources.list.d/dustinblackman.list\nsudo apt-get update\nsudo apt-get install languagetool-code-comments\n```\n\n### Fedora / CentOS\n\n```sh\ndnf config-manager --add-repo https://yum.dustinblackman.com/config.repo\ndnf install --nogpgcheck languagetool-code-comments\n```\n\n### Nix\n\n```sh\nnix-env -f '\u003cnixpkgs\u003e' -iA nur.repos.dustinblackman.languagetool-code-comments\n```\n\n### Arch Linux\n\n```sh\nyay -S languagetool-code-comments-bin\n```\n\n### Windows\n\n**Chocolatey**\n\n\u003c!-- choco-install start --\u003e\n\n```sh\nchoco install languagetool-code-comments --version=0.6.3\n```\n\n\u003c!-- choco-install end --\u003e\n\n**Scoop**\n\n```sh\nscoop bucket add dustinblackman https://github.com/dustinblackman/scoop-bucket.git\nscoop install languagetool-code-comments\n```\n\n### Manual\n\nDownload the pre-compiled binaries and packages from the [releases page](https://github.com/dustinblackman/languagetool-code-comments/releases) and\ncopy to the desired location.\n\n### Source\n\n```sh\ngit clone https://github.com/dustinblackman/languagetool-code-comments.git\ncd languagetool-code-comments\ngit submodule update --init --recursive\ncargo install --path .\n```\n\n## Usage\n\n### CLI\n\n```sh\nlanguagetool-code-comments check -l en-US --file /home/me/my-test-file.rs\n```\n\n### Neovim\n\nSee [./tools/null-ls-config.lua](./tools/null-ls-config.lua)\n\nThe above uses [`null-ls`](https://github.com/jose-elias-alvarez/null-ls.nvim), and is based off the soon-to-be\n[`ltrs`](https://github.com/jose-elias-alvarez/null-ls.nvim/pull/997) configuration. Once I feel `languagetool-code-comments` responses have stabilized, I'll attempt PRing the configs to `null-rs` itself.\n\n### Visual Studio Code\n\nComing Soon! Follow https://github.com/dustinblackman/languagetool-code-comments/issues/1 for updates.\n\n## Development\n\n### Setup\n\n```sh\ngit clone https://github.com/dustinblackman/languagetool-code-comments.git\ncd languagetool-code-comments\ngit submodule update --init --recursive\ncargo check\n```\n\n### Adding a new language\n\nLet's take the following steps to add Perl to `languagetool-code-comments`, as example which will take you from selecting the Tree\nSitter config, to integrating the language in the repo, writing tests, and QAing. If you'd like to check out a complete example,\nsee [add Nix](https://github.com/dustinblackman/languagetool-code-comments/commit/bdcb51aca1423053c7888e97a1b5866d7316c854).\n\n1. Follow the [setup](#setup) for the project.\n2. Head over to the [Tree Sitter Parsers](https://tree-sitter.github.io/tree-sitter/#available-parsers) docs and select the Perl parser.\n3. Add the repo as a submodule with `git submodule add https://github.com/ganezdragon/tree-sitter-perl ./external/tree-sitter-perl`\n4. Update [`build.rs`](./build.rs) by adding a configuration for Perl in the `langs` vec. Perl includes both a `parser.c` and `scanner.cc`, so the configuration would look like the following.\n\n```rust\nbuild_treesitter_grammar(\n    \"tree-sitter-perl\",\n    \"tree-sitter-perl/src\",\n    vec![\"parser.c\", \"scanner.cc\"],\n),\n```\n\n5. Run `cargo build` to verify the configuration is set up correctly.\n6. Update [`parse.rs`](./src/parse.rs) by adding `fn tree_sitter_perl() - Language;` to `extern \"C\"`, `Perl` to the `Languages` enum, a case statement in `get_language_config()`, and an extension parser in `get_language_from_filepath()`.\n7. Create a Perl file fixture in `./tests/fixtures`, following the examples of the other languages.\n8. Update [`parse_test.rs`](./src/parse_test.rs) with a test for Perl, following the examples of the other languages.\n9. Run `cargo test` to prove your tests work.\n10. Run `cargo build` and test the CLI works as expected with Perl.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdustinblackman%2Flanguagetool-code-comments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdustinblackman%2Flanguagetool-code-comments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdustinblackman%2Flanguagetool-code-comments/lists"}