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
Replace Black with Ruff, add LSP plugin for Ruff #902
Conversation
There's also a python-language-server Ruff plugin: We should be using that instead probably! |
62db149
to
24a9c2e
Compare
ruff.toml
Outdated
"E402", # Module level import not at top of file -> gi imports may come after gi.require_version. | ||
"E501", # Line too long. This is probably better enforced manually where it makes sense. | ||
] | ||
select = [ "W", "E", "F", "ARG"] |
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.
please move this file to langs/python
or copy
let's use 2 separate files, one for Workbench internal and one for Workbench source
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.
What do you mean by two files?
I will move it to langs/python for now, but this makes running it locally a bit more complicated, though it's not a big issue since I can just configure it in the Makefile.
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.
we should use 2 separate configs anywya
1 for python source files in Workbench
1 for the LSP / formatter in Workbench
We'll want different rules
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.
Can we keep it one file for now? We can split it up later if needed anyway.
Workbench only has a handful of Python files internally, I doubt we couldn't use the same rule. I want to keep the rules as simple as possible in any case.
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.
sure
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.
Co-authored-by: Sonny Piers <sonny@fastmail.net>
I decided to go ahead with trying to implement Ruff. Ruff implements a linter and a formatter. I added https://github.com/python-lsp/python-lsp-ruff for Ruff support for the existing LSP.
This removes Black and replaces it with Ruff. Ruff also runs linting.
Closes #804.