pylint-pycharm icon indicating copy to clipboard operation
pylint-pycharm copied to clipboard

Pylint found no problems

Open tispratik opened this issue 5 years ago • 10 comments

Step 1: Are you in the right place?

  • [x] I have verified there are no duplicate active or recent bugs, questions, or requests
  • [x] I have verified that I am using the latest version of the plugin.

Step 2: Describe your environment

  • Plugin version: 0.12.2
  • PyCharm/IDEA version: 2019.1 CE
  • Pylint version: 2.5.2

Step 3: Describe the problem:

When i run pylint from terminal, it reports errors. But from Intellij, it does not.

Steps to reproduce:

  1. Open a python file
  2. Run the pylint plugin
  3. "Pylint found no problems" is reported

Observed Results:

  • Intellij logfile shows no errors

Expected Results:

  • Errors should have been reported
  • I also have MyPy plugin installed. It is correctly reporting errors.
  • I am using virtual environment using venv
  • Restarting Intellij did not help

Relevant Code:

Screen Shot 2020-05-27 at 7 31 26 PM Screen Shot 2020-05-27 at 7 32 01 PM Screen Shot 2020-05-27 at 7 34 57 PM Screen Shot 2020-05-27 at 7 41 51 PM

tispratik avatar May 28 '20 02:05 tispratik

The issue is related to loading of pylintrc. When i remove the "/Users/pratik/Projects/main/python/pylintrc" path, then it works (but does not use my pylintrc, uses the default one)

tispratik avatar May 28 '20 02:05 tispratik

After removing pylintrc path, it works. Screen Shot 2020-05-27 at 7 45 39 PM

tispratik avatar May 28 '20 02:05 tispratik

My pylintrc contains the following line, which causes the issue. If i remove the below line, it works:

init-hook="from pylint.config import find_pylintrc; import os, sys; sys.path.append(os.path.dirname(find_pylintrc()))"

tispratik avatar May 28 '20 02:05 tispratik

I have the same problem but even without pylintrc path set :( (IDEA 2020.1.2 Ultimate edition, Pylint plugin 0.12.2, Python plugin 201.78846.85)

Idea log just says: 2020-06-19 13:44:48,253 [1705284] INFO - di.pycharm.pylint.PylintPlugin - Scanning current file(s). and finds nothing even though cmd line version does find some issues

FYI: when i set debug logging to PylintRunner, pylint during check seem to work: 2020-06-19 14:15:39,476 [3556507] DEBUG - harm.pylint.plapi.PylintRunner - Pylint path check output: :no-member (E1101): *%s %r has no %r member%s* Used when a variable is accessed for an unexistent member. This message belongs to the typecheck checker.

liry avatar Jun 19 '20 11:06 liry

I'm experiencing the same issue where I just can't get pylint plugin to produce any output, but calling pylint from command line works.

  • OS: Linux Mint
  • Plugin version: 0.12.2
  • PyCharm version: 2020.1.3 Ultimate
  • Pylint version: 3.0.0-a4

I just switched from Windows to Linux and strangely the plugin works there (config sahred via VCS) and even works on friends macOS, so it seems like issue may be specific to Linux.

I'm not sure how to debug it since plugin produces no output (either success or error).

Removing .pylintrc from config doesn't help, hardcoding pylint path instead of plugin autodetecting it also doesn't change anything, so I'm kind of stuck. :/ I'm wondering if it may be a permission issue.

EDIT: It seems like that in PyCharm 2021.3 (EAP at the moment) this issue doesn't exist anymore, which makes me think it may be related to plugin missuing pylint from venv folder. In new version they enforce external tools to use venv, so maybe that solved it for plugins as well: https://youtrack.jetbrains.com/issue/PY-12988

tad3j avatar Jul 19 '21 16:07 tad3j

I have been encountered this as well. In general I notice that most "outdated" config items or missing plugins will cause the plugin to "quietly fail" meaning it will just display "Pylint found no problems"

To replicate the issue add disable=no-init

The symptoms: in pylint commandline output:

************* Module <path>/pylintrc
pylintrc:1:0: R0022: Useless option value for '--disable', 'no-init' was removed from pylint, see https://github.com/PyCQA/pylint/issues/2409. (useless-option-value)

entry in the idea.log:

2022-10-05 12:57:20,917 [9021467]   INFO - #c.l.p.p.p.ProcessResultsThread - Could not find mapping for file: pylintrc in {<path redacted>/unit_tests/test_dvc_data_set.py=PyFile:test_dvc_data_set.py}

The workaround for me is to cleanup the config In long term this plugin need to detect this problem and report it instead of "quietly ignoring" it.

maciejmatuszak avatar Oct 05 '22 02:10 maciejmatuszak

I get the same behaviour with the official example pylintrc https://github.com/PyCQA/pylint/blob/f860e3fe1c03be81e16732123a1e0cdb247db47f/examples/pylintrc

When scanning the file outside PyCharm and thus not with the plugin, multiple problems are shown, in my case no R* problems, no "Useless option ..." ones.

kannes avatar Jan 06 '23 12:01 kannes

I have a slight variation on this same issue. PyCharm 2022.3.3 (Professional Edition) Build #PY-223.8836.43, built on March 10, 2023 macOS 13.2.1

I can get pylint to work in one project but not another.

The project where pylint plugin detects error is using python 3.10 Whereas the project that doesnt is using 3.11

The project where it doesn't detect errors in the plugin, works when using commandline. They have slightly different pylintrc files.

plugin fails

[MASTER]
ignore-paths=^.*/tests/.*$
disable=
    arguments-renamed,
    duplicate-code,
    import-error,
    invalid-name,
    logging-format-interpolation,
    logging-fstring-interpolation,
    no-member,
    no-self-use,
    super-init-not-called,
    too-few-public-methods,
    unused-argument,
    useless-super-delegation,
    wrong-import-order,

plugin works

[MESSAGES CONTROL]
disable=raw-checker-failed,
        bad-inline-option,
        locally-disabled,
        file-ignored,
        suppressed-message,
        useless-suppression,
        deprecated-pragma,
        use-symbolic-message-instead,
        f-string-without-interpolation,
        missing-module-docstring,
        missing-class-docstring,
        missing-function-docstring,
        useless-return,
        too-few-public-methods,
        logging-fstring-interpolation,
        too-many-instance-attributes,
        invalid-name,
        arguments-renamed,
        try-except-raise,

Edit: I narrowed it down to the disable option of no-self-use. The plugin works when I remove that option.

bandophahita avatar Mar 23 '23 14:03 bandophahita

If anyone else finds this thread, my issue was also an invalid linting key that caused my issue. I had max-complexity in my .pylintrc file and once i removed it, pylint started working again in PyCharm. But then i realized I needed to specify the plugin for that particular check to succeed

vt-cwalker avatar Feb 01 '24 18:02 vt-cwalker