-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add formatters, pre-commit checks, ci, etc. (#6)
* Cleanup multicall-status * Setup formatting and pre-commit * Cleanup solidity formatting * Format python files * fixed formatting issue --------- Co-authored-by: Anirudh Suresh <[email protected]>
- Loading branch information
Showing
38 changed files
with
1,132 additions
and
565 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Pre-commit checks | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# Need to grab the history of the PR | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly-2023-03-01 | ||
components: rustfmt, clippy | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly-2023-07-23 | ||
components: rustfmt, clippy | ||
- uses: pre-commit/[email protected] | ||
if: ${{ github.event_name == 'pull_request' }} | ||
with: | ||
# Run only on files changed in the PR | ||
extra_args: --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }} | ||
- uses: pre-commit/[email protected] | ||
if: ${{ github.event_name != 'pull_request' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
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: | ||
- "[email protected]" | ||
- "[email protected]" | ||
- repo: local | ||
hooks: | ||
# Hooks for auction server | ||
- id: cargo-fmt-auction-server | ||
name: Cargo format for auction server | ||
language: "rust" | ||
entry: cargo +nightly-2023-07-23 fmt --manifest-path ./auction-server/Cargo.toml --all -- --config-path rustfmt.toml | ||
pass_filenames: false | ||
files: auction-server | ||
|
||
# for python files | ||
- repo: https://github.com/hhatto/autopep8 | ||
rev: "v2.0.4" | ||
hooks: | ||
- id: autopep8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.