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
-1
votes
2 answers

Satisfy flake8 using the following example

I have a very simple expression below. I am checking each character of a password to ensure it has at least one of the below special characters. However, Flake8 registers the example as bad. How can I address this within Flake8? W605 invalid escape…
-1
votes
1 answer

I can't exlude the directory from my pre-commit

My goal it's exlude migrations/ from my pre-commit. I have my .pre-commit-config.yaml which begin with repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: - id: check-yaml - id: debug-statements …
-1
votes
2 answers

Flake8 Errors not shown in VS Code

I have been using flake8 for linting but somehow it stopped showing me errors in the code in any of my workspaces (the squiggly underlines in the editor). flake8 is installed in my conda environment. Here is my settings.json: { …
mi-les
  • 9
  • 2
-1
votes
1 answer

Fail GitLab CI/CD Pipeline on added flake8 violations

Given a large, legacy Python codebase in GitLab, it is unreasonable to fail the CI/CD pipeline on flake8 violations, because solving problems in such an amount of legacy code would completely stall development. Is there instead a way to configure…
GabCaz
  • 99
  • 1
  • 11
-1
votes
1 answer

Flake8 check ok

I recently got a problem: I did a fresh ubuntu 22.04 setup, installed vim and flake8. After opening my .py file, flake8 doesn't show any errors (even of there are some, I did them on purpose). Is there anything I could do? Other plugins work, there…
Pakuss
  • 1
  • 2
-1
votes
1 answer

Flake8 CI Worflow GitHub

Trying to implement flake8 inside a workflow in github is causing me error because is not recognising .flake8 file. It works perfectly from the terminal: [flake8] max-line-length = 79 exclude = migrations views.py tests.py …
9Shuck
  • 1
  • 1
-1
votes
1 answer

Cause linter to warn on usage of specific symbol in external library

How can I configure pylint and/or flake8 to show a warning/error on a specific import from a specific module of an external package. For context: I have a Django project that requires a custom implementation for login_required. It would be good to…
Zulan
  • 21,896
  • 6
  • 49
  • 109
-1
votes
1 answer

Make flake8 detect Python types errors

Going through FastAPI docs, it looks like the following function def get_name_with_age(name: str, age: int): name_with_age = name + " is this old: " + age return name_with_age should trigger an error message in VSCode via a Python linter…
floatingpurr
  • 7,749
  • 9
  • 46
  • 106
-1
votes
1 answer

flake8 ignore list isn't understood by Azure DevOps pipeline

I want to capture logs that are sent to Stream, in ontology_tagger.ipynb. Said file is 2 folders up/ back and 1 in: from ontology_tagger.notebooks.ontology_tagger import main I have tried various solutions without luck, from this…
StressedBoi69420
  • 1,376
  • 1
  • 12
  • 40
-1
votes
1 answer

VS Code's flake8's ignore arguments don't work on format on save?

Here is my settings.json: { "python.pythonPath": "/home/zhaodachuan/anaconda3/envs/ranking_engine/bin/python", "python.autoComplete.extraPaths": [ "/mnt/c/Users/hnjyz/OneDrive/jupyter_lab/code/ranking_engine", ], …
DachuanZhao
  • 1,181
  • 3
  • 15
  • 34
-1
votes
1 answer

How fix a unused error caused by underfline, when I use flake8

In VSCode flake8 ignore _ unused error just like this try: pass except Exception as _: pass then flake8 show a error '_' unused
admin
  • 169
  • 1
  • 6
-1
votes
1 answer

Flake8 does not produce errors

Flake8 does not produce error on E121,E123,E126,E226. When I run flake8 --help, I get back: --ignore=errors Comma-separated list of errors and warnings to ignore (or skip). For example, ``--ignore=E4,E51,W234``. …
user128751
  • 469
  • 2
  • 5
  • 10
-2
votes
0 answers

Is there a way to ignore flake8 only for files in a certain folder on github?

when I push changes, flake8 checks are done for all files. I tried to modify each file manually, which is not ideal Is there a way to ignore flake 8 for all files in certain folder? say "bar" located in /foo/boo/bar Thank you!
-2
votes
1 answer

flake8 & pycodestyle/pep8 not showing E721 errors

Versions λ python --version Python 3.10.6 λ flake8 --version 5.0.4 (mccabe: 0.7.0, pycodestyle: 2.9.1, pyflakes: 2.5.0) CPython 3.10.6 on Linux # and on Windows ## Edit: after update λ flake8 --version 6.0.0 (mccabe: 0.7.0, pycodestyle: 2.10.0,…
Nealium
  • 2,025
  • 1
  • 7
  • 9
-2
votes
1 answer

Tox.ini does not recognize python folder?

I ran into weird issue which I have trouble solving. I have following tox.ini file: [vars] PROJECT = django_project TASKS = tasks --exclude tasks/migrations PAGES = pages -exclude pages/migrations [tox] envlist = py310, flake8, black,…
J. Donič
  • 131
  • 7
1 2 3
27
28