-
Notifications
You must be signed in to change notification settings - Fork 5
Introduce pre-commit hooks #310
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
638240c
initialize pre-commit hooks
Radonirinaunimi 59289db
limit python character length to be 80
Radonirinaunimi e549f67
revert removal of trailing space in tests
Radonirinaunimi 5620f60
add cargo check to hooks
Radonirinaunimi 228f35a
put back removal of trailing white space
Radonirinaunimi d00ad69
always run cargo check whenever rust files are modified
Radonirinaunimi f20d246
actually remove the need for ruff.toml
Radonirinaunimi b992591
fix literal strings in test
Radonirinaunimi 77c9d82
modify the guideline to refer to pre-commit hooks
Radonirinaunimi 00615b0
including more excluded files into ruff
Radonirinaunimi 79b7b1f
ingore ruff-format on for the time being
Radonirinaunimi 6d11bd1
include clippy in hooks but ignore warnings
Radonirinaunimi 9fbb246
start addressing warnings from clippy
Radonirinaunimi 522d943
merge changes from master
Radonirinaunimi d848bd4
Revert "start addressing warnings from clippy"
Radonirinaunimi ced2f8e
fix all warnings from clippy (non-deps related)
Radonirinaunimi ead8262
Revert "fix all warnings from clippy (non-deps related)"
Radonirinaunimi a7c717a
Add back vital spaces
cschwan 9ac905d
Instruct pre-commit to ignore Rust files and release workflow
cschwan a36799d
Try making `patch` ignore spaces
cschwan 0791e42
Use default line length for Python
cschwan 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 hidden or 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
|
felixhekhorn marked this conversation as resolved.
|
This file contains hidden or 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,51 @@ | ||
| # See https://pre-commit.com for more information | ||
| # See https://pre-commit.com/hooks.html for more hooks | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.6.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| # `.rs` files are taken care of by `cargo fmt` | ||
| exclude: ^.*\.rs$ | ||
| - id: end-of-file-fixer | ||
| - id: check-merge-conflict | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| # A fast Python linter and code formatter. See | ||
| # https://docs.astral.sh/ruff/ for more details. | ||
| rev: v0.6.5 | ||
| hooks: | ||
| - id: ruff | ||
| args: [--fix] | ||
| exclude: ^pineappl_cli/src/plot.py | ||
| - id: ruff-format | ||
| args: [] | ||
| # TODO: remove this exclusion once we've merged this into master | ||
|
cschwan marked this conversation as resolved.
|
||
| exclude: ^pineappl_cli/src/plot.py | ||
| - repo: local | ||
| hooks: | ||
| - id: fmt | ||
| name: cargo fmt | ||
| description: Format Rust files with cargo fmt. | ||
| entry: cargo fmt -- | ||
| language: system | ||
| files: ^pineappl\S*\/.*\.rs$ | ||
| args: [] | ||
| - id: check | ||
|
cschwan marked this conversation as resolved.
|
||
| name: cargo check | ||
| description: Run cargo check. | ||
| entry: bash -c 'cargo check --all-targets --features=evolve,fktable' | ||
| language: system | ||
| require_serial: true | ||
| types: [rust] | ||
| - id: clippy | ||
| name: cargo clippy | ||
| description: Check Rust files with cargo clippy. | ||
| # Show only errors and ignore warnings | ||
| entry: cargo clippy --all-targets --features=evolve,fktable -- -Awarnings | ||
| pass_filenames: false | ||
| types: [file, rust] | ||
| language: system | ||
| - repo: https://github.com/pre-commit/pre-commit | ||
| rev: v3.8.0 | ||
| hooks: | ||
| - id: validate_manifest | ||
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -66,4 +66,3 @@ int main() { | |
| // release memory | ||
| pineappl_grid_delete(grid); | ||
| } | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -41,4 +41,3 @@ int main(int argc, char* argv[]) { | |
| pineappl_grid_delete(clone); | ||
| pineappl_grid_delete(grid1); | ||
| } | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -82,4 +82,3 @@ int main(int argc, char* argv[]) { | |
| // release memory | ||
| pineappl_grid_delete(grid); | ||
| } | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.