| # 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.5.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.8.0 |
| 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: https://github.com/google/yapf |
| rev: 'v0.40.2' |
| hooks: |
| - id: yapf |
| args: ["-i", "tools/*.py", "src/android_rust/*.py", "src/binary_crates/*.py"] |
| - 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 --manifest-path src/Cargo.toml |
| language: rust |
| pass_filenames: false |