Closed
Description
Question
I do exactly same thing but cant get same result in Pure command and tox command.
I guess MESSAGES CONTROL
is not loading to setting.
How do I check rcfile setting is loading correctly?
command
pylint --verbose --rcfile=tox.ini src
Using config file C:\Users\pega_user\Desktop\vs_project\work3\serverapi\tox.ini
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
tox -r -e linting
...
src\server_api\__init__.py:40:4: C0415: Import outside toplevel (requests) (import-outside-toplevel)
src\server_api\__init__.py:40:4: E0401: Unable to import 'requests' (import-error)
src\server_api\__init__.py:44:11: W0703: Catching too general exception Exception (broad-except)
src\server_api\__init__.py:49:17: W1202: Use lazy % formatting in logging functions (logging-format-interpolation)
...
tox.ini
[testenv:linting]
description = linting test
# cant skip install
skip_install = True
deps = pylint
commands =
# cmd /c dir
pylint --rcfile=tox.ini src
[MESSAGES CONTROL]
disable=C,R,W
# no use now dont know why
[pylint]
# pylint --disable=all --enable=F,E,W
#* (C) convention, for programming standard violation
#* (R) refactor, for bad code smell
#* (W) warning, for python specific problems
#* (E) error, for probable bugs in the code
#* (F) fatal, if an error occurred which prevented pylint from doing further processing.
# never-returning-functions=sys.exit
max-line-length=150
#max-module-lines=5000
#max-nested-blocks=10
#min-public-methods=1
#max-public-methods=20
#max-statements=200
#max-branches=50
#max-locals=75
#max-args=10
#notes=
# FIXME,
# XXX,
# TODO
#ignore-paths=^src/server_api/__main__.py$,
disable=
#__main__.py,
attribute-defined-outside-init,
invalid-name,
missing-docstring,
protected-access,
too-few-public-methods,
# handled by black
format,
# We anticipate #3512 where it will become optional
fixme,
cyclic-import,
Documentation for future user
How to check setting or Why I cant get same result between command and tox.
Additional context
No response
Activity
fly50789 commentedon Nov 29, 2022
It is not tox problem.
I run command directly in gitlab runner but I cant load setting correctly
mbyrnepr2 commentedon Nov 29, 2022
Hi @fly50789. It seems that you need to use
[pylint.main]
instead of[MESSAGES CONTROL]
inside anini
file for this to work. Source code.From that code block:
The use of 'MASTER' or 'master' as configuration section for pylint
has been deprecated, as it's bad practice to not start sections titles with the
tool name. Please use 'pylint.main' instead.,
I've tried a quick test with your
tox
command & it works for me.mbyrnepr2 commentedon Nov 29, 2022
There is a section in the documentation describing the various ways of passing a configuration file; so perhaps the fix here is to add a line beneath the
pyproject.toml
section fortox.ini
.Would you like to contribute a MR @fly50789?
fly50789 commentedon Nov 30, 2022
@mbyrnepr2 Sorry English is not my mother tongue, What is MR meaning?
fly50789 commentedon Nov 30, 2022
It run perfectly!! Thank for your help.
I know setting file can be set in different file.
But tox is a useful tool to mange different test ,so I prefer to make all tool config in single file which is
tox.ini
.fly50789 commentedon Nov 30, 2022
Ps. is any way to overwrite setting of rcfile by command like
pylint --rcfile=tox.ini <extra-command-to-overwrite> <path>
mbyrnepr2 commentedon Nov 30, 2022
Sorry, I should have been clearer. I wanted to check if you are interested in creating a Merge Request to fix the documentation? Otherwise someone else can pick it up.
mbyrnepr2 commentedon Nov 30, 2022
Sure, something like this:
pylint --rcfile=tox.ini --enable=missing-class-docstring,missing-module-docstring <path>
fly50789 commentedon Nov 30, 2022
@mbyrnepr2
I have interest to do this.
But I never maintain the procedure of merge request in github.
I only use gitlab to develope my tool.
You might need to tell me more how to do.
Which part I need to write and merge to document?
Folk the project and fix document then assign to you..etc.
First I need to know how to trace the issue.
Even you refer me, I cant receive notification like below.
26 remaining items