Spì
Spì

Reputation: 2275

Pylint only Global evaluation

In pylint I use this command --reports=n to disable the reports, but now I don't see the Global evaluation more.

Is possible enable only the Global evaluation?

Upvotes: 8

Views: 2923

Answers (6)

Michael Darnell
Michael Darnell

Reputation: 1

You could use AWK:

pylint generators.py | awk '$0 ~ /Your code/ || $0 ~ /Global/ {print}'

I got this printout:

No config file found, using default configuration

Global evaluation
Your code has been rated at 8.12/10 (previous run: 8.12/10, +0.00)

Upvotes: 0

Randy31
Randy31

Reputation: 111

This post is quite old but here's the current solution:

To disable EVERYTHING other than the Global evaluation section, you must

--disable=RP0001
--disable=RP0002
--disable=RP0003
--disable=RP0101
--disable=RP0401
--disable=RP0701
--disable=RP0801    

The link shared in another answer now seems to be up to date. http://pylint-messages.wikidot.com/all-codes

Note: this still leaves the portion shown below:

Report
======
XXX statements analyzed.

My solution is to capture the standard out and standard error and eliminate the Report section while capturing the score from the Global evaluation and printing the score elsewhere on my own.

I am writing a wrapper around Pylint and pep8 and some internal Python quality checks (company headers, etc.) where this problem came up.

Upvotes: 4

dsg101
dsg101

Reputation: 333

I can nearly just get the Global evaluation. To eliminate everything but Duplication and Global evaluation add;

--disable=RP0401 --disable=RP0001 --disable=RP0002 --disable=RP0003 --disable=RP0101 --disable=RP0101 --disable=RP0701

Being unable to disable the duplication report seems to be a bug; http://www.logilab.org/ticket/63424

Upvotes: 0

torfbolt
torfbolt

Reputation: 1141

You can use e.g. --disable=RP0701 to disable the Raw metrics part of the report.

This (outdated) list can help to find the IDs of blocks you would like to suppress:

http://pylint-messages.wikidot.com/all-codes

Note that the report IDs have been renamed from Rxxxx to RPxxxx!

Upvotes: 3

gurney alex
gurney alex

Reputation: 13645

As systempunttoout said, this is currently not possible. But you can ask for this on the [email protected] mailing list, and submitting a patch is a very good way of getting that feature soon. :-)

Upvotes: 0

systempuntoout
systempuntoout

Reputation: 74094

No you can't, Global Evaluation is part of the reports and with --reports=n you disable all the reports .

Upvotes: 4

Related Questions