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

Adopt pylint and lint the existing modules #25

Open
1 task
safa-topal opened this issue May 3, 2022 · 5 comments · May be fixed by #58
Open
1 task

Adopt pylint and lint the existing modules #25

safa-topal opened this issue May 3, 2022 · 5 comments · May be fixed by #58

Comments

@safa-topal
Copy link
Contributor

What is currently missing?

A set of standards around code style would help code readability and consistency among different modules of the project. Pylint seems like the way to go option.

Is this a feature you would work on yourself?

  • I plan to open a pull request for this feature
@laysauchoa
Copy link
Contributor

do you plan to work on that @safa-topal? also, do you recommend adding that to the workflow check like github actions, for example?

@inifares23lab
Copy link
Contributor

inifares23lab commented Oct 8, 2023

is anybody working on this?
can I try to tackle it?

  1. is pylint the chosen option?
  • with default options?
  1. do we want to add a linting workflow?
  • would it be best to fail the workflow and tell the developer to lint, fix, commit and push again
  • or can we automate this(would be nice but there may be some security issues with granting content write access); i.e.:
    a. set linting as first and required by other workflows
    b. lint
    • if there are no required changes: continue with other workflows
    • if changes are required: fix, commit, push and stop following workflows

@inifares23lab inifares23lab mentioned this issue Oct 8, 2023
1 task
@inifares23lab
Copy link
Contributor

Actually I changed idea.
Too much added complexity for not enough value for the automated option.
Still keen to hear other opinions though

@ftisiot
Copy link
Collaborator

ftisiot commented Oct 9, 2023

I'll probably leave @TibsAtWork to comment!

@TibsAtWork
Copy link
Contributor

TibsAtWork commented Oct 9, 2023

I'm a bit out-of-date with the current best practices, so a useful task, in itself, would be to do the research and report back on what is considered the best thing to do at the moment.

Historically, I believe people have either used pylint (which tends to require configuration) or other more simpler opinionated (less configurable) tools like flake8 (there certainly used to be more than one choice for this sort of tool, but flake8 was one I used). These can be run as another part of the GitHub workflow - see the https://github.com/Aiven-Open/metadata-parser/tree/main/.github/workflows directory for existing workflows.

There's also the possibility of running black at some stage, to reformat the code in a consistent way - I've seen this done using a pre-commit hook (see https://black.readthedocs.io/en/stable/integrations/source_version_control.html). One might then run black in the CI toolchain to check that there are no changes - this makes sure contributors are remembering to run it!. It would obviously be up to @ftisiot whether he's happy to have black run on the codebase

Since we don't have particular ideas on what should be done, any contribution is likely to make things better!

@inifares23lab inifares23lab linked a pull request Nov 28, 2023 that will close this issue
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 a pull request may close this issue.

5 participants