.pre-commit-config.yaml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. # Hook to format many type of files in the repo
  27. # including solidity contracts.
  28. - repo: https://github.com/pre-commit/mirrors-prettier
  29. rev: "v2.7.1"
  30. hooks:
  31. - id: prettier
  32. additional_dependencies:
  33. - "prettier@2.7.1"
  34. - "prettier-plugin-solidity@1.0.0-rc.1"
  35. exclude: target_chains/sui/vendor/
  36. - repo: local
  37. hooks:
  38. # Hooks for the remote executor
  39. - id: cargo-fmt-remote-executor
  40. name: Cargo format for remote executor
  41. language: "rust"
  42. entry: cargo +1.66.1 fmt --manifest-path ./governance/remote_executor/Cargo.toml --all
  43. pass_filenames: false
  44. files: governance/remote_executor
  45. - id: cargo-clippy-remote-executor
  46. name: Cargo clippy for remote executor
  47. language: "rust"
  48. entry: cargo +1.66.1 clippy --manifest-path ./governance/remote_executor/Cargo.toml --tests -- --deny warnings
  49. pass_filenames: false
  50. files: governance/remote_executor
  51. # Hooks for cosmwasm contract
  52. - id: cargo-fmt-cosmwasm
  53. name: Cargo format for cosmwasm contract
  54. language: "rust"
  55. entry: cargo +1.82.0 fmt --manifest-path ./target_chains/cosmwasm/Cargo.toml --all
  56. pass_filenames: false
  57. files: target_chains/cosmwasm
  58. - id: cargo-clippy-cosmwasm
  59. name: Cargo clippy for cosmwasm contract
  60. language: "rust"
  61. entry: cargo +1.82.0 clippy --manifest-path ./target_chains/cosmwasm/Cargo.toml --tests -- --deny warnings
  62. pass_filenames: false
  63. files: target_chains/cosmwasm
  64. # Hooks for Hermes
  65. - id: cargo-fmt-hermes
  66. name: Cargo format for Hermes
  67. language: "rust"
  68. entry: cargo +1.82.0 fmt --manifest-path ./apps/hermes/server/Cargo.toml --all
  69. pass_filenames: false
  70. files: apps/hermes
  71. - id: cargo-clippy-hermes
  72. name: Cargo clippy for Hermes
  73. language: "rust"
  74. entry: cargo +1.82.0 clippy --manifest-path ./apps/hermes/server/Cargo.toml --tests -- --deny warnings
  75. pass_filenames: false
  76. files: apps/hermes
  77. # Hooks for Fortuna
  78. - id: cargo-fmt-fortuna
  79. name: Cargo format for Fortuna
  80. language: "rust"
  81. entry: cargo +1.82.0 fmt --manifest-path ./apps/fortuna/Cargo.toml --all
  82. pass_filenames: false
  83. files: apps/fortuna
  84. - id: cargo-clippy-fortuna
  85. name: Cargo clippy for Fortuna
  86. language: "rust"
  87. entry: cargo +1.82.0 clippy --manifest-path ./apps/fortuna/Cargo.toml --tests -- --deny warnings
  88. pass_filenames: false
  89. files: apps/fortuna
  90. # Hooks for message buffer contract
  91. - id: cargo-fmt-message-buffer
  92. name: Cargo format for message buffer contract
  93. language: "rust"
  94. entry: cargo +1.66.1 fmt --manifest-path ./pythnet/message_buffer/Cargo.toml --all
  95. pass_filenames: false
  96. files: pythnet/message_buffer
  97. - id: cargo-clippy-message-buffer
  98. name: Cargo clippy for message buffer contract
  99. language: "rust"
  100. entry: cargo +1.66.1 clippy --manifest-path ./pythnet/message_buffer/Cargo.toml --tests -- --deny warnings
  101. pass_filenames: false
  102. files: pythnet/message_buffer
  103. # Hooks for pythnet_sdk
  104. - id: cargo-fmt-pythnet-sdk
  105. name: Cargo format for pythnet SDK
  106. language: "rust"
  107. entry: cargo +1.82.0 fmt --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --all
  108. pass_filenames: false
  109. files: pythnet/pythnet_sdk
  110. - id: cargo-clippy-pythnet-sdk
  111. name: Cargo clippy for pythnet SDK
  112. language: "rust"
  113. entry: cargo +1.82.0 clippy --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --tests -- --deny warnings
  114. pass_filenames: false
  115. files: pythnet/pythnet_sdk
  116. # Hooks for solana receiver contract
  117. - id: cargo-fmt-pyth-solana-receiver
  118. name: Cargo format for solana target chain contract
  119. language: "rust"
  120. entry: cargo +1.73.0 fmt --manifest-path ./target_chains/solana/Cargo.toml --all
  121. pass_filenames: false
  122. files: target_chains/solana
  123. - id: cargo-clippy-pyth-solana-receiver
  124. name: Cargo clippy for solana target chain contract
  125. language: "rust"
  126. entry: cargo +1.73.0 clippy --manifest-path ./target_chains/solana/Cargo.toml --tests -- --deny warnings
  127. pass_filenames: false
  128. files: target_chains/solana
  129. # For Lazer
  130. - id: cargo-fmt-lazer
  131. name: Cargo format for Lazer
  132. language: "rust"
  133. entry: cargo +1.82.0 fmt --manifest-path ./lazer/Cargo.toml --all
  134. pass_filenames: false
  135. files: lazer
  136. - id: cargo-clippy-lazer
  137. name: Cargo clippy for Lazer
  138. language: "rust"
  139. entry: cargo +1.82.0 clippy --manifest-path ./lazer/Cargo.toml --all-targets -- --deny warnings
  140. pass_filenames: false
  141. files: lazer