.pre-commit-config.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. # Hook to format many type of files in the repo
  9. # including solidity contracts.
  10. - repo: https://github.com/pre-commit/mirrors-prettier
  11. rev: "v2.7.1"
  12. hooks:
  13. - id: prettier
  14. additional_dependencies:
  15. - "prettier@2.7.1"
  16. - "prettier-plugin-solidity@1.0.0-rc.1"
  17. - repo: local
  18. hooks:
  19. # Hooks for the remote executor
  20. - id: cargo-fmt-remote-executor
  21. name: Cargo format for remote executor
  22. language: "rust"
  23. entry: cargo +nightly fmt --manifest-path ./pythnet/remote-executor/Cargo.toml --all -- --config-path rustfmt.toml
  24. pass_filenames: false
  25. files: pythnet/remote-executor
  26. - id: cargo-clippy-remote-executor
  27. name: Cargo clippy for remote executor
  28. language: "rust"
  29. entry: cargo +nightly clippy --manifest-path ./pythnet/remote-executor/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
  30. pass_filenames: false
  31. files: pythnet/remote-executor
  32. # Hooks for the attester
  33. - id: cargo-fmt-attester
  34. name: Cargo format for attester
  35. language: "rust"
  36. entry: cargo +nightly fmt --manifest-path ./wormhole-attester/Cargo.toml --all -- --config-path rustfmt.toml
  37. pass_filenames: false
  38. files: wormhole-attester
  39. - id: cargo-clippy-attester
  40. name: Cargo clippy for attester
  41. language: "rust"
  42. entry: |
  43. bash -c 'EMITTER_ADDRESS=0 BRIDGE_ADDRESS=0 cargo +nightly clippy --manifest-path \
  44. ./wormhole-attester/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings'
  45. pass_filenames: false
  46. files: wormhole-attester
  47. # Hooks for cosmwasm contract
  48. - id: cargo-fmt-cosmwasm
  49. name: Cargo format for cosmwasm contract
  50. language: "rust"
  51. entry: cargo +nightly fmt --manifest-path ./target-chains/cosmwasm/Cargo.toml --all -- --config-path rustfmt.toml
  52. pass_filenames: false
  53. files: target-chains/cosmwasm
  54. - id: cargo-clippy-cosmwasm
  55. name: Cargo clippy for cosmwasm contract
  56. language: "rust"
  57. entry: cargo +nightly clippy --manifest-path ./target-chains/cosmwasm/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
  58. pass_filenames: false
  59. files: target-chains/cosmwasm
  60. # Hooks for p2w-sdk/rust
  61. - id: cargo-fmt-p2w-sdk
  62. name: Cargo format for p2w-sdk
  63. language: "rust"
  64. entry: cargo +nightly fmt --manifest-path ./third_party/pyth/p2w-sdk/rust/Cargo.toml --all -- --config-path rustfmt.toml
  65. pass_filenames: false
  66. files: third_party/pyth/p2w-sdk/rust
  67. - id: cargo-clippy-p2w-sdk
  68. name: Cargo clippy for p2w-sdk
  69. language: "rust"
  70. entry: cargo +nightly clippy --manifest-path ./third_party/pyth/p2w-sdk/rust/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
  71. pass_filenames: false
  72. files: third_party/pyth/p2w-sdk/rust