.pre-commit-config.yaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # See https://pre-commit.com for more information
  2. # pre-commit install
  3. # pre-commit install --hook-type commit-msg
  4. repos:
  5. - repo: local
  6. hooks:
  7. # allow for crate import granularity:
  8. # https://github.com/rust-lang/rustfmt/issues/4991
  9. - id: fmt
  10. name: fmt
  11. description: Format rust files.
  12. entry: cargo +nightly fmt
  13. language: system
  14. types: [rust]
  15. args: ["--all", "--", "--check"]
  16. - id: cargo-check
  17. name: cargo check
  18. description: Check the package for errors.
  19. entry: cargo check
  20. language: system
  21. types: [rust]
  22. pass_filenames: false
  23. - id: clippy
  24. name: clippy
  25. description: Lint via clippy
  26. entry: cargo clippy
  27. language: system
  28. args: ["--workspace", "--", "-D", "warnings"]
  29. types: [rust]
  30. pass_filenames: false
  31. - repo: https://github.com/DevinR528/cargo-sort
  32. rev: v1.0.9
  33. hooks:
  34. - id: cargo-sort
  35. args: ["-w"]
  36. - repo: https://github.com/compilerla/conventional-pre-commit
  37. rev: v2.1.1
  38. hooks:
  39. - id: conventional-pre-commit
  40. stages:
  41. - commit-msg
  42. - repo: https://github.com/pre-commit/pre-commit-hooks
  43. rev: v4.3.0
  44. hooks:
  45. - id: no-commit-to-branch
  46. args: ["-b", "main"]
  47. - id: check-merge-conflict
  48. - id: trailing-whitespace
  49. - id: end-of-file-fixer
  50. - id: check-yaml
  51. exclude: ^catalog-info.yaml
  52. - id: check-json
  53. exclude: ^tests/data/
  54. - id: check-added-large-files
  55. - id: detect-private-key
  56. exclude: ^tests/data/
  57. - id: check-executables-have-shebangs
  58. - id: check-toml