| # Instructions: |
| # 1. sudo apt install pre-commit |
| # 2. From this directory, "pre-commit install" |
| |
| repos: |
| - repo: https://github.com/pre-commit/pre-commit-hooks |
| rev: v4.4.0 |
| hooks: |
| - id: check-yaml |
| - id: check-toml |
| - id: trailing-whitespace |
| exclude: "^patches/.*" |
| - id: name-tests-test |
| args: ["--unittest"] |
| - repo: https://github.com/pre-commit/mirrors-mypy |
| rev: v1.5.1 |
| hooks: |
| - id: mypy |
| - repo: https://github.com/doublify/pre-commit-rust |
| rev: v1.0 |
| hooks: |
| - id: fmt |
| args: ["--", "--config-path", "../../build/soong/scripts/rustfmt.toml"] |
| - id: cargo-check |
| - repo: local |
| hooks: |
| - id: py-test |
| name: run unit tests |
| entry: python -m unittest |
| language: python |
| pass_filenames: false |
| args: ["discover"] |
| - id: cargo-test |
| name: cargo test |
| entry: cargo test |
| language: rust |
| pass_filenames: false |