rengine
rengine copied to clipboard
feat: Ruff linter
Is there an existing feature or issue for this?
- [X] I have searched the existing issues
Expected feature
Currently the styling of the python codebase is inconsistent. Some examples:
- Mixing up naming conventions (some functions use snake case / camel case etc.)
- Some files follow the PEP8 spacing between functions / classes / constants etc. and some don't.
Proposed solution: Writing a GitHub action for Ruff linter. Of course this would take quite a while to refactor the whole codebase, but I can see the project benefitting from it.
Alternative solutions
No response
Anything else?
No response
👋 Hi @jxdv, Issues is only for reporting a bug/feature request. Please read documentation before raising an issue https://rengine.wiki For very limited support, questions, and discussions, please join reNgine Discord channel: https://discord.gg/azv6fzhNCE Please include all the requested and relevant information when opening a bug report. Improper reports will be closed without any response.
Totally agree with that Some file have spaces indent, some tabs ... We need some refactoring jobs
Totally agree with that Some file have spaces indent, some tabs ... We need some refactoring jobs
Do you have experience with that? I don't, but I could look into it when I have more time.
Yes, I coud work on it.
For example, in the same folder web/reNgine
tasks.py have tabs
common_serializers.py have spaces
I can create a PR for this if you're interested, but the refactoring obviously would have to be a team effort. It's gonna take quite some time.
If you can, yes please. Don't forget to use the closing keywords for this issue. But wait, doesn't this GitHub Action refactor the entire codebase by itself? In other words: it doesn't need to be done manually, right? From what I'm understanding of the repo, that is.
Yes, Ruff can fix some stuff by itself using --fix
, but there are also unsafe fixes which I prefer the devs look at as these could cause some troubles and break some backend stuff.
@AnonymousWP I am wondering how would you like to see the linked PRs to this..1 PR just for the implementation of Ruff itself, and the second one for the big python cleanup?
@AnonymousWP I am wondering how would you like to see the linked PRs to this..1 PR just for the implementation of Ruff itself, and the second one for the big python cleanup?
Yep, correct. Maybe a separate issue to refactor the code and then link the PR of the big Python cleanup to it.