.pre-commit-config.yaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. repos:
  2. - repo: https://github.com/pre-commit/pre-commit-hooks
  3. rev: v3.2.0
  4. hooks:
  5. - id: trailing-whitespace
  6. - id: end-of-file-fixer
  7. - id: check-added-large-files
  8. exclude: package-lock.json
  9. # Hook to format many type of files in the repo
  10. # including solidity contracts.
  11. - repo: https://github.com/pre-commit/mirrors-prettier
  12. rev: "v2.7.1"
  13. hooks:
  14. - id: prettier
  15. additional_dependencies:
  16. - "prettier@2.7.1"
  17. - "prettier-plugin-solidity@1.0.0-rc.1"
  18. - repo: local
  19. hooks:
  20. # Hooks for the remote executor
  21. - id: cargo-fmt-remote-executor
  22. name: Cargo format for remote executor
  23. language: "rust"
  24. entry: cargo +nightly fmt --manifest-path ./governance/remote_executor/Cargo.toml --all -- --config-path rustfmt.toml
  25. pass_filenames: false
  26. files: governance/remote_executor
  27. - id: cargo-clippy-remote-executor
  28. name: Cargo clippy for remote executor
  29. language: "rust"
  30. entry: cargo +nightly clippy --manifest-path ./governance/remote_executor/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
  31. pass_filenames: false
  32. files: governance/remote_executor
  33. # Hooks for the attester
  34. - id: cargo-fmt-attester
  35. name: Cargo format for attester
  36. language: "rust"
  37. entry: cargo +nightly fmt --manifest-path ./wormhole_attester/Cargo.toml --all -- --config-path rustfmt.toml
  38. pass_filenames: false
  39. files: wormhole_attester
  40. - id: cargo-clippy-attester
  41. name: Cargo clippy for attester
  42. language: "rust"
  43. entry: |
  44. bash -c 'EMITTER_ADDRESS=0 BRIDGE_ADDRESS=0 cargo +nightly clippy --manifest-path \
  45. ./wormhole_attester/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings'
  46. pass_filenames: false
  47. files: wormhole_attester
  48. # Hooks for cosmwasm contract
  49. - id: cargo-fmt-cosmwasm
  50. name: Cargo format for cosmwasm contract
  51. language: "rust"
  52. entry: cargo +nightly fmt --manifest-path ./target_chains/cosmwasm/Cargo.toml --all -- --config-path rustfmt.toml
  53. pass_filenames: false
  54. files: target_chains/cosmwasm
  55. - id: cargo-clippy-cosmwasm
  56. name: Cargo clippy for cosmwasm contract
  57. language: "rust"
  58. entry: cargo +nightly clippy --manifest-path ./target_chains/cosmwasm/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
  59. pass_filenames: false
  60. files: target_chains/cosmwasm