-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add pre-commit #11541
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
Add pre-commit #11541
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
d8c63eb
Add pre-commit
cbrnr 7c6f66c
Add GitHub workflow
cbrnr 91b04fd
Exclude __init__.py (Ruff)
cbrnr 74f05ef
Add per-file ignore
cbrnr 33e348a
Quiet Black
cbrnr 8d73a6e
Add Codespell config
cbrnr 390f872
Fix TOML
cbrnr 1220e04
Include instead of exclude files
cbrnr e638c9d
Try args
cbrnr 35a1139
Quote args
cbrnr df77fa6
Just one string
cbrnr 7111930
Single quotes
cbrnr 1f056aa
More Ruff excludes
cbrnr 3e3a373
Disable Black and Ruff for now
cbrnr e577370
Filter files and types
cbrnr 45d50ca
Add tomli dependency for codespell
cbrnr 14b692a
Enable Ruff
cbrnr 5f5a28e
Fix Ruff errors
cbrnr b5789de
Exclude *.yaml
cbrnr 4cf0920
Try without tomli package again
cbrnr 19f7e4f
Even 3.11 requires tomli
cbrnr 48209ee
Try new Codespell without tomli
cbrnr adcdebf
Add .inc files for codespell
cbrnr fc44493
Remove Codespell from old workflow
cbrnr 427edb8
Remove flake and codespell from Azure
cbrnr aeb6ecf
Ignore .ruff_cache/
cbrnr a614a20
Enable W rules in Ruff
cbrnr 903c94d
Enable pydocstyle in Ruff
cbrnr db5bdc4
Ignore several pydocstyle rules
cbrnr 92fd631
Check for numpydoc style
cbrnr fd3b8ba
Ignore more D rules
cbrnr 8b91fa3
Fix key
cbrnr 83895fe
Pydocstyle specific excludes
cbrnr 18818f6
Fix ignores
cbrnr d2502d6
Fix convention
cbrnr 8e11f3e
Fix ignore
cbrnr 9af3e9e
Move ignore
cbrnr befaf10
Remove excludes for pydocstyle
cbrnr fbb4da8
FIX: Closer
larsoner 8a65b16
FIX: TOMLY
larsoner 4655f04
FIX: Reqs
larsoner 593a625
FIX: Cleaner
larsoner 1770b7b
Merge remote-tracking branch 'upstream/main' into precommit
larsoner b450907
FIX: Fix em
larsoner 6416b6f
FIX: More
larsoner f1b7076
FIX: Install hooks
larsoner 1414b22
FIX: Ver
larsoner 1f297d6
FIX: Instructions
larsoner a9427fc
FIX: Explain
larsoner 61f4562
Apply suggestions from code review
larsoner 2545bb6
Apply suggestions from code review
larsoner d0c00a3
FIX: D107
larsoner 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 was deleted.
Oops, something went wrong.
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,14 @@ | ||
| name: Pre-commit | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| style: | ||
| name: Pre-commit | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.11' | ||
| - uses: pre-commit/action@v3.0.0 |
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 |
|---|---|---|
|
|
@@ -92,5 +92,5 @@ cover | |
| venv/ | ||
| *.json | ||
| .hypothesis/ | ||
|
|
||
| .ruff_cache/ | ||
| .ipynb_checkpoints/ | ||
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,36 @@ | ||
| default_language_version: | ||
| python: python3.11 | ||
|
|
||
| repos: | ||
| # - repo: https://github.com/psf/black | ||
| # rev: 23.1.0 | ||
| # hooks: | ||
| # - id: black | ||
| # args: [--quiet] | ||
|
|
||
| # Ruff mne | ||
| - repo: https://github.com/charliermarsh/ruff-pre-commit | ||
| rev: v0.0.262 | ||
| hooks: | ||
| - id: ruff | ||
| name: ruff mne | ||
| files: ^mne/ | ||
|
|
||
| # Ruff tutorials and examples | ||
| - repo: https://github.com/charliermarsh/ruff-pre-commit | ||
| rev: v0.0.262 | ||
| hooks: | ||
| - id: ruff | ||
| name: ruff tutorials and examples | ||
| # D103: missing docstring in public function | ||
| # D400: docstring first line must end with period | ||
| args: ["--ignore=D103,D400"] | ||
| files: ^tutorials/|^examples/ | ||
|
|
||
| # Codespell | ||
| - repo: https://github.com/codespell-project/codespell | ||
| rev: v2.2.3 | ||
| hooks: | ||
| - id: codespell | ||
| files: ^mne/|^doc/|^examples/|^tutorials/ | ||
| types_or: [python, bib, rst, inc] | ||
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
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
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.