.pre-commit-config.yaml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. - id: turbo-fix-format
  29. name: Run turbo fix on packages
  30. language: system
  31. entry: sh -c 'pnpm turbo fix'
  32. pass_filenames: false
  33. # Hooks for the remote executor
  34. - id: cargo-fmt-remote-executor
  35. name: Cargo format for remote executor
  36. language: "rust"
  37. entry: cargo +1.73.0 fmt --manifest-path ./governance/remote_executor/Cargo.toml --all
  38. pass_filenames: false
  39. files: governance/remote_executor
  40. - id: cargo-clippy-remote-executor
  41. name: Cargo clippy for remote executor
  42. language: "rust"
  43. entry: cargo +1.73.0 clippy --manifest-path ./governance/remote_executor/Cargo.toml --tests -- --deny warnings
  44. pass_filenames: false
  45. files: governance/remote_executor
  46. # Hooks for cosmwasm contract
  47. - id: cargo-fmt-cosmwasm
  48. name: Cargo format for cosmwasm contract
  49. language: "rust"
  50. entry: cargo +1.82.0 fmt --manifest-path ./target_chains/cosmwasm/Cargo.toml --all
  51. pass_filenames: false
  52. files: target_chains/cosmwasm
  53. - id: cargo-clippy-cosmwasm
  54. name: Cargo clippy for cosmwasm contract
  55. language: "rust"
  56. entry: cargo +1.82.0 clippy --manifest-path ./target_chains/cosmwasm/Cargo.toml --tests -- --deny warnings
  57. pass_filenames: false
  58. files: target_chains/cosmwasm
  59. # Hooks for Hermes
  60. - id: cargo-fmt-hermes
  61. name: Cargo format for Hermes
  62. language: "rust"
  63. entry: cargo +1.82.0 fmt --manifest-path ./apps/hermes/server/Cargo.toml --all
  64. pass_filenames: false
  65. files: apps/hermes
  66. - id: cargo-clippy-hermes
  67. name: Cargo clippy for Hermes
  68. language: "rust"
  69. entry: cargo +1.82.0 clippy --manifest-path ./apps/hermes/server/Cargo.toml --tests -- --deny warnings
  70. pass_filenames: false
  71. files: apps/hermes
  72. # Hooks for Fortuna
  73. - id: cargo-fmt-fortuna
  74. name: Cargo format for Fortuna
  75. language: "rust"
  76. entry: cargo +1.82.0 fmt --manifest-path ./apps/fortuna/Cargo.toml --all
  77. pass_filenames: false
  78. files: apps/fortuna
  79. - id: cargo-clippy-fortuna
  80. name: Cargo clippy for Fortuna
  81. language: "rust"
  82. entry: cargo +1.82.0 clippy --manifest-path ./apps/fortuna/Cargo.toml --tests -- --deny warnings
  83. pass_filenames: false
  84. files: apps/fortuna
  85. # Hooks for message buffer contract
  86. - id: cargo-fmt-message-buffer
  87. name: Cargo format for message buffer contract
  88. language: "rust"
  89. entry: cargo +1.66.1 fmt --manifest-path ./pythnet/message_buffer/Cargo.toml --all
  90. pass_filenames: false
  91. files: pythnet/message_buffer
  92. - id: cargo-clippy-message-buffer
  93. name: Cargo clippy for message buffer contract
  94. language: "rust"
  95. entry: cargo +1.66.1 clippy --manifest-path ./pythnet/message_buffer/Cargo.toml --tests -- --deny warnings
  96. pass_filenames: false
  97. files: pythnet/message_buffer
  98. # Hooks for pythnet_sdk
  99. - id: cargo-fmt-pythnet-sdk
  100. name: Cargo format for pythnet SDK
  101. language: "rust"
  102. entry: cargo +1.82.0 fmt --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --all
  103. pass_filenames: false
  104. files: pythnet/pythnet_sdk
  105. - id: cargo-clippy-pythnet-sdk
  106. name: Cargo clippy for pythnet SDK
  107. language: "rust"
  108. entry: cargo +1.82.0 clippy --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --tests -- --deny warnings
  109. pass_filenames: false
  110. files: pythnet/pythnet_sdk
  111. # Hooks for solana receiver contract
  112. - id: cargo-fmt-pyth-solana-receiver
  113. name: Cargo format for solana target chain contract
  114. language: "rust"
  115. entry: cargo +1.73.0 fmt --manifest-path ./target_chains/solana/Cargo.toml --all
  116. pass_filenames: false
  117. files: target_chains/solana
  118. - id: cargo-clippy-pyth-solana-receiver
  119. name: Cargo clippy for solana target chain contract
  120. language: "rust"
  121. entry: cargo +1.73.0 clippy --manifest-path ./target_chains/solana/Cargo.toml --tests -- --deny warnings
  122. pass_filenames: false
  123. files: target_chains/solana
  124. # For Lazer
  125. - id: cargo-fmt-lazer
  126. name: Cargo format for Lazer
  127. language: "rust"
  128. entry: cargo +1.82.0 fmt --manifest-path ./lazer/Cargo.toml --all
  129. pass_filenames: false
  130. files: lazer
  131. - id: cargo-clippy-lazer
  132. name: Cargo clippy for Lazer
  133. language: "rust"
  134. entry: cargo +1.82.0 clippy --manifest-path ./lazer/Cargo.toml --all-targets -- --deny warnings
  135. pass_filenames: false
  136. files: lazer
  137. - id: cargo-fmt-stylus-sdk
  138. name: Cargo format for Stylus SDK
  139. language: "rust"
  140. entry: cargo +1.82.0 fmt --manifest-path ./target_chains/ethereum/sdk/stylus/Cargo.toml --all
  141. pass_filenames: false
  142. files: target_chains/ethereum/sdk/stylus
  143. - id: cargo-clippy-stylus-sdk
  144. name: Cargo clippy for Stylus SDK
  145. language: "rust"
  146. entry: cargo +1.82.0 clippy --manifest-path ./target_chains/ethereum/sdk/stylus/Cargo.toml --all-targets -- --deny warnings
  147. pass_filenames: false
  148. files: target_chains/ethereum/sdk/stylus
  149. - id: fmt-aptos-lazer
  150. name: Format Aptos Lazer contracts
  151. language: system
  152. entry: aptos move fmt --package-path lazer/contracts/aptos
  153. pass_filenames: false
  154. files: lazer/contracts/aptos
  155. - id: lint-aptos-lazer
  156. name: Lint Aptos Lazer contracts
  157. language: system
  158. entry: aptos move lint --package-dir lazer/contracts/aptos --check-test-code --dev
  159. pass_filenames: false
  160. files: lazer/contracts/aptos