浏览代码

roll back

keyvan 10 月之前
父节点
当前提交
92f9bfb0a7
共有 2 个文件被更改,包括 131 次插入138 次删除
  1. 5 12
      .github/workflows/ci-pre-commit.yml
  2. 126 126
      .pre-commit-config.yaml

+ 5 - 12
.github/workflows/ci-pre-commit.yml

@@ -25,18 +25,11 @@ jobs:
         run: |
           rustup install 1.66.1
           rustup install 1.73.0
-      # - name: Install clang
-      #   run: |
-      #     sudo apt-get update
-      #     sudo apt install make clang-14 pkg-config libssl-dev
-      #     sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 100
-      #     clang -v
       - name: Set up Clang
         uses: egor-tensin/setup-clang@v1
         with:
           version: 14
           platform: x64
-      - run: clang -v
       - name: Install protoc
         uses: arduino/setup-protoc@v3
       - name: Install poetry
@@ -45,11 +38,11 @@ jobs:
         with:
           python-version: ${{ env.PYTHON_VERSION }}
         id: setup_python
-      # - name: Cache Poetry cache
-      #   uses: actions/cache@v3
-      #   with:
-      #     path: ~/.cache/pypoetry
-      #     key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }}
+      - name: Cache Poetry cache
+        uses: actions/cache@v3
+        with:
+          path: ~/.cache/pypoetry
+          key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }}
       - uses: pre-commit/action@v3.0.0
         if: ${{ github.event_name == 'pull_request' }}
         # with:

+ 126 - 126
.pre-commit-config.yaml

@@ -1,99 +1,99 @@
 repos:
-  # - repo: https://github.com/pre-commit/pre-commit-hooks
-  #   rev: v3.2.0
-  #   hooks:
-  #     - id: trailing-whitespace
-  #       exclude: >
-  #         (?x)^(
-  #           target_chains/sui/vendor/|
-  #           patches/|
-  #           apps/hermes/server/proto/vendor/
-  #         )
-  #     - id: end-of-file-fixer
-  #       exclude: >
-  #         (?x)^(
-  #           target_chains/sui/vendor/|
-  #           patches/|
-  #           apps/api-reference/public/currency-icons/|
-  #           apps/hermes/server/proto/vendor/
-  #         )
-  #     - id: check-added-large-files
-  #       exclude: >
-  #         (?x)^(
-  #           target_chains/sui/vendor/|
-  #           patches/
-  #         )
+  - repo: https://github.com/pre-commit/pre-commit-hooks
+    rev: v3.2.0
+    hooks:
+      - id: trailing-whitespace
+        exclude: >
+          (?x)^(
+            target_chains/sui/vendor/|
+            patches/|
+            apps/hermes/server/proto/vendor/
+          )
+      - id: end-of-file-fixer
+        exclude: >
+          (?x)^(
+            target_chains/sui/vendor/|
+            patches/|
+            apps/api-reference/public/currency-icons/|
+            apps/hermes/server/proto/vendor/
+          )
+      - id: check-added-large-files
+        exclude: >
+          (?x)^(
+            target_chains/sui/vendor/|
+            patches/
+          )
   # Hook to format many type of files in the repo
   # including solidity contracts.
-  # - repo: https://github.com/pre-commit/mirrors-prettier
-  #   rev: "v2.7.1"
-  #   hooks:
-  #     - id: prettier
-  #       additional_dependencies:
-  #         - "prettier@2.7.1"
-  #         - "prettier-plugin-solidity@1.0.0-rc.1"
-  #       exclude: target_chains/sui/vendor/
+  - repo: https://github.com/pre-commit/mirrors-prettier
+    rev: "v2.7.1"
+    hooks:
+      - id: prettier
+        additional_dependencies:
+          - "prettier@2.7.1"
+          - "prettier-plugin-solidity@1.0.0-rc.1"
+        exclude: target_chains/sui/vendor/
   - repo: local
     hooks:
       # Hooks for the remote executor
