Reputation: 4715
I'm running pylint for several directories using a simple bash script:
#!/usr/bin/env bash
set -e
for PACKAGE in some_dir another_dir third_dir
do
pylint --disable=R,C $PACKAGE
done
I want output to be clean if everything is fine. However, there are annoying lines:
Using config file /home/user/projects/some-project/.pylintrc
Is there an option in pylintrc
or in pylint
command line to disable "Using config file"?
Update: there is an open issue https://github.com/PyCQA/pylint/issues/1853
Upvotes: 4
Views: 1623
Reputation: 9428
@Jan Jurec answer is outdated, in a posterior commit, they renamed the quiet command flag to --verbose
. Now on, pylint
is "quiet" by default.
However, it still not quiet enough, as by default it prints the scores like this:
D:\tests>pylint --disable=I,E,R,W,C,F --enable=E0102 --reports=no test.py
---------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: -2.50/10, +12.50)
D:\tests>
But you disable those with -sn
, then the older example would became this when no problems are found:
D:\tests>pylint --disable=I,E,R,W,C,F --enable=E0102 --reports=no -sn test.py
D:\tests>
And if some problem is found, the output would be like this:
D:\tests>pylint --disable=I,E,R,W,C,F --enable=E0102 --reports=no -sn test.py
************* Module test
test.py:6:0: E0102: class already defined line 3 (function-redefined)
D:\tests>
Instead of this default:
D:\tests>pylint --disable=I,E,R,W,C,F --enable=E0102 --reports=no test.py
************* Module test
test.py:6:0: E0102: class already defined line 3 (function-redefined)
---------------------------------------------------------------------
Your code has been rated at -2.50/10 (previous run: 10.00/10, -12.50)
D:\tests>
Upvotes: 2
Reputation: 49
If it is still relevant to anyone, this PR to pylint solves the issue. From pylint 2.0
you can just pass --quiet
flag to pylint
.
Edit: If you use older pylint, you may redirect and exclude with grep
:
pylint 2>&1 | grep -v "Using config file"
Upvotes: 2