Questions tagged [pylint]

Pylint is a Python source code analyzer looking for bugs and signs of poor quality.

Pylint is a Python tool that checks if a module satisfies a coding standard.

1691 questions
0
votes
0 answers

Undefined variable pylint error for SConstruct file

When I open the SConstruct file from my project, the pylint reports error: "Undefined variable 'Environment' on code: env = Environment() What import should be added to make sure pylint can find definition of Environment?
Enze Chi
  • 1,733
  • 17
  • 28
0
votes
1 answer

What is the pythonic solution to enumerate and update items from a matrix?

I did a for loop using enumerate from values in a matrix and tried assigning a value to the items that are different than 0 while appending to a list elements that are equal to 0. The fact is that original matrix don't get updated. Sample…
staticdev
  • 2,950
  • 8
  • 42
  • 66
0
votes
0 answers

pylint doesn't work correctly when pylint_django loaded

When pylint-django is installed error messages like Class 'MyModel' has no 'objects' member disappear. But with them being disappeared some real errors are skipped too. For example, the line MyModel.objectss.all() will not throw an error (note two s…
Artem Ilin
  • 353
  • 2
  • 19
0
votes
1 answer

PyLint highlighting globally declared variables as undefined

I recently switched from PyCharm to VS Code, and get a lot of error messages from PyLint for globally declared variables(parameters read out of a json file). The same file doesnt show any errors in PyCharm, and the code runs without problems. Whats…
0
votes
0 answers

Problem with Pylint executing the code in VScode/Linux

I'm practising Python programminng with VScode in my Solus budgie laptop. I have Python-extension installed in VScode and Python3 + Pylint installed in Linux. I wrote a program that makes thumbnail pictures from all the pictures in one folder. It…
jaka
  • 1
  • 1
0
votes
1 answer

how to fix "Missing mandatory keyword argument 'size' in function call" pylint(missing-kwoa) E1125

I want to pass an array, int to a function of different file and I want to return int(1 to 9) I have simplified it but it is still showing error E1125 # in basic.py import neural_network as nu import numpy as np import math import…
0
votes
1 answer

Visual Studio Code fails to install pylint

After creating a new conda environment Visual Studio Code asks to install pylint: If I press Install, it fails due to access restrictions: "C:/Program Files (x86)/Microsoft Visual Studio/Shared/Anaconda3_64/envs/derm-ai/python.exe" -m pip install…
mentalmushroom
  • 2,261
  • 1
  • 26
  • 34
0
votes
0 answers

Pylint falsely complaining of undefined variable

Summary Pylint is complaining of undefined variables in class declarations and the following functions. If I comment out the class declarations, the functions are still being highlighted and I am unsure why. Environment OS: Suse Leap 42.3 Editor:…
Roqux
  • 608
  • 1
  • 11
  • 25
0
votes
1 answer

Is pylint safe to run on untrusted input?

Is pylint safe to run on untrusted Python code? Classic static code analyzers should be safe as they are not executing the code but I don't know how pylint is implemented or any history in this area. I see there's at least one optional feature,…
KevinJWalters
  • 193
  • 1
  • 7
0
votes
2 answers

How to change the way pylint lints the comments

I need to have this line in the beginning of a python file: #script_exec_time: 500 There should not be any space between the # and script_exec_time. This is because the python file is parsed by another script and it will not consider the…
Ganesh Biradar
  • 41
  • 1
  • 1
  • 8
0
votes
0 answers

Force import line formatting on python script

I see there are two ways of declaring a big import clause: from lib.backends.my_lib import ( MyClassA, MyClassB, MyClassC, MyClassD ) and from lib.backends.my_lib import MyClassA, \ MyClassB, MyClassC, MyClassD I personally prefer the…
MatheusJardimB
  • 3,599
  • 7
  • 46
  • 70
0
votes
1 answer

There is a way to eliminate the errors "Unable to import XXX" on VSCode?

I'm using VSCode to write my Python code and even the code run properly the pylint report the error: "Unable to import xxx" see the figure below! how can I avoid it?
Alex Rosa
  • 49
  • 7
0
votes
1 answer

Pylint complaining about function reports

I am attempting to import functions from couple of files called mysql_calls.py system_calls.py If I import with from mysql_calls import * pylint complains about wildcard import and if I just do import mysql_calls pylint complains about…
ScipioAfricanus
  • 1,331
  • 6
  • 18
  • 39
0
votes
1 answer

Why I'm getting syntax error on 1st line?

I installed pylint on my PC. But while I'm writing some code, for instance: def my_logger(original_func): import logging logging.basicConfig(filename = f'{original_func.__name__}.log', level = logging.INFO) def wrapper(*args,…
user10732864
0
votes
1 answer

Undetected dangerous default value for mutable inside immutable (tuple of lists)

Why the following code does not trigger dangerous-default-value for items when using pylint? Is this an unintended feature of pylint (i.e. a bug)? def func(item, items=([],)): items[0].append(item) return items My understanding is that it…
norok2
  • 25,683
  • 4
  • 73
  • 99
1 2 3
99
100