-
Notifications
You must be signed in to change notification settings - Fork 6
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
Lint with ruff #113
Lint with ruff #113
Conversation
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Python |
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.
In a lot of other workflows, we cache the python environment to speed up action times https://github.com/marketplace/actions/cache. Would that be appropriate to incorporate here?
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.
IMO it's probably not worth it for this case - this should really only install 2 pkgs (updated pip + ruff), neither of which is particularly large thus is unlikely to be a bottleneck.
python -m pip install ruff | ||
python -m pip list | ||
- name: Run ruff | ||
run: ruff --format=github . |
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.
Just to clarify, this just generates a report and does not actually change any files. The action will fail if the linting standards are not met?
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.
Correct. ruff
does have the option to automatically "fix" some subset of errors, though in my experimentation with it some of the autofixes were not correct or otherwise overly aggressive. There are ways to control this in the ruff
configs (see e.g. unfixable
), but IMO it'd be easiest to start off without it. We can always revisit this once we gain more experience with the linter in place.
One additional question, can you tell if |
Nice catch, I missed that file. We could remove it as I'd vote to leave it there for now as it sets up additional linting beyond what |
Add the ruff linter to the development workflow.
Includes basic configuration as well as some minor tweaks/improvements to pass the linter. The configuration is minimal and reflects the original
pytest-pep8
configuration.