Closed tramdas closed 11 months ago
FWIW it seem pylint can pick up the issue in #13
discord_integration/discord_bot.py:72:19: E0602: Undefined variable 'ocr' (undefined-variable)
But there are a number of false positives as well:
discord_integration/discord_bot.py:2:0: E0401: Unable to import 'discord' (import-error)
discord_integration/discord_bot.py:3:0: E0401: Unable to import 'discord.ext' (import-error)
discord_integration/discord_bot.py:11:0: E0401: Unable to import 'router' (import-error)
Hi @tramdas,
Changes were made and sent a PR.
Please note that as discussed earlier github hook
related changes are not added.
pylint
output before fixing issues in the ocr.py
script:pylint
output after fixing issues in the ocr.py
script:ocr.py
functionality after the cleanuppylintcr
config:Currently the docstring check is disabled because sometimes it may not require to have a doc string for all the functions depending on current status.
But this is to show that the pylintrc
configuration is working as expected and can be modified as per our code standards.
pylintrc
pylint
outputpylintrc
pylint
outputJust for the recording purpose only:
Investigated Options:
1) We can run pylint locally, but its up to the developer whether to run it not. But we can force it via pre-commit, but then commit must happen within poetry environment. So again it is up to the developer and we cannot force.
2) Github workflows. This is a CI. So we can do the same via github workflow and most of the repo nowadays using this option.. similar to CICD pipelines. We can build the code on certain branches on push or merge and run pylynt, flake8, pytest, etc. Not sure whether this is entirely free.
Covered Option: 1) pylint only
@suranga-aipa pls link the PR to this ticket, thanks
@tramdas it is already linked.
lol github having a bad day
@tramdas Yes, I saw it too now. If you open the ticket and refresh the page, it will be gone. But if you come back again from the Kanban board, it is there.
The bug in https://github.com/A-I-P-A/CSRAssist/issues/13 was a trivial one that should have been avoided - could linting have picked it up? If so, can we create a precommit hook to run pylint before push?
The goal of this task is to research whether we can do that to have some basic automated QA before code is pushed.