Closed niksirbi closed 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.63%. Comparing base (
5123a41
) to head (f3b433c
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Tagging @neuroinformatics-unit/behaviour and @b-peri, because these changes will affect workflows for all.
Thanks again @niksirbi ! Happy to merge once the following two things are addressed:
mixed-line-ending
check fails with 52 files when running pre-commit run --all-files
locally on Windows. Could you try this on a Mac? Assuming these changes aren't too specific to movement
, could they be added to the cookiecutter, and gradually rolled out to other packages? I'm very keen that our tools don't start to diverge in terms of tooling.
Assuming these changes aren't too specific to
movement
, could they be added to the cookiecutter, and gradually rolled out to other packages? I'm very keen that our tools don't start to diverge in terms of tooling.
Yes, the plan was to roll them out in movement
first, for testing, and after a few weeks (assuming all is well) roll them out to the cookiecutter + other packages.
- The
mixed-line-ending
check fails with 52 files when runningpre-commit run --all-files
locally on Windows. Could you try this on a Mac?
@lochhh I can't reproduce this on Mac. Running pre-commit run --all-files
on my M2 Mac finds no issues. Could you check whether your IDE is configured to automatically use CRLF for line endings (i.e. \r\n
, that's the Windows way)? On Unix systems it's LF (\n
) and that's what the pre-commit hook enforces (and in theory, auto-fixes).
- The
mixed-line-ending
check fails with 52 files when runningpre-commit run --all-files
locally on Windows. Could you try this on a Mac?@lochhh I can't reproduce this on Mac. Running
pre-commit run --all-files
on my M2 Mac finds no issues. Could you check whether your IDE is configured to automatically use CRLF for line endings (i.e.\r\n
, that's the Windows way)? On Unix systems it's LF (\n
) and that's what the pre-commit hook enforces (and in theory, auto-fixes).
Thanks for looking into this. Can confirm it is indeed my IDE that's automatically converting the line endings.
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
Thanks for verifying @lochhh. I'll merge this now.
Description
What is this PR
Why is this PR needed?
We use
ruff
for linting andblack
for auto-formatting. With the introduction ofruff.format
(a drop-in replacement forblack
, but faster) there is no longer need to be usingblack
. This prompted me to overhaul our entire lint/format setup.What does this PR do?
I went through the scientific python development guide for style and static checks and applied the recommendations that make sense for
movement
.In summary these are:
black
toruff.format
Of those, we were already using
E
,F
, andI
. With the addition ofUP
,B
,SIM
, andC90
I discovered and fixed a few minor problems that the other checks had missed. That said, there were only a few extra issues, which means we are already great Python coders 😉 .check-added-large-files
andcheck-yaml
.What does this PR NOT do? I also considered adding the "D"
ruff
rule (pydocstyle) to enforce consistent formatting for our docstrings (according to PEP8 recommendations). I think this is super useful, but currently requires some manual work to update lots of our non-compliant docstrings (135 non auto-fixable violations!). I will open an issue to do this later.References
If we end up being happy with the new setup, we may consider porting it over to the python-cookiecutter.
Does this PR require an update to the documentation?
The contributed guidelines have been updated accordingly.
Checklist: