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 Formatter to parlparse #184

Merged
merged 8 commits into from
Oct 7, 2024
Merged

Add Ruff Formatter to parlparse #184

merged 8 commits into from
Oct 7, 2024

Conversation

ajparsons
Copy link
Contributor

Before we start having lots of PRs on actual content, I want to get a consistent formatter in.

This PR changes requirements.txt for poetry. As far as I'm aware the requirements.txt is only for dev reference - but having poetry would in principle mean it could diverge from the twfy requirement in future (the update script running in its own virtual environment).

Ruff is used to handle black, flake and isort (config matches the config used in LIH and in TWFY PR).

There's a specific problem here that this is an an old repo and we want to be able to check new scripts for good practice, while not fixing 60 errors on scripts that aren't used anymore.

To deal with this, script/lint has a bunch of extra rules ignored to handle the outstanding issues - while the ruff vscode extention and ruff check . --fix will detect the wider range of rule breaking.

I have additionally fixed a handful of scripts where the errors were real enough to not want to turn off that rule. This was all in error handling that would break if an error was found rather than the core stuff.

With this merged, I'd revisit the london-assembly PR to fit into this.

Remaining actually bad errors, mostly
missing a package or variable in an error
that rarely happens?
@ajparsons
Copy link
Contributor Author

This doesn't cause any issues with the current https://github.com/mysociety/parlparse/pull/176/files PR

Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

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

Thanks

@ajparsons ajparsons merged commit 80c4fc2 into master Oct 7, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants