pyth-crosschain/.pre-commit-config.yaml

127 lines
5.7 KiB
YAML
Raw Normal View History

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
exclude: package-lock.json
# 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"
- repo: local
hooks:
# Hooks for the remote executor
2022-11-28 09:22:48 -08:00
- id: cargo-fmt-remote-executor
name: Cargo format for remote executor
language: "rust"
entry: cargo +nightly-2023-03-01 fmt --manifest-path ./governance/remote_executor/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: governance/remote_executor
2022-11-28 09:22:48 -08:00
- id: cargo-clippy-remote-executor
name: Cargo clippy for remote executor
language: "rust"
entry: cargo +nightly-2023-03-01 clippy --manifest-path ./governance/remote_executor/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: governance/remote_executor
# Hooks for cosmwasm contract
2022-11-28 09:22:48 -08:00
- id: cargo-fmt-cosmwasm
name: Cargo format for cosmwasm contract
language: "rust"
entry: cargo +nightly-2023-03-01 fmt --manifest-path ./target_chains/cosmwasm/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: target_chains/cosmwasm
2022-11-28 09:22:48 -08:00
- id: cargo-clippy-cosmwasm
name: Cargo clippy for cosmwasm contract
language: "rust"
entry: cargo +nightly-2023-03-01 clippy --manifest-path ./target_chains/cosmwasm/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
2022-11-28 09:22:48 -08:00
pass_filenames: false
files: target_chains/cosmwasm
# Hooks for Hermes
- id: cargo-fmt-hermes
name: Cargo format for Hermes
language: "rust"
entry: cargo +nightly-2024-03-26 fmt --manifest-path ./apps/hermes/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: apps/hermes
- id: cargo-clippy-hermes
name: Cargo clippy for Hermes
language: "rust"
entry: cargo +nightly-2024-03-26 clippy --manifest-path ./apps/hermes/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: apps/hermes
2023-10-20 09:41:05 -07:00
# Hooks for Fortuna
- id: cargo-fmt-fortuna
name: Cargo format for Fortuna
language: "rust"
entry: cargo +nightly-2023-07-23 fmt --manifest-path ./apps/fortuna/Cargo.toml --all -- --config-path rustfmt.toml
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 +nightly-2023-03-01 fmt --manifest-path ./pythnet/message_buffer/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: pythnet/message_buffer
- id: cargo-clippy-message-buffer
name: Cargo clippy for message buffer contract
language: "rust"
entry: cargo +nightly-2023-03-01 clippy --manifest-path ./pythnet/message_buffer/Cargo.toml --tests --fix --allow-dirty --allow-staged --features test-bpf -- -D warnings
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 +nightly-2023-07-23 fmt --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: pythnet/pythnet_sdk
- id: cargo-clippy-pythnet-sdk
name: Cargo clippy for pythnet SDK
language: "rust"
entry: cargo +nightly-2023-07-23 clippy --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D 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 +nightly-2023-03-01 fmt --manifest-path ./target_chains/solana/Cargo.toml --all -- --config-path rustfmt.toml
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 +nightly-2023-03-01 clippy --manifest-path ./target_chains/solana/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: target_chains/solana
Express relay python searcher (#1319) * move js searcher sdk * add the python searcher sdk * remove pycache * create class for simple searcher * add websocket to python searcher sdk * finish ws, avoid storing liquidation opportunities within client * python scripts now working w auto type generation * minor precommit changes * address comments 1 * add openapi type generations * fixed precommit issues on generated type files * reorg * fixed openapi_client generated precommit * fix js filepath issue * added close ws * renamings and add send_ws_message method * get rid of duplicate error parsing * cleanup * set up pypi workflow * address comments * add python precommit * changes + precommit changes * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * correct directory for poetry in pypi wf * remove isort * rename package * add UUID and some cleanup * new openapi typings * add pydantic to pyproj * more changes * precommit * remove extraneous files, stick w actual_instance * added back http as nondefault * correction * some cleanup and reorg * minor changes * add back api response typing file * minorer changes * exclude openapi_client from end of file fixer * build internal models via pydantic * chgs * start to reorg classes * configure precommit to work * some cleanup * reorg a bit * address comments * chgs * fgt * morechgs * some more chgs --------- Co-authored-by: ani <ani@Anirudhs-MacBook-Pro.local> Co-authored-by: ani <ani@Anirudhs-MBP.cable.rcn.com>
2024-03-15 12:08:48 -07:00
# For express relay python files
- id: poetry-install
name: poetry install
entry: poetry -C express_relay/sdk/python/express_relay install
pass_filenames: false
files: express_relay/sdk/python/express_relay
language: "system"
Express relay python searcher (#1319) * move js searcher sdk * add the python searcher sdk * remove pycache * create class for simple searcher * add websocket to python searcher sdk * finish ws, avoid storing liquidation opportunities within client * python scripts now working w auto type generation * minor precommit changes * address comments 1 * add openapi type generations * fixed precommit issues on generated type files * reorg * fixed openapi_client generated precommit * fix js filepath issue * added close ws * renamings and add send_ws_message method * get rid of duplicate error parsing * cleanup * set up pypi workflow * address comments * add python precommit * changes + precommit changes * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * correct directory for poetry in pypi wf * remove isort * rename package * add UUID and some cleanup * new openapi typings * add pydantic to pyproj * more changes * precommit * remove extraneous files, stick w actual_instance * added back http as nondefault * correction * some cleanup and reorg * minor changes * add back api response typing file * minorer changes * exclude openapi_client from end of file fixer * build internal models via pydantic * chgs * start to reorg classes * configure precommit to work * some cleanup * reorg a bit * address comments * chgs * fgt * morechgs * some more chgs --------- Co-authored-by: ani <ani@Anirudhs-MacBook-Pro.local> Co-authored-by: ani <ani@Anirudhs-MBP.cable.rcn.com>
2024-03-15 12:08:48 -07:00
- id: black
name: black
entry: poetry -C express_relay/sdk/python/express_relay run black
files: express_relay/sdk/python/express_relay
Express relay python searcher (#1319) * move js searcher sdk * add the python searcher sdk * remove pycache * create class for simple searcher * add websocket to python searcher sdk * finish ws, avoid storing liquidation opportunities within client * python scripts now working w auto type generation * minor precommit changes * address comments 1 * add openapi type generations * fixed precommit issues on generated type files * reorg * fixed openapi_client generated precommit * fix js filepath issue * added close ws * renamings and add send_ws_message method * get rid of duplicate error parsing * cleanup * set up pypi workflow * address comments * add python precommit * changes + precommit changes * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * correct directory for poetry in pypi wf * remove isort * rename package * add UUID and some cleanup * new openapi typings * add pydantic to pyproj * more changes * precommit * remove extraneous files, stick w actual_instance * added back http as nondefault * correction * some cleanup and reorg * minor changes * add back api response typing file * minorer changes * exclude openapi_client from end of file fixer * build internal models via pydantic * chgs * start to reorg classes * configure precommit to work * some cleanup * reorg a bit * address comments * chgs * fgt * morechgs * some more chgs --------- Co-authored-by: ani <ani@Anirudhs-MacBook-Pro.local> Co-authored-by: ani <ani@Anirudhs-MBP.cable.rcn.com>
2024-03-15 12:08:48 -07:00
language: "system"
- id: pyflakes
name: pyflakes
entry: poetry -C express_relay/sdk/python/express_relay run pyflakes
files: express_relay/sdk/python/express_relay
Express relay python searcher (#1319) * move js searcher sdk * add the python searcher sdk * remove pycache * create class for simple searcher * add websocket to python searcher sdk * finish ws, avoid storing liquidation opportunities within client * python scripts now working w auto type generation * minor precommit changes * address comments 1 * add openapi type generations * fixed precommit issues on generated type files * reorg * fixed openapi_client generated precommit * fix js filepath issue * added close ws * renamings and add send_ws_message method * get rid of duplicate error parsing * cleanup * set up pypi workflow * address comments * add python precommit * changes + precommit changes * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * correct directory for poetry in pypi wf * remove isort * rename package * add UUID and some cleanup * new openapi typings * add pydantic to pyproj * more changes * precommit * remove extraneous files, stick w actual_instance * added back http as nondefault * correction * some cleanup and reorg * minor changes * add back api response typing file * minorer changes * exclude openapi_client from end of file fixer * build internal models via pydantic * chgs * start to reorg classes * configure precommit to work * some cleanup * reorg a bit * address comments * chgs * fgt * morechgs * some more chgs --------- Co-authored-by: ani <ani@Anirudhs-MacBook-Pro.local> Co-authored-by: ani <ani@Anirudhs-MBP.cable.rcn.com>
2024-03-15 12:08:48 -07:00
language: "system"
- id: mypy
name: mypy
entry: poetry -C express_relay/sdk/python/express_relay run mypy
files: express_relay/sdk/python/express_relay
Express relay python searcher (#1319) * move js searcher sdk * add the python searcher sdk * remove pycache * create class for simple searcher * add websocket to python searcher sdk * finish ws, avoid storing liquidation opportunities within client * python scripts now working w auto type generation * minor precommit changes * address comments 1 * add openapi type generations * fixed precommit issues on generated type files * reorg * fixed openapi_client generated precommit * fix js filepath issue * added close ws * renamings and add send_ws_message method * get rid of duplicate error parsing * cleanup * set up pypi workflow * address comments * add python precommit * changes + precommit changes * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * correct directory for poetry in pypi wf * remove isort * rename package * add UUID and some cleanup * new openapi typings * add pydantic to pyproj * more changes * precommit * remove extraneous files, stick w actual_instance * added back http as nondefault * correction * some cleanup and reorg * minor changes * add back api response typing file * minorer changes * exclude openapi_client from end of file fixer * build internal models via pydantic * chgs * start to reorg classes * configure precommit to work * some cleanup * reorg a bit * address comments * chgs * fgt * morechgs * some more chgs --------- Co-authored-by: ani <ani@Anirudhs-MacBook-Pro.local> Co-authored-by: ani <ani@Anirudhs-MBP.cable.rcn.com>
2024-03-15 12:08:48 -07:00
language: "system"