-      # - id: cargo-fmt-remote-executor
-      #   name: Cargo format for remote executor
-      #   language: "rust"
-      #   entry: cargo +1.66.1 fmt --manifest-path ./governance/remote_executor/Cargo.toml --all
-      #   pass_filenames: false
-      #   files: governance/remote_executor
-      # - id: cargo-clippy-remote-executor
-      #   name: Cargo clippy for remote executor
-      #   language: "rust"
-      #   entry: cargo +1.66.1 clippy --manifest-path ./governance/remote_executor/Cargo.toml --tests -- --deny warnings
-      #   pass_filenames: false
-      #   files: governance/remote_executor
-      # # Hooks for cosmwasm contract
-      # - id: cargo-fmt-cosmwasm
-      #   name: Cargo format for cosmwasm contract
-      #   language: "rust"
-      #   entry: cargo +1.82.0 fmt --manifest-path ./target_chains/cosmwasm/Cargo.toml --all
-      #   pass_filenames: false
-      #   files: target_chains/cosmwasm
-      # - id: cargo-clippy-cosmwasm
-      #   name: Cargo clippy for cosmwasm contract
-      #   language: "rust"
-      #   entry: cargo +1.82.0 clippy --manifest-path ./target_chains/cosmwasm/Cargo.toml --tests -- --deny warnings
-      #   pass_filenames: false
-      #   files: target_chains/cosmwasm
-      # # Hooks for Hermes
-      # - id: cargo-fmt-hermes
-      #   name: Cargo format for Hermes
-      #   language: "rust"
-      #   entry: cargo +1.82.0 fmt --manifest-path ./apps/hermes/server/Cargo.toml --all
-      #   pass_filenames: false
-      #   files: apps/hermes
-      # - id: cargo-clippy-hermes
-      #   name: Cargo clippy for Hermes
-      #   language: "rust"
-      #   entry: cargo +1.82.0 clippy --manifest-path ./apps/hermes/server/Cargo.toml --tests -- --deny warnings
-      #   pass_filenames: false
-      #   files: apps/hermes
-      # # Hooks for Fortuna
-      # - id: cargo-fmt-fortuna
-      #   name: Cargo format for Fortuna
-      #   language: "rust"
-      #   entry: cargo +1.82.0 fmt --manifest-path ./apps/fortuna/Cargo.toml --all
-      #   pass_filenames: false
-      #   files: apps/fortuna
-      # - id: cargo-clippy-fortuna
-      #   name: Cargo clippy for Fortuna
-      #   language: "rust"
-      #   entry: cargo +1.82.0 clippy --manifest-path ./apps/fortuna/Cargo.toml --tests -- --deny warnings
-      #   pass_filenames: false
-      #   files: apps/fortuna
-      # # Hooks for message buffer contract
-      # - id: cargo-fmt-message-buffer
-      #   name: Cargo format for message buffer contract
-      #   language: "rust"
-      #   entry: cargo +1.66.1 fmt --manifest-path ./pythnet/message_buffer/Cargo.toml --all
-      #   pass_filenames: false
-      #   files: pythnet/message_buffer
+      - id: cargo-fmt-remote-executor
+        name: Cargo format for remote executor
+        language: "rust"
+        entry: cargo +1.66.1 fmt --manifest-path ./governance/remote_executor/Cargo.toml --all
+        pass_filenames: false
+        files: governance/remote_executor
+      - id: cargo-clippy-remote-executor
+        name: Cargo clippy for remote executor
+        language: "rust"
+        entry: cargo +1.66.1 clippy --manifest-path ./governance/remote_executor/Cargo.toml --tests -- --deny warnings
+        pass_filenames: false
+        files: governance/remote_executor
+      # Hooks for cosmwasm contract
+      - id: cargo-fmt-cosmwasm
+        name: Cargo format for cosmwasm contract
+        language: "rust"
+        entry: cargo +1.82.0 fmt --manifest-path ./target_chains/cosmwasm/Cargo.toml --all
+        pass_filenames: false
+        files: target_chains/cosmwasm
+      - id: cargo-clippy-cosmwasm
+        name: Cargo clippy for cosmwasm contract
+        language: "rust"
+        entry: cargo +1.82.0 clippy --manifest-path ./target_chains/cosmwasm/Cargo.toml --tests -- --deny warnings
+        pass_filenames: false
+        files: target_chains/cosmwasm
+      # Hooks for Hermes
+      - id: cargo-fmt-hermes
+        name: Cargo format for Hermes
+        language: "rust"
+        entry: cargo +1.82.0 fmt --manifest-path ./apps/hermes/server/Cargo.toml --all
+        pass_filenames: false
+        files: apps/hermes
+      - id: cargo-clippy-hermes
+        name: Cargo clippy for Hermes
+        language: "rust"
+        entry: cargo +1.82.0 clippy --manifest-path ./apps/hermes/server/Cargo.toml --tests -- --deny warnings
+        pass_filenames: false
+        files: apps/hermes
+      # Hooks for Fortuna
+      - id: cargo-fmt-fortuna
+        name: Cargo format for Fortuna
+        language: "rust"
+        entry: cargo +1.82.0 fmt --manifest-path ./apps/fortuna/Cargo.toml --all
+        pass_filenames: false
+        files: apps/fortuna
+      - id: cargo-clippy-fortuna
+        name: Cargo clippy for Fortuna
+        language: "rust"
+        entry: cargo +1.82.0 clippy --manifest-path ./apps/fortuna/Cargo.toml --tests -- --deny warnings
+        pass_filenames: false
+        files: apps/fortuna
+      # Hooks for message buffer contract
+      - id: cargo-fmt-message-buffer
+        name: Cargo format for message buffer contract
+        language: "rust"
+        entry: cargo +1.66.1 fmt --manifest-path ./pythnet/message_buffer/Cargo.toml --all
+        pass_filenames: false
+        files: pythnet/message_buffer
       - id: cargo-clippy-message-buffer
         name: Cargo clippy for message buffer contract
         language: "rust"
