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

feat: Ruff linter #1134

Closed
1 task done
jxdv opened this issue Dec 12, 2023 · 9 comments
Closed
1 task done

feat: Ruff linter #1134

jxdv opened this issue Dec 12, 2023 · 9 comments

Comments

@jxdv
Copy link
Contributor

jxdv commented Dec 12, 2023

Is there an existing feature or issue for this?

  • 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

Copy link

👋 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.

@psyray
Copy link
Collaborator

psyray commented Dec 16, 2023

Totally agree with that
Some file have spaces indent, some tabs ...
We need some refactoring jobs

@AnonymousWP
Copy link
Collaborator

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.

@psyray
Copy link
Collaborator

psyray commented Dec 16, 2023

Yes, I coud work on it.

For example, in the same folder web/reNgine

tasks.py have tabs
image

common_serializers.py have spaces
image

@jxdv
Copy link
Contributor Author

jxdv commented Dec 16, 2023

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.

@AnonymousWP
Copy link
Collaborator

AnonymousWP commented Dec 16, 2023

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.

@jxdv
Copy link
Contributor Author

jxdv commented Dec 16, 2023

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.

@jxdv
Copy link
Contributor Author

jxdv commented Dec 17, 2023

@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
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants