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

Switch to ruff for code linting #8867

Closed
nijel opened this issue Mar 1, 2023 · 3 comments
Closed

Switch to ruff for code linting #8867

nijel opened this issue Mar 1, 2023 · 3 comments
Assignees
Labels
enhancement Adding or requesting a new feature. good first issue Opportunity for newcoming contributors. help wanted Extra attention is needed.
Milestone

Comments

@nijel
Copy link
Member

nijel commented Mar 1, 2023

Describe the problem

https://github.com/charliermarsh/ruff seems like a nice replacement for flake8. It is faster and it integrates most of the plugins which we use and which make each flake8 major upgrade painful because of incompatibilities.

Describe the solution you'd like

Something like python-social-auth/social-app-django#419 or python-social-auth/social-core#768

  • migrate existing isort/flake8/... configuration to ruff
  • replace isort/flake8/... with ruff in pre-commit (and remove flake8 from CI skip there)
  • change flake8 workflow to use ruff
  • this can be a POC on this repo, but all Weblate repos should migrate then, possibly via fixups in https://github.com/WeblateOrg/meta/

Describe alternatives you've considered

No response

Screenshots

No response

Additional context

No response

@nijel nijel added enhancement Adding or requesting a new feature. help wanted Extra attention is needed. good first issue Opportunity for newcoming contributors. labels Mar 1, 2023
@github-actions
Copy link

github-actions bot commented Mar 1, 2023

This issue seems to be a good fit for newbie contributors. You are welcome to contribute to Weblate! Don't hesitate to ask any questions you would have while implementing this.

You can learn about how to get started in our contributors documentation.

nijel added a commit to nijel/weblate that referenced this issue Mar 24, 2023
- Initial setup to be close to current flake8 setup we use
- Right now there are a lot of failing things

Issue WeblateOrg#8867
@nijel
Copy link
Member Author

nijel commented Mar 24, 2023

The basic configuration and some fixes are in #8987. Remaining rules need to be reviewed before we move on to other @WeblateOrg repositories and enable ruff in pre-commit.

nijel added a commit that referenced this issue Mar 24, 2023
- Initial setup to be close to current flake8 setup we use
- Right now there are a lot of failing things

Issue #8867
nijel added a commit that referenced this issue Apr 4, 2023
It will produce errors now, but this gives an opportunity to improve code in the pull requests.

Issue #8867
@nijel nijel self-assigned this Apr 4, 2023
@nijel nijel added this to the 4.17 milestone Apr 4, 2023
@nijel nijel closed this as completed in 98923b0 Apr 4, 2023
@github-actions
Copy link

github-actions bot commented Apr 4, 2023

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature. good first issue Opportunity for newcoming contributors. help wanted Extra attention is needed.
Projects
None yet
Development

No branches or pull requests

1 participant