-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add pre-commit #11541
Add pre-commit #11541
Conversation
It seems like the |
New codespell released https://pypi.org/project/codespell/2.2.3/ |
That was quick, thanks for the heads up! I will remove the tomli lines. |
... tomli is still needed for <3.11, though, assuming you want toml support |
Yes, but I'm running pre-commit on Python 3.11. |
Now I wonder why Codespell found these errors in the Azure job but neither in the old GitHub Action nor the new Pre-Commit one:
OK, the last one is clear, because I didn't add Edit: Now the other jobs also found these misspellings, but why not previously? |
my suspicion would be that the azure job is somehow getting different dictionary settings or using a newer codespell version. |
crossref to #11547 |
OK, I fixed it here as well. |
But this begs the question: why do we run Codespell twice? |
no idea. |
I'll remove it then. |
For
And for
|
@cbrnr I'd like to have this sooner rather than later because the time it takes to Want me to push commits to finish or can you do it in the next couple of days? |
Thanks @larsoner, please feel free to finish this up. I still don't know how to run different configurations for ruff-specific tools (i.e. pydocstyle should only be run in I'm happy to review the final PR of course! |
* upstream/main: (50 commits) BUG: Fix bug with paths (mne-tools#11639) MAINT: Report download time and size (mne-tools#11635) MRG: Allow retrieval of channel names via make_1020_channel_selections() (mne-tools#11632) Fix index name in to_data_frame()'s docstring (mne-tools#11457) MAINT: Use VTK prerelease wheels in pre jobs (mne-tools#11629) ENH: Allow gradient compensated data in maxwell_filter (mne-tools#10554) make test compatible with future pandas (mne-tools#11625) Display SVG figures correctly in Report (mne-tools#11623) API: Port ieeg gui over to mne-gui-addons and add tfr gui example (mne-tools#11616) MAINT: Add token [ci skip] (mne-tools#11622) API: One cycle of backward compat (mne-tools#11621) MAINT: Use git rather than zipball (mne-tools#11620) ENH: Speed up code a bit (mne-tools#11614) [BUG, MRG] Don't modify info in place for transform points (mne-tools#11612) [BUG, MRG] Fix topomap extra plot generated, add util to check a range (mne-tools#11607) ENH: Add mne-bids-pipeline to mne sys_info (mne-tools#11606) MAINT: `coding: utf-8` is implicit in Python 3 (mne-tools#11599) ENH: Read eyetracking data (Eyelink) (Fork of mne-tools#10855 ) (mne-tools#11152) MAINT: In Python 3, do not prefix literals with `u` (mne-tools#11604) MAINT: object is an implicit base for all classes (mne-tools#11601) ...
Okay @cbrnr I think this is working, feel free to take a look. I think we can wait on the other points in the top comment. For the GH Actions job dependencies we should first in a separate PR put all our pytest actions in one YAML (which we only had separate for back when you couldn't restart just failed runs) along with this new precommit one. Then we can make the pytest ones depend on the style job very easily. |
@drammock could you also look and make sure you're okay with these changes? Basically:
|
I think we can ignore the SphinxWindows failures... they don't seem related. |
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.
GitHub is highlighting my suggested changes in red, but AFAIK it is valid TOML to include line comments in this way. Is pyproject.toml
more narrowly restricted?
Co-authored-by: Daniel McCloy <[email protected]>
Co-authored-by: Daniel McCloy <[email protected]>
Locally your changes seemed to work fine so I've committed all of them, and also removed D107. It was probably made redundant at some point and we never noticed. Will merge once everything except SphinxWindows comes back green, thanks @cbrnr ! |
Thank you! |
* upstream/main: (152 commits) FIX: missing channels/fiducials can be np.nan (mne-tools#11634) use py3.10 in precommit config (mne-tools#11648) MAINT: Unify GH Actions pytest (mne-tools#11644) MRG: Rename "Discourse" link in top navigation to "Forum" [ci skip] (mne-tools#11649) ENH: Add support for Harmonic Field correction (mne-tools#11536) Add pre-commit (mne-tools#11541) BUG: Fix bug with paths (mne-tools#11639) MAINT: Report download time and size (mne-tools#11635) MRG: Allow retrieval of channel names via make_1020_channel_selections() (mne-tools#11632) Fix index name in to_data_frame()'s docstring (mne-tools#11457) MAINT: Use VTK prerelease wheels in pre jobs (mne-tools#11629) ENH: Allow gradient compensated data in maxwell_filter (mne-tools#10554) make test compatible with future pandas (mne-tools#11625) Display SVG figures correctly in Report (mne-tools#11623) API: Port ieeg gui over to mne-gui-addons and add tfr gui example (mne-tools#11616) MAINT: Add token [ci skip] (mne-tools#11622) API: One cycle of backward compat (mne-tools#11621) MAINT: Use git rather than zipball (mne-tools#11620) ENH: Speed up code a bit (mne-tools#11614) [BUG, MRG] Don't modify info in place for transform points (mne-tools#11612) ...
* upstream/main: (117 commits) FIX: missing channels/fiducials can be np.nan (mne-tools#11634) use py3.10 in precommit config (mne-tools#11648) MAINT: Unify GH Actions pytest (mne-tools#11644) MRG: Rename "Discourse" link in top navigation to "Forum" [ci skip] (mne-tools#11649) ENH: Add support for Harmonic Field correction (mne-tools#11536) Add pre-commit (mne-tools#11541) BUG: Fix bug with paths (mne-tools#11639) MAINT: Report download time and size (mne-tools#11635) MRG: Allow retrieval of channel names via make_1020_channel_selections() (mne-tools#11632) Fix index name in to_data_frame()'s docstring (mne-tools#11457) MAINT: Use VTK prerelease wheels in pre jobs (mne-tools#11629) ENH: Allow gradient compensated data in maxwell_filter (mne-tools#10554) make test compatible with future pandas (mne-tools#11625) Display SVG figures correctly in Report (mne-tools#11623) API: Port ieeg gui over to mne-gui-addons and add tfr gui example (mne-tools#11616) MAINT: Add token [ci skip] (mne-tools#11622) API: One cycle of backward compat (mne-tools#11621) MAINT: Use git rather than zipball (mne-tools#11620) ENH: Speed up code a bit (mne-tools#11614) [BUG, MRG] Don't modify info in place for transform points (mne-tools#11612) ...
This should include all style and other code quality checks. Currently, I've added Black, Ruff, and Codespell. I'll start with their default configs, but will add custom settings (probably in
pyproject.toml
).To do: