pylint not finding modules from within Github Actions workflow

Advertisements I am trying to use pylint on a small demo python backend project from within a github action. This fails with the following error: Run pylint src pylint src shell: /usr/bin/bash -e {0} env: pythonLocation: /opt/hostedtoolcache/Python/3.10.9/x64 LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.9/x64/lib ************* Module src src:1:0: F0001: No module named src (fatal) Error: Process completed with exit code… Read More pylint not finding modules from within Github Actions workflow

Pylint `–good-names` syntax on Linux

Advertisements I’ve been using PyLint in Windows with such configuration: pylint \ –good-names (‘i’,’el’,’of’,’df’,’pd’,’Entity’) \ –bad-names (‘foo’,’bar’,’kek’,’KEK’) \ module but on Ubuntu, I get an exception while trying to parse good-names arguments (‘i’,’el’, …): /bin/bash: -c: line 6: syntax error near unexpected token `(‘ What is the correct way to provide such uncommon arguments on… Read More Pylint `–good-names` syntax on Linux

Ignore a specific builtin "id" using Pylint – Python

Advertisements I would like to allow to redefine id as an attribute in a generic class. Pylint catches this error as: bam_sdk\core_element.py:7:44: W0622: Redefining built-in ‘id’ (redefined-builtin) I would like to allow "id" to be overwritten, however not other builtin’s like "int, str etc.". Is there a way to only disable this specific error for… Read More Ignore a specific builtin "id" using Pylint – Python

pylint support for Python 3.10.2

Advertisements pylint throw an AttributeError after I updated my python from 3.6.7 to 3.10.2. It worked fine in 3.6.7. Traceback (most recent call last): File "/home/yehui/Project/CleanCodeInPython/venv/bin/pylint", line 8, in <module> sys.exit(run_pylint()) File "/home/yehui/Project/CleanCodeInPython/venv/lib/python3.10/site-packages/pylint/__init__.py", line 19, in run_pylint Run(sys.argv[1:]) File "/home/yehui/Project/CleanCodeInPython/venv/lib/python3.10/site-packages/pylint/lint.py", line 1313, in __init__ linter.load_default_plugins() File "/home/yehui/Project/CleanCodeInPython/venv/lib/python3.10/site-packages/pylint/lint.py", line 504, in load_default_plugins checkers.initialize(self) File "/home/yehui/Project/CleanCodeInPython/venv/lib/python3.10/site-packages/pylint/checkers/__init__.py", line… Read More pylint support for Python 3.10.2

PyLint wants a variable to be named as a constant [C0103]

Advertisements Why does PyLint require a variable to have UPPER_CASE naming as though it is a constant? """Stack reproducible example.""" some_list = [‘foo’, ‘bar’] for i in some_list: counter = 3 while counter != 0: print("Value of ‘counter’: " + str(counter)) counter -= 1 This gives the linting error of: # C0103: Constant name "counter"… Read More PyLint wants a variable to be named as a constant [C0103]