pylava / pylava_pylint

Pylint support for Pylava (a community maintained fork of Pylama_pylint)
MIT License
4 stars 2 forks source link

pylava_pylint is missing messages in contrast to pylint #4

Open diefans opened 6 years ago

diefans commented 6 years ago

just trying pylava + pylava_pylint`and find, that pylava_pylint is missing some messages.

# foo.py
class Foo:
    def bar(self):
        self.foo()

checking above module with pylint:

# pylint foo.py
************* Module foo
foo.py:1:0: C0102: Black listed name "foo" (blacklisted-name)
foo.py:1:0: C0111: Missing module docstring (missing-docstring)
foo.py:1:0: C0111: Missing class docstring (missing-docstring)
foo.py:2:4: C0102: Black listed name "bar" (blacklisted-name)
foo.py:2:4: C0111: Missing method docstring (missing-docstring)
foo.py:3:8: E1101: Instance of 'Foo' has no 'foo' member (no-member)
foo.py:1:0: R0903: Too few public methods (1/2) (too-few-public-methods)
----------------------------------------------------------------------
Your code has been rated at -26.67/10 (previous run: -6.67/10, -20.00)

checking with pylava:

# pylava -l pylint foo.py
foo.py:1:0: C0102 Black listed name "foo" [pylint]
foo.py:1:0: C0111 Missing module docstring [pylint]
foo.py:2:4: C0102 Black listed name "bar" [pylint]
foo.py:2:4: C0111 Missing method docstring [pylint]

my env:

# python --version
Python 3.6.6

# pip freeze
astroid==2.0.4
isort==4.3.4
lazy-object-proxy==1.3.1
mccabe==0.6.1
pycodestyle==2.4.0
pydocstyle==2.1.1
pyflakes==2.0.0
pylava==0.2.1
pylava-pylint==0.0.2
pylint==2.1.1
six==1.11.0
snowballstemmer==1.2.1
typed-ast==1.1.0
wrapt==1.10.11
diefans commented 6 years ago

I guess https://github.com/pyfocus/pylava_pylint/blob/master/pylava_pylint/pylint.rc#L20 is causing this issue. IMHO there should be no such default...

susam commented 6 years ago

@diefans Thank you for reporting this issue and creating a pull request with a fix.

I believe the existing pylint.rc was trying to offer sensible defaults by ignoring warnings about trivial issues. However what is sensible and what is not is very subjective. For example, in my opinion, ignoring

R0903: Too few public methods (1/2) (too-few-public-methods)

was a good sensible default. However ignoring

E1101: Instance of 'Foo' has no 'foo' member (no-member)

does not seem good in my opinion because ignoring it hides a genuine issue in the code.

We should take a decision here about whether Pylava and Pylava_pylint should try to offer sensible defaults or if it should just report all warnings from the linters faithfully without masking anything.

I am of the same opinion as you, i.e., there should no such defaults introduced by Pylava_pylint.

If everyone is okay with Pylava_pylint not introducing its own defaults or if nobody registers an opposing view, I will merge this pull request by end of next week, or another maintainer may merge this pull request immediately.