Skip to content
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 ruff for lint & formatting checks; apply some suggested fixes #484

Merged
merged 3 commits into from
Feb 5, 2024

Conversation

eloquence
Copy link
Member

@eloquence eloquence commented Jan 10, 2024

Adds a GitHub action that runs format & lint checks.

Draws from freedomofpress/securedrop#6961 for the ruff config.

I've implemented several of the linter suggestions while ignoring others.

This PR also applies ruff's code formatting (which in turn is a drop-in replacement for black). ruff appears to be a bit less aggressive than black in enforcing line length, so we have to disable the line length check itself.

NB: Our undocumented use of test-requirements.txt is another potential candidate for Poetry; I've saved this for a follow-up change.

Fixes #463

Testing

  • Visual review
  • Review output of new "checks" GitHub actions
  • Install test-requirements.txt in a venv and verify that Makefile targets work as expected

Copy link
Member

@legoktm legoktm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for venturing into the brave new world of ruff format :) Left some notes but overall I'm excited

Makefile Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
@legoktm legoktm removed their assignment Jan 19, 2024
@legoktm legoktm merged commit ace977a into main Feb 5, 2024
21 checks passed
@legoktm legoktm deleted the add-ruff branch February 5, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add ruff, black to Makefile and CI
3 participants