@@ -101,41 +101,41 @@ repos:
         pass_filenames: false
         files: pythnet/message_buffer
       # Hooks for pythnet_sdk
-      # - id: cargo-fmt-pythnet-sdk
-      #   name: Cargo format for pythnet SDK
-      #   language: "rust"
-      #   entry: cargo +1.82.0 fmt --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --all
-      #   pass_filenames: false
-      #   files: pythnet/pythnet_sdk
-      # - id: cargo-clippy-pythnet-sdk
-      #   name: Cargo clippy for pythnet SDK
-      #   language: "rust"
-      #   entry: cargo +1.82.0 clippy --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --tests -- --deny warnings
-      #   pass_filenames: false
-      #   files: pythnet/pythnet_sdk
+      - id: cargo-fmt-pythnet-sdk
+        name: Cargo format for pythnet SDK
+        language: "rust"
+        entry: cargo +1.82.0 fmt --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --all
+        pass_filenames: false
+        files: pythnet/pythnet_sdk
+      - id: cargo-clippy-pythnet-sdk
+        name: Cargo clippy for pythnet SDK
+        language: "rust"
+        entry: cargo +1.82.0 clippy --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --tests -- --deny warnings
+        pass_filenames: false
+        files: pythnet/pythnet_sdk
       # Hooks for solana receiver contract
-      # - id: cargo-fmt-pyth-solana-receiver
-      #   name: Cargo format for solana target chain contract
-      #   language: "rust"
-      #   entry: cargo +1.73.0 fmt --manifest-path ./target_chains/solana/Cargo.toml --all
-      #   pass_filenames: false
-      #   files: target_chains/solana
-      # - id: cargo-clippy-pyth-solana-receiver
-      #   name: Cargo clippy for solana target chain contract
-      #   language: "rust"
-      #   entry: cargo +1.73.0 clippy --manifest-path ./target_chains/solana/Cargo.toml --tests -- --deny warnings
-      #   pass_filenames: false
-      #   files: target_chains/solana
+      - id: cargo-fmt-pyth-solana-receiver
+        name: Cargo format for solana target chain contract
+        language: "rust"
+        entry: cargo +1.73.0 fmt --manifest-path ./target_chains/solana/Cargo.toml --all
+        pass_filenames: false
+        files: target_chains/solana
+      - id: cargo-clippy-pyth-solana-receiver
+        name: Cargo clippy for solana target chain contract
+        language: "rust"
+        entry: cargo +1.73.0 clippy --manifest-path ./target_chains/solana/Cargo.toml --tests -- --deny warnings
+        pass_filenames: false
+        files: target_chains/solana
       # For Lazer
-      # - id: cargo-fmt-lazer
-      #   name: Cargo format for Lazer
-      #   language: "rust"
-      #   entry: cargo +1.82.0 fmt --manifest-path ./lazer/Cargo.toml --all
-      #   pass_filenames: false
-      #   files: lazer
-      # - id: cargo-clippy-lazer
-      #   name: Cargo clippy for Lazer
-      #   language: "rust"
-      #   entry: cargo +1.82.0 clippy --manifest-path ./lazer/Cargo.toml --all-targets -- --deny warnings
-      #   pass_filenames: false
-      #   files: lazer
+      - id: cargo-fmt-lazer
+        name: Cargo format for Lazer
+        language: "rust"
+        entry: cargo +1.82.0 fmt --manifest-path ./lazer/Cargo.toml --all
+        pass_filenames: false
+        files: lazer
+      - id: cargo-clippy-lazer
+        name: Cargo clippy for Lazer
+        language: "rust"
+        entry: cargo +1.82.0 clippy --manifest-path ./lazer/Cargo.toml --all-targets -- --deny warnings
+        pass_filenames: false
+        files: lazer