Questions tagged [pylintrc]

90 questions
6
votes
3 answers

Linting error on BitBucket: TypeError: 'LinterStats' object is not subscriptable

I am using BitBucket pipelines to perform linting checks with pylint. It was working fine a few hours ago. I have been facing the following error even though the final score is well past the minimum criteria (8.0): Your code has been rated at…
Arjun A J
  • 396
  • 1
  • 9
  • 34
6
votes
1 answer

How to modify a variable naming convention for pylint in Visual Studio Code

I keep getting C0103 warnings from pylint in Visual Studio, because I am trying to use 2-character variables names like hp and gp. The warning is described here: link. The convention is described as [a-z_][a-z0-9_]{2,30}$ for variable-rgx. I don't…
Marses
  • 1,464
  • 3
  • 23
  • 40
5
votes
1 answer

How can I disable pylint's missing-module-docstring for unit tests?

I'm a big fan of pylint's built-in docstring checker. I'm very happy to require docstrings on all my classes, all my functions, and all my modules. What I don't like, however, is that pylint also wants docstrings on all my test modules and all my…
danvk
  • 15,863
  • 5
  • 72
  • 116
5
votes
0 answers

How to get pylint to import my files correctly using an init-hook

I followed these instructions on how to get pylint to import my files correctly using an init-hook. However, when I run the terminal command pylint server.py --rcfile=../.pylintrc I get TypeError: expected str, bytes or os.PathLike object, not…
Pro Q
  • 4,391
  • 4
  • 43
  • 92
4
votes
1 answer

How to change a error message into a warning message in pylint?

Is there a way to change/specify the severity level (error, warning) of a rule in pylintrc file?
Sina
  • 1,632
  • 3
  • 15
  • 21
4
votes
1 answer

Is it possible to specify a list of good names for pylint just within a single python file?

I'm looking for something like [BASIC] good-names=X, y as in pylintrc, but I'd like to limit these names to be good only within a single python file. I thought about message control like #pylint: disable=invalid-names on top of the file,…
zyxue
  • 7,904
  • 5
  • 48
  • 74
4
votes
0 answers

Pylint giving a false positive E1101 'no-member' error for 'http.HTTPStatus'

I am using pylint for code linting (inside VS Code with pylint 2.3.1, astroid 2.2.5, Python 3.6.2). The behavior can be reproduced with the following snippet: #!/usr/bin/env python3 # -*- coding: utf-8 -*- from http import…
albert
  • 8,027
  • 10
  • 48
  • 84
4
votes
2 answers

Why does the default pylintrc have so many disabled messages?

If you run pylint --generate-rcfile > pylintrc and look at the default rc file you'll see the following list of disabled warnings. Why are they disabled by default? disable=print-statement, parameter-unpacking, unpacking-in-except, …
AlexLordThorsen
  • 8,057
  • 5
  • 48
  • 103
4
votes
1 answer

Pycharm: What is the file type of cfg and .pylintrc files (For syntax highlighting)

I am using pycharm for a python project that I am working on. I have several cfg files and a .pylintrc file in the root directory. However, these files are not detected by pycharm for syntax highlighting. For example, WebStorm detects the .eslintrc…
4
votes
1 answer

Is it possible to get codacy to check usage of imported modules?

I have an ever-growing list of modules to ignore in my pylintrc: ignored-modules=anytree,apsw,bs4,cachecontrol,dateutil,inflect,matplotlib,markdown,munch,MySQLdb,pytest,pytz,requests_oauthlib,rrule,seaborn,titlecase,untangle,googleapiclient because…
Thomas David Baker
  • 1,037
  • 10
  • 24
4
votes
2 answers

How to get default config of pylint?

I will use this simple Python file for illustrating my problem: import os for i in range( -500, 0 ): print i I run Pylint on this file and get one message: $ pylint foobar.py ************* Module foobar W: 1, 0: Unused import os…
Ashwin Nanjappa
  • 76,204
  • 83
  • 211
  • 292
3
votes
0 answers

pylint 'unused_variable' warning on function definition

I have defined a function in __init__.py. While running pylint on __init__.py, it gives a warning about unused_variable on the function_name. I don't want to disable this warning in general (for actual unused variables, etc.) but obviously I don't…
3
votes
1 answer

How to make pylint enforce docstrings for all functions and methods in a repository

Pylint missing-docstring seems to ignore some functions and private methods in classes. How can I make pylint enforce that all functions and methods have to have docstrings in a certain repository? one option I've found is to disable ignoring of…
vladosaurus
  • 1,638
  • 1
  • 13
  • 18
3
votes
1 answer

How can I modify the value of "too-many-statements" from 50 to 100 in the pylintrc file?

When running Pylint on my file I am getting the following message. refactor (R0915, too-many-statements, function) Too many statements (95/50) I want to set the number of statements a function can have to 100 instead of 50 in order avoid the above…
3
votes
2 answers

git-lint pylint not running pylintrc file

I am using git-lint for my Python project. I have a .gitlint.yaml file in the root of my git repo, which contains, among other things, pylint: extensions: - .py command: pylint arguments: - "--rcfile={DEFAULT_CONFIGS}/.pylintrc" # doesn't…
mareoraft
  • 3,474
  • 4
  • 26
  • 62