.pre-commit-config.yaml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. repos:
  2. - repo: https://github.com/pre-commit/pre-commit-hooks
  3. rev: v3.2.0
  4. hooks:
  5. - id: trailing-whitespace
  6. exclude: >
  7. (?x)^(
  8. target_chains/sui/vendor/|
  9. patches/|
  10. apps/hermes/server/proto/vendor/
  11. )
  12. - id: end-of-file-fixer
  13. exclude: >
  14. (?x)^(
  15. target_chains/sui/vendor/|
  16. patches/|
  17. apps/api-reference/public/currency-icons/|
  18. apps/hermes/server/proto/vendor/
  19. )
  20. - id: check-added-large-files
  21. exclude: >
  22. (?x)^(
  23. target_chains/sui/vendor/|
  24. patches/
  25. )
  26. - repo: local
  27. hooks:
  28. # Hooks for the remote executor
  29. - id: cargo-fmt-remote-executor
  30. name: Cargo format for remote executor
  31. language: "rust"
  32. entry: cargo +1.73.0 fmt --manifest-path ./governance/remote_executor/Cargo.toml --all
  33. pass_filenames: false
  34. files: governance/remote_executor
  35. - id: cargo-clippy-remote-executor
  36. name: Cargo clippy for remote executor
  37. language: "rust"
  38. entry: cargo +1.73.0 clippy --manifest-path ./governance/remote_executor/Cargo.toml --tests -- --deny warnings
  39. pass_filenames: false
  40. files: governance/remote_executor
  41. # Hooks for cosmwasm contract
  42. - id: cargo-fmt-cosmwasm
  43. name: Cargo format for cosmwasm contract
  44. language: "rust"
  45. entry: cargo +1.82.0 fmt --manifest-path ./target_chains/cosmwasm/Cargo.toml --all
  46. pass_filenames: false
  47. files: target_chains/cosmwasm
  48. - id: cargo-clippy-cosmwasm
  49. name: Cargo clippy for cosmwasm contract
  50. language: "rust"
  51. entry: cargo +1.82.0 clippy --manifest-path ./target_chains/cosmwasm/Cargo.toml --tests -- --deny warnings
  52. pass_filenames: false
  53. files: target_chains/cosmwasm
  54. # Hooks for Hermes
  55. - id: cargo-fmt-hermes
  56. name: Cargo format for Hermes
  57. language: "rust"
  58. entry: cargo +1.82.0 fmt --manifest-path ./apps/hermes/server/Cargo.toml --all
  59. pass_filenames: false
  60. files: apps/hermes
  61. - id: cargo-clippy-hermes
  62. name: Cargo clippy for Hermes
  63. language: "rust"
  64. entry: cargo +1.82.0 clippy --manifest-path ./apps/hermes/server/Cargo.toml --tests -- --deny warnings
  65. pass_filenames: false
  66. files: apps/hermes
  67. # Hooks for Fortuna
  68. - id: cargo-fmt-fortuna
  69. name: Cargo format for Fortuna
  70. language: "rust"
  71. entry: cargo +1.82.0 fmt --manifest-path ./apps/fortuna/Cargo.toml --all
  72. pass_filenames: false
  73. files: apps/fortuna
  74. - id: cargo-clippy-fortuna
  75. name: Cargo clippy for Fortuna
  76. language: "rust"
  77. entry: cargo +1.82.0 clippy --manifest-path ./apps/fortuna/Cargo.toml --tests -- --deny warnings
  78. pass_filenames: false
  79. files: apps/fortuna
  80. # Hooks for message buffer contract
  81. - id: cargo-fmt-message-buffer
  82. name: Cargo format for message buffer contract
  83. language: "rust"
  84. entry: cargo +1.66.1 fmt --manifest-path ./pythnet/message_buffer/Cargo.toml --all
  85. pass_filenames: false
  86. files: pythnet/message_buffer
  87. - id: cargo-clippy-message-buffer
  88. name: Cargo clippy for message buffer contract
  89. language: "rust"
  90. entry: cargo +1.66.1 clippy --manifest-path ./pythnet/message_buffer/Cargo.toml --tests -- --deny warnings
  91. pass_filenames: false
  92. files: pythnet/message_buffer
  93. # Hooks for pythnet_sdk
  94. - id: cargo-fmt-pythnet-sdk
  95. name: Cargo format for pythnet SDK
  96. language: "rust"
  97. entry: cargo +1.82.0 fmt --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --all
  98. pass_filenames: false
  99. files: pythnet/pythnet_sdk
  100. - id: cargo-clippy-pythnet-sdk
  101. name: Cargo clippy for pythnet SDK
  102. language: "rust"
  103. entry: cargo +1.82.0 clippy --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --tests -- --deny warnings
  104. pass_filenames: false
  105. files: pythnet/pythnet_sdk
  106. # Hooks for solana receiver contract
  107. - id: cargo-fmt-pyth-solana-receiver
  108. name: Cargo format for solana target chain contract
  109. language: "rust"
  110. entry: cargo +1.73.0 fmt --manifest-path ./target_chains/solana/Cargo.toml --all
  111. pass_filenames: false
  112. files: target_chains/solana
  113. - id: cargo-clippy-pyth-solana-receiver
  114. name: Cargo clippy for solana target chain contract
  115. language: "rust"
  116. entry: cargo +1.73.0 clippy --manifest-path ./target_chains/solana/Cargo.toml --tests -- --deny warnings
  117. pass_filenames: false
  118. files: target_chains/solana
  119. # For Lazer
  120. - id: cargo-fmt-lazer
  121. name: Cargo format for Lazer
  122. language: "rust"
  123. entry: cargo +1.82.0 fmt --manifest-path ./lazer/Cargo.toml --all
  124. pass_filenames: false
  125. files: lazer
  126. - id: cargo-clippy-lazer
  127. name: Cargo clippy for Lazer
  128. language: "rust"
  129. entry: cargo +1.82.0 clippy --manifest-path ./lazer/Cargo.toml --all-targets -- --deny warnings
  130. pass_filenames: false
  131. files: lazer
  132. - id: cargo-fmt-stylus-sdk
  133. name: Cargo format for Stylus SDK
  134. language: "rust"
  135. entry: cargo +1.82.0 fmt --manifest-path ./target_chains/ethereum/sdk/stylus/Cargo.toml --all
  136. pass_filenames: false
  137. files: target_chains/ethereum/sdk/stylus
  138. - id: cargo-clippy-stylus-sdk
  139. name: Cargo clippy for Stylus SDK
  140. language: "rust"
  141. entry: cargo +1.82.0 clippy --manifest-path ./target_chains/ethereum/sdk/stylus/Cargo.toml --all-targets -- --deny warnings
  142. pass_filenames: false
  143. files: target_chains/ethereum/sdk/stylus
  144. - id: fmt-aptos-lazer
  145. name: Format Aptos Lazer contracts
  146. language: system
  147. entry: aptos move fmt --package-path lazer/contracts/aptos
  148. pass_filenames: false
  149. files: lazer/contracts/aptos
  150. - id: lint-aptos-lazer
  151. name: Lint Aptos Lazer contracts
  152. language: system
  153. entry: aptos move lint --package-dir lazer/contracts/aptos --check-test-code --dev
  154. pass_filenames: false
  155. files: lazer/contracts/aptos