.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: pnpm-fix-format
  29. name: Format files using pnpm fix:format
  30. entry: bash -c 'cd $(git rev-parse --show-toplevel) && pnpm install --no-frozen-lockfile && pnpm turbo run fix:format --filter=!./packages/fonts'
  31. language: node
  32. language_version: "22.11.0"
  33. pass_filenames: false
  34. additional_dependencies:
  35. - "pnpm@9.15.4"
  36. - "turbo@2.2.3"
  37. exclude: >
  38. (?x)^(
  39. target_chains/sui/vendor/|
  40. patches/|
  41. apps/hermes/server/proto/vendor/
  42. )
  43. - repo: local
  44. hooks:
  45. # Hooks for the remote executor
  46. - id: cargo-fmt-remote-executor
  47. name: Cargo format for remote executor
  48. language: "rust"
  49. entry: cargo +1.73.0 fmt --manifest-path ./governance/remote_executor/Cargo.toml --all
  50. pass_filenames: false
  51. files: governance/remote_executor
  52. - id: cargo-clippy-remote-executor
  53. name: Cargo clippy for remote executor
  54. language: "rust"
  55. entry: cargo +1.73.0 clippy --manifest-path ./governance/remote_executor/Cargo.toml --tests -- --deny warnings
  56. pass_filenames: false
  57. files: governance/remote_executor
  58. # Hooks for cosmwasm contract
  59. - id: cargo-fmt-cosmwasm
  60. name: Cargo format for cosmwasm contract
  61. language: "rust"
  62. entry: cargo +1.82.0 fmt --manifest-path ./target_chains/cosmwasm/Cargo.toml --all
  63. pass_filenames: false
  64. files: target_chains/cosmwasm
  65. - id: cargo-clippy-cosmwasm
  66. name: Cargo clippy for cosmwasm contract
  67. language: "rust"
  68. entry: cargo +1.82.0 clippy --manifest-path ./target_chains/cosmwasm/Cargo.toml --tests -- --deny warnings
  69. pass_filenames: false
  70. files: target_chains/cosmwasm
  71. # Hooks for Hermes
  72. - id: cargo-fmt-hermes
  73. name: Cargo format for Hermes
  74. language: "rust"
  75. entry: cargo +1.82.0 fmt --manifest-path ./apps/hermes/server/Cargo.toml --all
  76. pass_filenames: false
  77. files: apps/hermes
  78. - id: cargo-clippy-hermes
  79. name: Cargo clippy for Hermes
  80. language: "rust"
  81. entry: cargo +1.82.0 clippy --manifest-path ./apps/hermes/server/Cargo.toml --tests -- --deny warnings
  82. pass_filenames: false
  83. files: apps/hermes
  84. # Hooks for Fortuna
  85. - id: cargo-fmt-fortuna
  86. name: Cargo format for Fortuna
  87. language: "rust"
  88. entry: cargo +1.82.0 fmt --manifest-path ./apps/fortuna/Cargo.toml --all
  89. pass_filenames: false
  90. files: apps/fortuna
  91. - id: cargo-clippy-fortuna
  92. name: Cargo clippy for Fortuna
  93. language: "rust"
  94. entry: cargo +1.82.0 clippy --manifest-path ./apps/fortuna/Cargo.toml --tests -- --deny warnings
  95. pass_filenames: false
  96. files: apps/fortuna
  97. # Hooks for message buffer contract
  98. - id: cargo-fmt-message-buffer
  99. name: Cargo format for message buffer contract
  100. language: "rust"
  101. entry: cargo +1.66.1 fmt --manifest-path ./pythnet/message_buffer/Cargo.toml --all
  102. pass_filenames: false
  103. files: pythnet/message_buffer
  104. - id: cargo-clippy-message-buffer
  105. name: Cargo clippy for message buffer contract
  106. language: "rust"
  107. entry: cargo +1.66.1 clippy --manifest-path ./pythnet/message_buffer/Cargo.toml --tests -- --deny warnings
  108. pass_filenames: false
  109. files: pythnet/message_buffer
  110. # Hooks for pythnet_sdk
  111. - id: cargo-fmt-pythnet-sdk
  112. name: Cargo format for pythnet SDK
  113. language: "rust"
  114. entry: cargo +1.82.0 fmt --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --all
  115. pass_filenames: false
  116. files: pythnet/pythnet_sdk
  117. - id: cargo-clippy-pythnet-sdk
  118. name: Cargo clippy for pythnet SDK
  119. language: "rust"
  120. entry: cargo +1.82.0 clippy --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --tests -- --deny warnings
  121. pass_filenames: false
  122. files: pythnet/pythnet_sdk
  123. # Hooks for solana receiver contract
  124. - id: cargo-fmt-pyth-solana-receiver
  125. name: Cargo format for solana target chain contract
  126. language: "rust"
  127. entry: cargo +1.73.0 fmt --manifest-path ./target_chains/solana/Cargo.toml --all
  128. pass_filenames: false
  129. files: target_chains/solana
  130. - id: cargo-clippy-pyth-solana-receiver
  131. name: Cargo clippy for solana target chain contract
  132. language: "rust"
  133. entry: cargo +1.73.0 clippy --manifest-path ./target_chains/solana/Cargo.toml --tests -- --deny warnings
  134. pass_filenames: false
  135. files: target_chains/solana
  136. # For Lazer
  137. - id: cargo-fmt-lazer
  138. name: Cargo format for Lazer
  139. language: "rust"
  140. entry: cargo +1.82.0 fmt --manifest-path ./lazer/Cargo.toml --all
  141. pass_filenames: false
  142. files: lazer
  143. - id: cargo-clippy-lazer
  144. name: Cargo clippy for Lazer
  145. language: "rust"
  146. entry: cargo +1.82.0 clippy --manifest-path ./lazer/Cargo.toml --all-targets -- --deny warnings
  147. pass_filenames: false
  148. files: lazer
  149. - id: cargo-fmt-stylus-sdk
  150. name: Cargo format for Stylus SDK
  151. language: "rust"
  152. entry: cargo +1.82.0 fmt --manifest-path ./target_chains/ethereum/sdk/stylus/Cargo.toml --all
  153. pass_filenames: false
  154. files: target_chains/ethereum/sdk/stylus
  155. - id: cargo-clippy-stylus-sdk
  156. name: Cargo clippy for Stylus SDK
  157. language: "rust"
  158. entry: cargo +1.82.0 clippy --manifest-path ./target_chains/ethereum/sdk/stylus/Cargo.toml --all-targets -- --deny warnings
  159. pass_filenames: false
  160. files: target_chains/ethereum/sdk/stylus