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

pylintrc is not being respected

Open DeepSpace2 opened this issue 5 years ago • 17 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.11.0
  • PyCharm/IDEA version: 2019.1.3
  • Pylint version: 2.3.1

Step 3: Describe the problem:

Steps to reproduce:

  1. Create a .pylintrc file in an arbitrary location. I used the project's root directory.
  2. Select the file in the plugin's config screen under "Path to pylintrc".
  3. Run a scan using the "Scan project" button.

Observed Results:

The scan executes as if no .pylintrc file was provided.

Expected Results:

The scan should respect the configuration from .pylintrc

Relevant Code:

project tree:

image

.pylintrc file:

[MASTER]
ignore=no_pylint_here

Plugin settings:

image

Executing pylint from terminal, .pylintrc is respected:

$ pylint project --rcfile="D:\Python Projects\pylint_plugin_test\.pylintrc"      
************* Module file_to_scan                                                                              
project\file_to_scan.py:1:0: C0304: Final newline missing (missing-final-newline)                              
project\file_to_scan.py:1:1: C0326: Exactly one space required around assignment                               
a=1                                                                                                            
 ^ (bad-whitespace)                                                                                            
project\file_to_scan.py:1:0: C0111: Missing module docstring (missing-docstring)                               
project\file_to_scan.py:1:0: C0103: Constant name "a" doesn't conform to UPPER_CASE naming style (invalid-name)
                                                                                                               
----------------------------------------------------------------------                                         
Your code has been rated at -30.00/10 (previous run: -30.00/10, +0.00)

However, when executing a scan from Pycharm both files are scanned.

image

DeepSpace2 avatar Jun 04 '19 17:06 DeepSpace2

This issue has been automatically marked as stale because it has not had activity in the last 60 days.

stale[bot] avatar Aug 05 '19 14:08 stale[bot]

I think this is issue with ignore (and probably ignore-patterns) because I have the same problem but some other options that I am using seem to work

Pitirus avatar Aug 27 '19 13:08 Pitirus

The same with Pitirus, "ignore" does not work. In command line, "ignore" works just fine.

nixiaoya avatar Sep 05 '19 04:09 nixiaoya

Same problem here, when I click the 'check project' icon in the IDE the pyline.exe command is passed a full list of .py files to check. The --ignore=directory command line entry or the entry in the .pylintrc file are ignored.

Both these options work correctly when run pylint from the Terminal so I know the .pylintrc file and/or the --ignore option is working.

Seems that the plugin is sending everything, which we could say it shouldn't, and the pylint.exe is overriding the ignore options if the file has been explicitly passed on the command line.

If I mark a folder as Excluded in PyCharm the the directory is not passed to pylint but I'd rather the config/command line switches dealt with it rather than any IDE project setting.

dixong avatar Sep 12 '19 11:09 dixong

Will this be fixed soon ? I seem to run this problem as well, although when I run pylint through command it seems to respect .pylintrc

ErezCsillag avatar Nov 10 '19 18:11 ErezCsillag

This issue has been automatically marked as stale because it has not had activity in the last 60 days.

stale[bot] avatar Jan 09 '20 18:01 stale[bot]

+1

mmalhotra avatar Feb 26 '20 22:02 mmalhotra

This issue has been automatically marked as stale because it has not had activity in the last 60 days.

stale[bot] avatar Apr 26 '20 22:04 stale[bot]

Just ran into the same problem. How about looking into this, instead of having the bot automatically mark it as stale after two months?

rhjdjong avatar May 19 '20 12:05 rhjdjong

+1

AnirudhGoel avatar Sep 24 '20 12:09 AnirudhGoel

FWIW, I figured out a way that seems to work for me:

In the settings of the plugin, there is an "Arguments" option. Use --rcfile /absolute/path/to/pylintrc and now pylintrc is respected.

pdemarti avatar Feb 10 '21 13:02 pdemarti

I have the same problem. Command-line correctly ignores a given python file, but the plugin does not, ever though they are using the same .pylintrc and executable.

mattrmd avatar Jul 23 '22 22:07 mattrmd

This issue has been automatically marked as sadge because it has not had activity in the last 60 days.

jstnfst avatar Nov 21 '22 19:11 jstnfst

FWIW, I figured out a way that seems to work for me:

In the settings of the plugin, there is an "Arguments" option. Use --rcfile /absolute/path/to/pylintrc and now pylintrc is respected.

Not the case for me, the behavior is the same.

kannes avatar Jan 06 '23 12:01 kannes

+1

ganeshpatro321 avatar Mar 01 '23 17:03 ganeshpatro321

I found a solution that worked for my Windows PC.

I installed a Linux VM, where I configured PyCharm and Pylint. Then, I created a GitHub repository to upload .pylintrc file on the Linux VM. Finally, I downloaded on Windows the .pylintrc file from the repository and I specified the path to this file in the configuration of Pylint.

It worked, even after making changes to .pylintrc. The main bug I encountered was that sometimes (when running Pylint) it would use a previous version of .pylintrc, instead of the current one, but it can be fixed by restarting Pycharm.

Chris-Morrish avatar Mar 08 '23 21:03 Chris-Morrish

Another year, another bump.

Decappi avatar Apr 10 '24 12:04 Decappi