Questions tagged [flake8]

Automatic syntax checker for Python, bundled with pycodestyle, pyflakes and mccabe.

Automatic syntax checker for Python programming language, bundled with pycodestyle, pyflakes, mccabe for easy installation and use.

410 questions
0
votes
1 answer

UnicodeDecodeError in pip install flake8 on Windows 8.1

I'm trying to install the flake8 module for Python (in order to use the SublimeLinter-flake8 package to Sublime Text 3) but get an error message on install (below). What am I doing wrong here? C:\Windows\system32>python -m pip install…
Fredrik P
  • 682
  • 1
  • 8
  • 21
0
votes
1 answer

How to configure paths to import from for flake8 in syntastic

I configured flake8 as the python checker in syntastic plugin. Problem is my project has some extra paths added to sys.path at runtime. I need somewhere to configure those paths, otherwise the checker will keep complaining [F0401] Unable to import…
Joey.Z
  • 4,492
  • 4
  • 38
  • 63
0
votes
1 answer

In vim python-mode, how can I get pep8-naming to work?

I've installed pep8 naming (https://pypi.python.org/pypi/pep8-naming) finchpowers@dev:~$ flake8 --version 2.1.0 (pep8: 1.5.7, pyflakes: 0.8.1, mccabe: 0.2.1, naming: 0.2.2) CPython 2.7.3 on Linux So it looks fine. In my .vimrc I have let…
Finch_Powers
  • 2,938
  • 1
  • 24
  • 34
0
votes
0 answers

pyflakes enforce 1 single empty line at end of file?

I am using flake8 with vim right now. I would like flake8 to show a lint warning if my file does not end with ONE single empty line at the end of file. I am very much used to the linter used at my old company Is that enforceable?
xjq233p_1
  • 7,810
  • 11
  • 61
  • 107
-1
votes
0 answers

How to build kivy app on github (using ndroid os)

I have been trying to build kivy app on github I downloaded the build.yml file and action.yml file and pushed it to my github account but lint flake8 keeps showing syntax error (sys not defined etc.) I tried using buildozer github actions yml file.…
Bright
  • 1
  • 1
-1
votes
1 answer

Lint error while running dockerized project on Github Actions

This is the error that I'm getting: (https://i.stack.imgur.com/xNs3G.png) Here is my setup for github actions: --- name: Checks on: [push] jobs: test-lint: name: Test and Lint runs-on: ubuntu-20.04 steps: - name: Checkout …
joyal
  • 3
  • 1
-1
votes
0 answers

Conflict between black and flake8 with Dev Container in VSCode: How to respect line length limits without using # fmt: off/on?

I'm using VSCode and have configured black and flake8 for dev container. My settings.json looks like this: { "python.linting.enabled": true, "python.linting.lintOnSave": true, "python.linting.mypyEnabled": true, …
aykhr
  • 1
  • 1
-1
votes
2 answers

Uninstall Pylance and Flake8 from Visual Studio Code

I have been using Pylance and Flake8 for a while, but now I don’t think I need them anymore, and they’re bothering me a lot since there are a lot of rules to follow. How I uninstall them from my Visual Studio Code and even from my PC? I know there…
-1
votes
1 answer

Why do pylint and flake8 raise different messages?

Suppose I have this method: def test_method(): #comment here my_variable=1 print(my_variable) raise Exception('Exception message') When I use pylint, these messages were raised: test.py:1:0: C0116: Missing function or method…
Triet Doan
  • 11,455
  • 8
  • 36
  • 69
-1
votes
2 answers

How to enable Pylint extension to show "E202" error on VSCode?

I wrote the code below on VSCode: """Say Hello""" print("Hello" ) Then, Flake8 extension can show E202 error for print("Hello" ) as shown below: whitespace before ')' Flake8(E202) But, Pylint extension cannot show E202 error for…
Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
-1
votes
1 answer

How can I change the problem level of a specific pycodestyle error with the VS Code Python extension?

I am using Visual Studio Code, I am linting the code with flake8 and pycodestyle. I would like the line length error (E501) to be considered as a warning. So far, the only thing that I could find was to ignore totally E501 with the solution found at…
nemo
  • 58
  • 6
-1
votes
1 answer

Flake8: ValueError: 'choice' is not callable

After upgrading to flake8 v6.0.0, I tried running the command flake8 at the project level. However, I receive this error in the console: Traceback (most recent call last): File "env/bin/flake8", line 8, in sys.exit(main()) File…
Khalil
  • 175
  • 2
  • 8
-1
votes
1 answer

black and flake8 hooks conflicts

Black fail and reformat the following foo1 = foo2[len(foo3):] to foo1 = foo2[len(foo3) :] But Flake8 fails with foo1 = foo2[len(foo3) :] and wants foo1 = foo2[len(foo3):] Unless I am mistaken, in this case Flake8 is right. How to make a…
servoz
  • 606
  • 9
  • 22
-1
votes
1 answer

sh: flake8: not found, though I installed it with python pip

Here I'm going to use flake8 within a docker container. I installed flake8 using the following command and everything installed successfully. $ sudo -H pip3 install flake8 // worked fine and it's location path…
-1
votes
1 answer

PEP-8 break up for loop

I am trying to figure out a way to break a long for loop to make it PEP-8 valid. (I'm using flake8 vscode extension). This is the code: for result_row in soup.find_all('div', {"class": "b2c-inner-data-wrapper"}): .............. The error I get…