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

Add Pylint as a python static code analyzer #298

Merged
merged 26 commits into from
Oct 31, 2022
Merged

Add Pylint as a python static code analyzer #298

merged 26 commits into from
Oct 31, 2022

Conversation

arm4b
Copy link
Member

@arm4b arm4b commented Sep 8, 2022

This PR adds Pylint https://pylint.pycqa.org/en/latest/ as a static code analyser for the Python codebase, for quick spotting the common mistakes, errors and enhancing the python coding standards in a minimal automated way.

With #297, closes #271

Quick run:

pip3 install tox
tox -e pylint

Silence for now, refactor this function in the future.
Fix pylint R0914: Too many local variables (23/15) (too-many-locals)
See: #327
Silence for now, refactor this function in the future.
> R0914: Too many local variables (36/15) (too-many-locals)
> R0912: Too many branches (19/12) (too-many-branches)
> R0915: Too many statements (104/50) (too-many-statements)

See: #328
Silence for now, refactor this function in the future.
> R0914: Too many local variables (22/15) (too-many-locals)
> R0915: Too many statements (59/50) (too-many-statements)

See: #329
@arm4b arm4b marked this pull request as ready for review October 20, 2022 17:41
@arm4b arm4b added the refactor label Oct 20, 2022
@arm4b
Copy link
Member Author

arm4b commented Oct 20, 2022

The overall cosmetic pylint refactoring is done and pylint check is now succeeding and is part of the CI.

However, some parts of the codebase will need more structural rework like extracting some huge functions into classes.
We temporary silence them for now to make pylint pass and make dedicated Issues to address them in the future:

^^ these would be also good first issues/PRs easier to tackle in between the tasks.

scripts/plugins/doc.py Outdated Show resolved Hide resolved
scripts/plugins/settings.py Show resolved Hide resolved
scripts/plugins/settings.py Show resolved Hide resolved
scripts/plugins/utilities.py Show resolved Hide resolved
@arm4b arm4b merged commit 1180052 into main Oct 31, 2022
@arm4b arm4b deleted the feature/pylint branch October 31, 2022 18:47
@arm4b arm4b mentioned this pull request Oct 31, 2022
2 tasks
PhillypHenning pushed a commit that referenced this pull request Nov 4, 2022
…directly (#345)

* add masking functions to be called in logger and directly

* black formating

* move logging masks to settings

* fix linting error

* black formating

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

Successfully merging this pull request may close these issues.

Code Linting (Python)
2 participants