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

Upgrade ruff, remove black #7233

Merged
merged 3 commits into from
Oct 7, 2024
Merged

Upgrade ruff, remove black #7233

merged 3 commits into from
Oct 7, 2024

Conversation

legoktm
Copy link
Member

@legoktm legoktm commented Sep 19, 2024

Status

Ready for review

Description of Changes

This is split into three commits for ease of review:

Upgrade ruff, remove black

Upgrade ruff to the latest version so we can use it for formatting and
native editor integration. While we're at it, introduce the standard
make fix target
(freedomofpress/securedrop-tooling#11).

Actually fixing new issues will happen in follow-ups to make this change
easier to review.

Fixes #7226.

Apply ruff format .

This is all automated except test_manage.py was manually fixed to remove
extraneous commas that ruff tried to turn into tuples.

Fix most errors spotted by ruff

About half of these fixes were automatic, the rest I did by hand.

I skipped removing % formatting from pretty_bad_protocol since there
were like a hundred of them and it wasn't really worth it.

Testing

How should the reviewer test this PR?

  • CI passes
  • visual review

Deployment

Any special considerations for deployment? n/a

Checklist

  • Linting (make lint) and tests (make test) pass in the development container
  • Linting and tests (make -C admin test) pass in the admin development container

@legoktm legoktm requested a review from a team as a code owner September 19, 2024 22:05
@legoktm
Copy link
Member Author

legoktm commented Sep 19, 2024

CI seems busted right now, so I'll retrigger the jobs tomorrow.

Upgrade ruff to the latest version so we can use it for formatting and
native editor integration. While we're at it, introduce the standard
`make fix` target
(<freedomofpress/securedrop-tooling#11>).

We can remove `--show-source` too now that it's the default.

Actually fixing new issues will happen in follow-ups to make this change
easier to review.

Fixes #7226.
This is all automated except test_manage.py was manually fixed to remove
extraneous commas that ruff tried to turn into tuples.
About half of these fixes were automatic, the rest I did by hand.

I skipped removing % formatting from pretty_bad_protocol since there
were like a hundred of them and it wasn't really worth it.
Copy link
Member

@cfm cfm left a comment

Choose a reason for hiding this comment

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

Thanks, @legoktm.

@cfm cfm added this pull request to the merge queue Oct 7, 2024
Merged via the queue into develop with commit 964599b Oct 7, 2024
30 checks passed
@cfm cfm mentioned this pull request Oct 7, 2024
6 tasks
@legoktm legoktm deleted the ruff-0.6 branch October 7, 2024 19:14
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.

Upgrade to ruff >=0.3.5
2 participants