-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style: add pre-commit, typos and ruff, fix several #64
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a5db7d9
style: add pre-commit, typos and ruff, fix some
qartik ebd93fc
style: ruff auto fixes
qartik 6e45c5f
style: ruff unsafe auto fixes
qartik e7c422d
style: fix ruff errors on rest of the tests, disable S101
qartik 6e940a9
style: remaining ruff fixes (manually done), disable some lints
qartik 9fcca78
chore: update deps
qartik b540e19
build: add MANIFEST file
qartik ab28772
reviewfix: exclude validator in MANIFEST, fix style
qartik 1a39a2f
reviewfix: exclude tests/error in ruff.toml, enable autofix
qartik d001f27
style: allow auto ruff formatting
qartik 7d171fe
Revert changes done by EM101, EM102; ignore those w/ TRY003
qartik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,65 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 # Use the ref you want to point at | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-executables-have-shebangs | ||
- id: check-merge-conflict | ||
- id: check-toml | ||
- id: check-vcs-permalinks | ||
- id: check-yaml | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
- id: fix-byte-order-marker | ||
- id: mixed-line-ending | ||
# - id: trailing-whitespace | ||
# Python-specific | ||
- id: check-ast | ||
- id: check-docstring-first | ||
- id: debug-statements | ||
|
||
- repo: https://github.com/crate-ci/typos | ||
rev: v1.16.23 | ||
hooks: | ||
- id: typos | ||
args: [] | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.7 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
- id: ruff-format | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: 'v1.3.0' | ||
hooks: | ||
- id: mypy | ||
pass_filenames: false | ||
args: [--package=guppy] | ||
additional_dependencies: [ | ||
ormsgpack, | ||
pydantic, | ||
] | ||
|
||
- repo: local | ||
hooks: | ||
- id: cargo-check | ||
name: Cargo check | ||
entry: bash -c 'cd validator && exec cargo check' | ||
pass_filenames: false | ||
types: [file, rust] | ||
language: system | ||
- id: rust-linting | ||
name: Rust linting | ||
entry: bash -c 'cd validator && exec cargo fmt --all --' | ||
pass_filenames: true | ||
types: [file, rust] | ||
language: system | ||
- id: rust-clippy | ||
name: Rust clippy | ||
entry: bash -c 'cd validator && exec cargo clippy --all-targets --all-features -- -Dclippy::all' | ||
pass_filenames: false | ||
types: [file, rust] | ||
language: system |
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,3 @@ | ||
[default.extend-words] | ||
inot = "inot" | ||
fle = "fle" |
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,12 @@ | ||
include *.toml | ||
include *.txt | ||
include *.yaml | ||
recursive-include examples *.ipynb | ||
recursive-include guppy *.py | ||
recursive-include tests *.err | ||
recursive-include tests *.py | ||
recursive-include tests *.sh | ||
recursive-exclude validator *.lock | ||
recursive-exclude validator *.rs | ||
recursive-exclude validator *.toml | ||
exclude .git-blame-ignore-revs |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't work well with
.err
files.