pylint_runner icon indicating copy to clipboard operation
pylint_runner copied to clipboard

No module named path_to_file=.pylintrc

Open denists1984 opened this issue 5 years ago • 2 comments

HI All

After upgrading to new v0.6.0 im getting error but code rate is 10.00/10: `##### ************* Module –rcfile rcfile:1:0: F0001: No module named –rcfile (fatal) ************* Module path_to_file=.pylintrc path_to_file=.pylintrc:1:0: F0001: No module named path_to_file=.pylintrc (fatal)

############################ Your code has been rated at 10.00/10`

It wasn't happened in v0.5.4: `./tests/run_code_quality_test.sh Installing collected packages: scripts Found existing installation: scripts 0.0.0 Uninstalling scripts-0.0.0: Successfully uninstalled scripts-0.0.0 Running setup.py develop for scripts Successfully installed scripts pylint 2.4.3 astroid 2.3.3 Python 3.7.4 (default, Aug 21 2019, 00:19:59) [GCC 8.3.0] pylint_runner (0.5.4) for Python 3.7.4 Using pylint 2.4.3 for python 3.7.4 pylint running on the following files:

my_script.py ############################# Your code has been rated at 10.00/10 `

v0.6.0: `./tests/run_code_quality_test.sh Installing collected packages: scripts Found existing installation: scripts 0.0.0 Uninstalling scripts-0.0.0: Successfully uninstalled scripts-0.0.0 Running setup.py develop for scripts Successfully installed scripts. pylint 2.4.3 astroid 2.3.3 Python 3.7.4 (default, Aug 21 2019, 00:19:59) [GCC 8.3.0] pylint_runner (0.6.0) for Python 3.7.4 Using pylint 2.4.3 for python 3.7.4 pylint running on the following files: my_script.py ###################### ************* Module –rcfile rcfile:1:0: F0001: No module named –rcfile (fatal) ************* Module path_to_file=.pylintrc path_to_file=.pylintrc:1:0: F0001: No module named path_to_file=.pylintrc (fatal)

############################ Your code has been rated at 10.00/10`

Command executed: docker run -i --rm --name code_quality_python \ -v "$PWD":"$PWD" \ -w "$PWD" \ my_python3_container:latest \ -c "pip3 install -e .; pylint --version; pylint_runner --version; pylint_runner –rcfile path_to_file=.pylintrc -v "

.pylintrc file wan't changed since using v0.5.4

Please advice Thanks in advance

denists1984 avatar Jun 11 '20 15:06 denists1984

This is happening as 0.6.0 now passes unused arguments down to pylint. You've got a typo in the use of the --rcfile option where:

  1. You're missing a hyphen to the option (-rcfile vs --rcfile)
  2. The argument to that you be just .pylintrc, not path_to_file=.pylintrc (path_to_file is a placeholder in the docs).

So, correcting your command with above:

docker run -i --rm --name code_quality_python \
-v "$PWD":"$PWD" \
-w "$PWD" \
my_python3_container:latest \
-c "pip3 install -e .; pylint --version; pylint_runner --version; pylint_runner --rcfile .pylintrc -v "

Additionally, if just using .pylintrc in the current working directory, you can omit the --rcfile directive and it will use it by default.

and so should be the same as:

docker run -i --rm --name code_quality_python \
-v "$PWD":"$PWD" \
-w "$PWD" \
my_python3_container:latest \
-c "pip3 install -e .; pylint --version; pylint_runner --version; pylint_runner -v "

MasterOdin avatar Jun 11 '20 15:06 MasterOdin

Thank you. Just removed the --rcfile .pylintrc from the command. Works fine now

denists1984 avatar Jun 11 '20 15:06 denists1984