flake8

Filter out specific errors from Flake8 results

Filter out specific errors from Flake8 results Question: We are writing notebooks in databricks. When we put them to git we want to run flake8 on them to check for new problems in the code. As databricks has some predefined variables those are undefined in the code itself. Is it possible to filter our errors …

Total answers: 2

flake8 is not picking up global configuration file in user directory

flake8 is not picking up global configuration file in user directory Question: I have flake8 installed in pipenv virtual environments on per project basis. The flake8 docs state that: Values set at the command line have highest priority, then those in the project configuration file, then those in your user directory, and finally there are …

Total answers: 2

Python AutoPep8 formatting not working with max line length parameter

Python AutoPep8 formatting not working with max line length parameter Question: I noticed one strange thing that autopep8 autoformatting in VSCode doesn’t work when we set "python.formatting.autopep8Args": [ "–line-length 119" ], But if this setting is in a default mode that is line length 79 then it works well. Is there some issue with autopep8 …

Total answers: 3

How to check for redundant parentheses with flake8?

How to check for redundant parentheses with flake8? Question: PyCharm has a nice feature that lints the following code if (a == b): # … with “Remove redundant parentheses” concerning the (a == b) expression. Running flake8 on the same code doesn’t complain about anything by default. Is it possible to configure flake8 in a …

Total answers: 2

Using Flake8 in VSCode…?

Using Flake8 in VSCode…? Question: My VSCode is using a locally installed anaconda environment, at the default directory, which places it in Program Files. Because of this I’m unable to install flake8 through VSCode, I get a permission error. If I update my conda environment at the local level to install flake8, does anyone know …

Total answers: 3

Ignoring a specific flake8 rule for a folder

Ignoring a specific flake8 rule for a folder Question: I am using flake8, flake8-docstrings and many other flake8 plugins in our project I want to disable flake8-docstrings only for our test folder. I want to avoid running flake8 twice because it would mean that running flake8 wouldn’t be the straight forward flake8 . anymore. Not …

Total answers: 2

Using Pylint in Ipython (Jupyter-Notebook)

Using Pylint in Ipython (Jupyter-Notebook) Question: I want to run Pylint or any equivalent while using Jupyter-Notebook. Is there a way to install and run Pylint this way? Asked By: mccurcio || Source Answers: pycodestyle is an equivalent of pylint for Jupyter Notebook which is able to check your code against the PEP8 style guide. …

Total answers: 5

Descriptive flake8 errors in PyCharm

Descriptive flake8 errors in PyCharm Question: PyCharm does not have a built-in support for flake8 at the moment. But, flake8 can be configured to run as an external tool. Sometimes, especially for Python newcomers, not every flake8 warning is understandable and additional clarification is required. We’ve recently stumbled upon the Flake8Rules project which attempts to …

Total answers: 5

How to tell flake8 to ignore comments

How to tell flake8 to ignore comments Question: I’m using flake8 in emacs in order to clean up my python code. I find it annoying to have my comments flagged as errors (E501 line too long (x > 79 characters)). I’m wondering if anyone knows a way to kindly ask flake8 to ignore comments, both …

Total answers: 3

Can't pass flake8-import-order without raising I201 and I202

Can't pass flake8-import-order without raising I201 and I202 Question: I’m currently contributing to a cool little python project, namey PhotoCollage, and the maintainer requests contributers to pass flake8 checks before considering pull requests (fair enough). My problem is that I can’t get these checks to pass: on my computer, no complaint. But on Travis, I …

Total answers: 1