-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #310 from NNPDF/add-precommit-hooks
Introduce pre-commit hooks
- Loading branch information
Showing
17 changed files
with
231 additions
and
140 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
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,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 | ||
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 | ||
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 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
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 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 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 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
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.