I want to add a customized check to my pylintrc file to check and report
cases whenever I define a function in a python file like this:
def foo( var1, name1=value, *args ):
The problem that I want to deal with is that we should not have keyword
arguments( *name1* ) before positional arguments( **args* ). Although the
function can still be called by passing *name1* as positional argument but
there would be no way to not specify *name1* but specify **args*.
How can I add this check to pylintrc file?
Thanks in advance!
We're using pylint as a pre-commit hook to check our code. However, it
takes about a minute for each run, and it's quite frustrating.
I guess that most of the work is redundant, as most files do not change
between runs. How hard would it be to add the ability to cache results to
speed-up linting? I may be able to spend a day or two working on this, if
there's a relatively simple way to do this.
Is it possible?
I've numbered the lines in this code fragment:
83 category = Column(Unicode(16), value = 'Environmental', nullable = False,
84 "category IN('Air', 'Environmental', 'Health', 'Safety', 'Occupancy',
flake8 has these errors:
84:39: E201 whitespace after '('
86:9: E128 continuation line under-indented for visual indent
I've read PEP8 and found several fora threads related to E128 and E201 but
no matter how I reformat that statement I cannot remove these (or other)
errors when flake8 runs on this module.
When I continue line 84 the '(' and emacs breaks it near column 78 I get a
different error about closing brackets not being correctly aligned. But, no
matter where I place the final bracket it shows an error.
This module has many error conditions simular to the above and I want to
understand how these long lines should be formatted so flake8 no longer
complains regardless of how I change the lines.
Thanks in advance,
Just installed flake8-2.4.1. Checking a file generates this error:
pwschemasl.py:698:39: E225 missing whitespace around operator
on this line:
where position 39 is 'F'. So, I add the space:
rpt_filename=Column(BLOB, nullable= False)
and now flake8 shows this error:
pwschemasl.py:698:40: E251 unexpected spaces around keyword / parameter
This is an infinite loop that affects many lines of code in the file. The
lines throw a PEP8 compliance error both with and without a space following
the '=' sign.
Is there something I've done incorrectly that I don't see?
I found out that my .pylint.d directory has grown to 170MB, as I am working
on a 1GB workspace this is a lot. I haven't found a way to clean it in the
FAQ or manual. Can I just delete the contents without damaging PyLint?
Thanks for answers,
Is there any way to make pylint report circular package dependencies with
an exit code != 0?
Assume code has packages A and B. A.a1 imports B.b1, and B.b2 imports
A.a2. While this may work, imho this is a bad smell in design that I want
to detect as early as possible (same as any other bad smells that pylint
I know that pylint can write import dependency graphs, but I could not find
a trivial way to use them a a check (trivial == no coding required).
Any option that I am missing?
We use flake8 at Dropbox and are pretty happy with it. But one small issue
is the way that flake8 configuration gets discovered. We use the
per-project configuration via setup.cfg files which are checked into source
control, but flake8 only considers the first setup.cfg in the directory
path (regardless of whether it contains a flake8 section or not). This
forces us to duplicate our [flake8] configuration across all of our various
Said in crude ascii form, this is a simplified version of our project
- repo root
|- setup.cfg (default values)
\- subservice #1
\- setup.cfg (which has non-flake8 overrides for subservice #1)
\- subservice #2
\- setup.cfg (which similarly contains non-flake8 overrides for
But before I go off trying to patch flake8 code, is there relevant
background on why you guys don't try to discover the first setup.cfg with a
flake8 section, but instead just consider the first encountered setup.cfg?
We've seen teams accidentally break flake8 checking whenever they add
setup.cfg files for non-flake8 projects, and the "fix" is to copy/paste the
flake8 section into those new files.
Or alternatively, should we be doing something different with our project
layout as a workaround? It's entirely possible that we should be
configuring things differently overall...?