{"id":31006363,"url":"https://github.com/leander-dsouza/ament-lint-pre-commit-hooks","last_synced_at":"2025-09-13T02:10:23.455Z","repository":{"id":286051288,"uuid":"958145147","full_name":"leander-dsouza/ament-lint-pre-commit-hooks","owner":"leander-dsouza","description":"Pre-commit hooks for ament_lint.","archived":false,"fork":false,"pushed_at":"2025-04-04T03:10:45.000Z","size":84,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T04:20:06.208Z","etag":null,"topics":["ament-lint","pre-commit","pre-commit-hooks","ros2"],"latest_commit_sha":null,"homepage":"","language":"Python","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/leander-dsouza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-31T18:04:36.000Z","updated_at":"2025-04-04T03:10:47.000Z","dependencies_parsed_at":"2025-04-04T04:20:15.094Z","dependency_job_id":null,"html_url":"https://github.com/leander-dsouza/ament-lint-pre-commit-hooks","commit_stats":null,"previous_names":["leander-dsouza/ament-lint-pre-commit-hooks"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/leander-dsouza/ament-lint-pre-commit-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leander-dsouza%2Fament-lint-pre-commit-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leander-dsouza%2Fament-lint-pre-commit-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leander-dsouza%2Fament-lint-pre-commit-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leander-dsouza%2Fament-lint-pre-commit-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leander-dsouza","download_url":"https://codeload.github.com/leander-dsouza/ament-lint-pre-commit-hooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leander-dsouza%2Fament-lint-pre-commit-hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274907841,"owners_count":25371822,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ament-lint","pre-commit","pre-commit-hooks","ros2"],"created_at":"2025-09-13T02:10:19.336Z","updated_at":"2025-09-13T02:10:23.436Z","avatar_url":"https://github.com/leander-dsouza.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build status](https://github.com/leander-dsouza/ament-lint-pre-commit-hooks/actions/workflows/lint.yml/badge.svg)](https://github.com/leander-dsouza/ament-lint-pre-commit-hooks/actions/workflows/lint.yml)\n\n# ament-lint-pre-commit-hooks\nPre-commit hooks for [ament_lint](https://github.com/ament/ament_lint/tree/rolling). No ROS installation required.\n\n### Requirements\n\n* Make sure docker is installed in your [system](https://docs.docker.com/engine/install/). You can check if docker is installed and up and running by the following command:\n\n   ```bash\n   docker run hello-world\n   ```\n\n* Add your user to the docker group:\n\n   ```bash\n   sudo usermod -aG docker $USER\n   ```\n   Log out and log back in to apply the group change.\n\n* Check if docker is running:\n\n   ```bash\n   sudo systemctl status docker\n   ```\n    If it is not running, start the docker service:\n    ```bash\n    sudo systemctl start docker\n    ```\n\n* Install pre-commit:\n\n   ```bash\n   sudo apt install -y pre-commit\n   ```\n\n### Using ament-lint-pre-commit-hooks with pre-commit\n\nAdd this to your `.pre-commit-config.yaml`\n\n```yaml\n-   repo: https://github.com/leander-dsouza/ament-lint-pre-commit-hooks.git\n    rev: v1.0.0\n    hooks:\n    -   id: ament_cpplint\n    -   id: ament_flake8\n    -   id: ament_lint_cmake\n    -   id: ament_mypy\n    -   id: ament_pep257\n    -   id: ament_uncrustify\n    -   id: ament_xmllint\n```\n### Hooks available\n\n* **`ament_cpplint`**\n\n   Check code against the Google style conventions using cpplint as mentioned in [ament_cpplint](https://github.com/ament/ament_lint/tree/rolling/ament_cpplint) package.\n\n   - `--filters FILTER,FILTER,...`\n\n       A comma separated list of category filters to apply (`default: None`)\n\n   - `--linelength N`\n\n      The maximum line length (`default: 100`)\n\n   - `--root ROOT`\n\n      The --root option for cpplint (`default: None`)\n\n   - `--exclude [EXCLUDE ...]`\n\n      Exclude C/C++ files from being checked. (`default: []`)\n\n   - `--output OUTPUT`\n\n      The --output option for cpplint (`default: None`)\n\n   - `--xunit-file XUNIT_FILE`\n\n      Generate a xunit compliant XML file (`default: None`)\n\n* **`ament_flake8`**\n\n   Check code using flake8 as mentioned in the [ament_flake8](https://github.com/ament/ament_lint/tree/rolling/ament_flake8) package.\n\n   - `--config path`\n\n      The config file (`default: /installed_path/ament-lint-pre-commit-hooks/ament_lint_pre_commit_hooks/config/ament_flake8.ini`)\n\n   - `--linelength N`\n\n      The maximum line length (`default: specified in the config file`) (`default: None`)\n\n   - `--exclude [filename ...]`\n\n      The filenames to exclude. (`default: None`)\n\n   - `--xunit-file XUNIT_FILE`\n\n      Generate a xunit compliant XML file (`default: None`)\n\n*  **`ament_lint_cmake`**\n\n   Check CMake code against the style conventions as mentioned in the [ament_lint_cmake](https://github.com/ament/ament_lint/tree/rolling/ament_lint_cmake) package.\n\n   - `--filters FILTERS`\n\n      Filters for lint_cmake, for a list of filters see [here](https://github.com/richq/cmake-lint/blob/master/README.md#usage). (`default: `)\n\n   - `--linelength N`\n\n      The maximum line length (`default: 140`)\n\n   - `--xunit-file XUNIT_FILE`\n\n      Generate a xunit compliant XML file (`default: None`)\n\n* **`ament_mypy`**\n\n   Check code using mypy as mentioned in the [ament_mypy](https://github.com/ament/ament_lint/tree/rolling/ament_mypy) package.\n\n    - `--config path`\n\n        The config file (`default: /relative_path/ament-lint-pre-commit-hooks/ament_lint_pre_commit_hooks/config/ament_mypy.ini`)\n\n    - `--exclude [filename ...]`\n\n        The filenames to exclude. (`default: None`)\n\n    - `--xunit-file XUNIT_FILE`\n\n        Generate a xunit compliant XML file (`default: None`)\n\n* **`ament_pep257`**\n\n   Check docstrings against the style conventions in PEP 257 as mentioned in the [ament_pep257](https://github.com/ament/ament_lint/tree/rolling/ament_pep257) package.\n\n    - `--ignore IGNORE [IGNORE ...]`\n\n        Choose the list of error codes for pydocstyle NOT to check for. (`default: []`)\n\n    - `--select SELECT [SELECT ...]`\n\n        Choose the basic list of error codes for pydocstyle to check for. (`default: []`)\n\n    - `--convention {google,pep257,numpy,ament}`\n\n        Choose a preset list of error codes. Valid options are {`google`, `pep257`, `numpy`, `ament`}.\n\n        The \"ament\" convention is defined as --ignore [`D100`, `D101`, `D102`, `D103`, `D104`, `D105`, `D106`,\n        `D107`, `D203`, `D212`, `D404`]. (`default: ament`)\n\n    - `--add-ignore ADD_IGNORE [ADD_IGNORE ...]`\n\n        Ignore an extra error code, removing it from the list set by --(select/ignore) (`default: []`)\n\n    - `--add-select ADD_SELECT [ADD_SELECT ...]`\n\n        Check an extra error code, adding it to the list set by --(select/ignore). (`default: []`)\n\n    - `--exclude [filename ...]`\n\n        The filenames to exclude. (`default: []`)\n\n    - `--xunit-file XUNIT_FILE`\n\n        Generate a xunit compliant XML file (`default: None`)\n\n* **`ament_uncrustify`**\n\n   Check code style using uncrustify as mentioned in [ament_uncrustify](https://github.com/ament/ament_lint/tree/rolling/ament_uncrustify) package.\n\n    - `--config CFG`\n\n        The path to the uncrustify config file (`default: /relative_path/ament-lint-pre-commit-hooks/ament_lint_pre_commit_hooks/config/ament_uncrustify.cfg`)\n\n    - `--linelength N`\n\n        The maximum line length (`default: specified in the config file`) (`default: None`)\n\n    - `--exclude [filename ...]`\n\n        Exclude specific file names from the check. (`default: []`)\n\n    - `--language {C,C++,CPP}`\n\n        Passed to uncrustify as `-l \u003clanguage\u003e` to force a specific language rather then choosing one based on file extension (`default: None`)\n\n    - `--reformat`\n        Reformat the files in place (`default: False`)\n\n    - `--xunit-file XUNIT_FILE`\n\n        Generate a xunit compliant XML file (`default: None`)\n\n* **`ament_xmllint`**\n\n   Check XML markup using xmllint as mentioned in the [ament_xmllint](https://github.com/ament/ament_lint/tree/rolling/ament_xmllint) package.\n\n    - `--exclude [filename ...]`\n\n        Exclude specific file names and directory names from the check (`default: []`)\n\n    - `--extensions [EXTENSIONS ...]`\n\n        The file extensions of the files to check (`default: ['xml']`)\n\n    - `--xunit-file XUNIT_FILE`\n\n        Generate a xunit compliant XML file (`default: None`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleander-dsouza%2Fament-lint-pre-commit-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleander-dsouza%2Fament-lint-pre-commit-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleander-dsouza%2Fament-lint-pre-commit-hooks/lists"}