Closed mdickinson closed 1 year ago
This is ready for review.
For reviewers: there are two commits. The first commit contains the manual changes; the second is entirely auto-generated using python etstool.py style fix
.
For the record, I don't have strong feelings on the line length change here - if the consensus is that people would prefer not to change this, I'll revert and regenerate the changes.
Can isort do sorting with lowercase after captials?
It can - there's an order_by_type
option. I tend to turn it off because I find the results are too surprising.
This will interfere with other open PRs, so I plan to merge the other PRs first (not including the changelog) PR and then redo the automated style fixes if necessary.
I did an evil force push to bring this up to date with main
, since there didn't seem to be any sane way of merging; I've cherry-picked the relevant two commits (the non-autogenerated ones) and then regenerated the automated fixes on top using python etstool.py fix
.
However, I ran into a snag: the current version of black will reformat some existing line-length-compliant docstrings in such a way that they introduce new line length violations, so I had to make manual fix-ups to those docstrings to get them into a state where (a) they passed the line length check, and (b) black won't reformat them to something that no longer passes the line length check.
Upstream PR that introduced this issue: https://github.com/psf/black/pull/3430 See particularly this comment: https://github.com/psf/black/pull/3430#issuecomment-1464371599
This PR adds
black
andisort
style formatting and checking, and requires future code changes to comply withblack
andisort
styles.check-style.yml
that runsblack
,isort
andflake8
checksflake8
check from test workflowetstool.py
support for both checking and fixing style, via newstyle
command (with subcommandsfix
andcheck
)flake8
command frometstool.py
Note: I'm installing the style-related packages from PyPI in
etstool.py
, so thatetstool.py
and the new workflow are installing the same package versions. I'm also fixing black to version 23.x so that we don't suddenly get style failures for the first Black release in 2024 (or later years) - see Black's stability policy here: https://black.readthedocs.io/en/stable/the_black_code_style/index.html#stability-policyTo do:
Closes #527