Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pylint does not generate a report when using pylintrc #3598

Closed
nazariyv opened this issue May 6, 2020 · 4 comments
Closed

pylint does not generate a report when using pylintrc #3598

nazariyv opened this issue May 6, 2020 · 4 comments

Comments

@nazariyv
Copy link

nazariyv commented May 6, 2020

Question

When I run pylint foo without the .pylintrc in the directory in which I invoke the command, I get output like this, towards the end of the stdout:

==etf_screener.scrapers.direxion.transforms:4
==etf_screener.scrapers.ishares.transforms:6
from etf_screener.transforms import (
    Codecs as VanillaCodecs,
    Fields as VanillaFields,
    DEFAULT_DATE,
) (duplicate-code)
etf_screener/scrapers/amundi/api.py:1:0: R0801: Similar lines in 2 files
==etf_screener.scrapers.amundi.etl:27
==etf_screener.scrapers.direxion.etl:31
        except KeyError as e:
            log.error(
                red(f"changed response format. check the raw response: {response}")
            )
            raise e (duplicate-code)

------------------------------------------------------------------
Your code has been rated at 4.19/10 (previous run: 4.19/10, +0.00)

However, when I use the configurations at the end of this question, name a file like .pylintrc and put it in my project's root, and invoke pylint foo again, I no longer get an output like in the first code snippet. I am sure I am missing some config here.

redacted output with .pylintrc in the root dir:

************* Module etf_screener.scrapers.xtrackers_us.etl
etf_screener/scrapers/xtrackers_us/etl.py:42:0: C0301: Line too long (195/120) (line-too-long)
etf_screener/scrapers/xtrackers_us/etl.py:6:0: W0404: Reimport 'datetime' (imported line 4) (reimported)
etf_screener/scrapers/xtrackers_us/etl.py:4:0: C0411: standard import "from datetime import datetime as dt" should be placed before "from pandas.tseries.offsets import BDay" (wrong-import-order)
etf_screener/scrapers/xtrackers_us/etl.py:5:0: C0411: standard import "from collections import namedtuple" should be placed before "from pandas.tseries.offsets import BDay" (wrong-import-order)
etf_screener/scrapers/xtrackers_us/etl.py:6:0: C0411: standard import "from datetime import datetime" should be placed before "from pandas.tseries.offsets import BDay" (wrong-import-order)
etf_screener/scrapers/xtrackers_us/etl.py:10:0: C0411: standard import "import logging" should be placed before "from pandas.tseries.offsets import BDay" (wrong-import-order)
etf_screener/scrapers/xtrackers_us/etl.py:11:0: C0411: standard import "import re" should be placed before "from pandas.tseries.offsets import BDay" (wrong-import-order)
etf_screener/scrapers/xtrackers_us/etl.py:12:0: C0411: standard import "import os" should be placed before "from pandas.tseries.offsets import BDay" (wrong-import-order)
etf_screener/scrapers/xtrackers_us/etl.py:6:0: C0412: Imports from package datetime are not grouped (ungrouped-imports)
etf_screener/scrapers/ubs/etl.py:14:0: C0301: Line too long (161/120) (line-too-long)
etf_screener/scrapers/ubs/etl.py:2:0: C0411: standard import "from typing import Generator, ClassVar" should be placed before "from pandas.tseries.offsets import BDay" (wrong-import-order)
etf_screener/scrapers/ubs/etl.py:3:0: C0411: standard import "from datetime import datetime as dt" should be placed before "from pandas.tseries.offsets import BDay" (wrong-import-order)
etf_screener/scrapers/ishares/api.py:19:0: R0903: Too few public methods (0/2) (too-few-public-methods)

.pylintrc

[MASTER]

# automatically detects number of available processors to speed up pylint
jobs=0

# Pickle collected data for later comparisons.
persistent=yes

# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
suggestion-mode=yes

[MESSAGES CONTROL]

disable=E0401,
        C0111,
        C0330

# Set the output format. Available formats are text, parseable, colorized, json
# and msvs (visual studio). You can also give a reporter class, e.g.
# mypackage.mymodule.MyReporterClass.
output-format=text

[REPORTS]

# Python expression which should return a score less than or equal to 10. You
# have access to the variables 'error', 'warning', 'refactor', and 'convention'
# which contain the number of messages in each category, as well as 'statement'
# which is the total number of statements analyzed. This score is used by the
# global evaluation report (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)

# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details.
#msg-template=

# Set the output format. Available formats are text, parseable, colorized, json
# and msvs (visual studio). You can also give a reporter class, e.g.
# mypackage.mymodule.MyReporterClass.
output-format=colorized

# Tells whether to display a full report or only the messages.
reports=yes

# Activate the evaluation score.
score=yes

[LOGGING]

# The type of string formatting that logging methods do. `old` means using %
# formatting, `new` is for `{}` formatting.
logging-format-style=new

# Logging modules to check that the string format arguments are in logging
# function parameter format.
logging-modules=logging

[FORMAT]

# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
expected-line-ending-format=LF

# Maximum number of characters on a single line.
max-line-length=120

[BASIC]
# Good variable names which should always be accepted, separated by a comma.
good-names=i,
           j,
           k,
           n,
           df,
           db,
           v,
           e,
           f,
           T,
           r

@nazariyv
Copy link
Author

nazariyv commented May 6, 2020

perhaps worth mentioning that i am on macOS Catalina 10.15.4, python 3.8.2 venv and pylint --version gives

pylint 2.5.2
astroid 2.4.1
Python 3.8.2 (default, Mar 11 2020, 00:29:50)
[Clang 11.0.0 (clang-1100.0.33.17)]

@antonlindahlcevt
Copy link

Got similar issue but i do not even get the score. It seems that jobs=0 is the issue, setting it to 1 makes it work. So is there an issue with the auto detect on jobs?

@huwcbjones
Copy link
Contributor

You've encounted #3547
Specifiying a number of jobs (0 in your case) causes the score to not be output

@PCManticore
Copy link
Contributor

Hey folks. Yes, this issue has been caused by jobs=0, which has been fixed (but not yet released) in 2.5.3. Will be shortly available though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants