|
| 1 | +default_language_version: |
| 2 | + python: python3 |
| 3 | + |
| 4 | +repos: |
| 5 | + ############################################################################# |
| 6 | + # Misc |
| 7 | + ############################################################################# |
| 8 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 9 | + rev: v4.5.0 |
| 10 | + hooks: |
| 11 | + - id: check-merge-conflict # Searches for merge conflict markers within files. |
| 12 | + - id: check-added-large-files # Blocks commits that add large files. Default limit is 500kB. |
| 13 | + # Can be configured with args, e.g., '--maxkb=1000' to change the limit. |
| 14 | + # exclude: 'your_dir/.*' |
| 15 | + # args: ['--maxkb=5000'] |
| 16 | + - id: check-case-conflict # Identifies potential case-insensitive file name conflicts. |
| 17 | + - id: check-ast # Validates the syntax of Python files. |
| 18 | + - id: check-symlinks # Detects broken symlinks. |
| 19 | + - id: trailing-whitespace # Removes any trailing whitespace at the end of lines. |
| 20 | + - id: end-of-file-fixer # Ensures files end with a single newline or are empty. |
| 21 | + |
| 22 | + ############################################################################# |
| 23 | + # JSON, TOML |
| 24 | + ############################################################################# |
| 25 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 26 | + rev: v4.5.0 |
| 27 | + hooks: |
| 28 | + - id: check-json # Validates JSON files to ensure they are properly formatted and syntactically correct. |
| 29 | + types: [json] |
| 30 | + - id: check-toml # Checks TOML files for errors and format issues to ensure valid syntax. |
| 31 | + types: [toml] |
| 32 | + |
| 33 | + ############################################################################# |
| 34 | + # Shell |
| 35 | + ############################################################################# |
| 36 | + - repo: https://github.com/jumanjihouse/pre-commit-hooks |
| 37 | + rev: 3.0.0 |
| 38 | + hooks: |
| 39 | + - id: shfmt # Formats shell scripts to a standard convention using shfmt. |
| 40 | + - id: shellcheck # Lints shell scripts to identify syntax and usage errors, with a specified severity of 'warning'. |
| 41 | + args: |
| 42 | + - --severity=warning |
| 43 | + ############################################################################# |
| 44 | + # Rust |
| 45 | + ############################################################################# |
| 46 | + - repo: https://github.com/doublify/pre-commit-rust |
| 47 | + rev: v1.0 |
| 48 | + hooks: |
| 49 | + - id: fmt # Formats Rust code using rustfmt |
| 50 | + - id: cargo-check # Checks Rust code for compilation errors and warnings |
| 51 | + - id: clippy # Lints Rust code with clippy for common mistakes and style issues |
| 52 | + ############################################################################# |
| 53 | + # Markdown, JavaScript, TypeScript, YAML style formatter |
| 54 | + ############################################################################# |
| 55 | + - repo: https://github.com/pre-commit/mirrors-prettier |
| 56 | + rev: v3.0.3 |
| 57 | + hooks: |
| 58 | + - id: prettier # An opinionated code formatter supporting multiple languages. |
| 59 | + name: prettier |
| 60 | + args: [--config, .ci/prettier.json, --write] |
| 61 | + types_or: |
| 62 | + - javascript |
| 63 | + - tsx |
| 64 | + - ts |
| 65 | + - yaml |
| 66 | + - markdown |
0 commit comments