Questions tagged [pylintrc]

90 questions
3
votes
1 answer

In Pylint, can I override global message control based on filename?

I use a pylintrc file to disable some pylint warnings project-wide, but I'd like to disable some more messages just for files named SConscript. Currently, I have a # pylint: disable=... in the beginning of each SConscript file, but it's a pain to…
Itamar
  • 1,089
  • 1
  • 10
  • 18
2
votes
1 answer

How to use pylint for all the files with non py extension in a directory for windows environment

I am using pylint version 2.16.1 on Python version 3.9 on windows. I need to execute pylint for all the files of non ".py" extension (example .abc extension) in directory and its subdirectories. I could not find an option as part of the pylint to…
2
votes
0 answers

Demoting or reducing severity of a Pylint message

There is this potentially useful but also pesky Pylint message which we would prefer to keep enabled and written to the console (and especially to the CI log), but only if Pylint can be told to return a 0 exit code if it finds nothing more severe…
V-R
  • 1,309
  • 16
  • 32
2
votes
2 answers

pylint and astroid AttributeError: 'Module' object has no attribute 'col_offset'

It fails using pylint version 2.9.0 and 2.9.3. With version 2.8.3 it still works though. See GitHub-issue under the provided link. Traceback (most recent call last): File…
Andreas L.
  • 3,239
  • 5
  • 26
  • 65
2
votes
1 answer

How to set maximum limit of lines used inside a Python function using Pylint?

Example: def exmaple_function(): a = 1 b = 2 c = 3 d = a * b + c print(d) As you can see above function constitutes of 6 lines from start of (def) to end of (print(d)). Is there a way to…
90's_jaddu
  • 53
  • 8
2
votes
0 answers

How to ignore file by name in all directories with pylint?

I'd like pylint to ignore all my init.py files. These files exist in all my directories and sometimes also in nested (on several levels) directories. I have a .pylintrc file. I tried to set the ignore-patterns options but it does not work. I tried…
Kimor
  • 532
  • 4
  • 17
2
votes
0 answers

Rationale behind maximum metrics for "DESIGN" in Pylint

Pylint has many metrics to ensure that code is readable and not too complex. [DESIGN] # Maximum number of arguments for function / method. max-args=5 # Maximum number of attributes for a class (see R0902). max-attributes=7 # Maximum number of…
Jean-Francois T.
  • 11,549
  • 7
  • 68
  • 107
2
votes
1 answer

File type association (syntax highlighter) for .rc file

What is the correct file type association for a .rc file in PyCharm? What I Found Syntax highlighter for config files (.cfg, .ini, .rc) Suggests using the Ini plugin, however in my opinion, a .rc file is not a .ini file. My Specific Use Case In my…
2
votes
0 answers

Disable E501 line too long pylint warnings in the Google Cloud Shell Code Editor

When I view a python file in the cloud shell editor, long lines are marked with a green line and a warning I find this warning distracting. On a modern wide screen, \ long lines are clearer \ than broken ones. I can remove the lint warning by…
intotecho
  • 4,925
  • 3
  • 39
  • 54
2
votes
1 answer

How could I let vim ale plugin use pylint configuration file

in my vimrc file, I add this line: let g:ale_python_pylint_options = '--rcfile ~/.pylintrc' And in my ~/.pylintrc file, I have this line: msg-template={msg_id}: {msg} However, with my vim ale plugin, the error message showed does not include the…
coin cheung
  • 949
  • 2
  • 10
  • 25
2
votes
2 answers

Jenkins PyLint Warnings tool parses log files but reports 'found 0 issues'

I have setup Jenkins to run pylint on all python source files and all the log files are generated (apparently correctly) into a sub-directory as follows: Source\pylint_logs\pylint1.log, pylint2.log, ..., pylint75.log I have included a…
e-holder
  • 1,504
  • 4
  • 20
  • 33
2
votes
0 answers

pylint doesn't detect most code violations

I'm using a Python3 virtual environment on Windows. Here is the command I run from my virtual environment. (myproject) C:\Users\jp\myproject> pylint src When I run pylint, it only uses a subset of its checkers (missing-docstring, broad-except...).…
Mat
  • 833
  • 1
  • 5
  • 20
1
vote
1 answer

Locally importing files in a python package

In the file __main__.py, I am trying to import the function print_logo() from the module print.py. I have noticed that the function print_logo() is actually being used from the package wpdetect installed in my system. How can I import and use the…
Hasan
  • 247
  • 7
  • 22
1
vote
1 answer

Tell pylint that a given decorator is a classmethod

How can I modify my pylintrc so that a given decorator is interpreted as a classmethod. pydantic defines a validator decorator to allow for attribute validation of model classes and operates as a class method. pylint throws a E0213: Method…
Dave
  • 7,555
  • 8
  • 46
  • 88
1
vote
1 answer

Intellij PyCharm/IDEA - pylint.config.find_pylintrc() returns None

Trying to set Python package path to run pylint as an external tool in IDEA/PyCharm and following PyLint "Unable to import" error - how to set PYTHONPATH? to setup pylintrc. [MASTER] init-hook="from pylint.config import find_pylintrc; import os,…
mon
  • 18,789
  • 22
  • 112
  • 205