![](/img/trans.png)
[英]flake8 & pycodestyle/pep8 not showing E721 errors
版本λ 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 Wi ...
[英]flake8 & pycodestyle/pep8 not showing E721 errors
版本λ 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 Wi ...
[英]Tox.ini does not recognize python folder?
我遇到了我無法解決的奇怪問題。 我有以下 tox.ini 文件: 黑色命令對 PAGES 按預期工作,但命令 flake8 和 mypy 返回以下錯誤: error: unrecognized arguments: pages -exclude pages/migrations 有誰知道是什么原因 ...
[英]How to run Flake8 on all python files via terminal on Pycharm?
我正在嘗試對項目中的所有 Python 文件運行Flake8 。 如何讓它發揮作用? 我收到此錯誤: .py:0:1: E902 OSError: [Errno 22] 無效參數: ' .py' 我能夠在單個文件上運行 flake8 ...
[英]F841 local variable never used error while variable being used in another file
我有兩個大致像這樣的文件。 module1.py : folder_1/module2.py: 基本上在一個文件中我聲明並分配一個變量,在另一個文件中使用它的子文件夾內。 上面的問題在module1.py中拋出一個 linting 錯誤 它是如何被使用的。 那么,我該如何解決這個 linting ...
[英]sh: flake8: not found
我已經被這個問題困擾了幾天了。 我正在嘗試對 django REST API + react (create-react-app) 應用程序進行 docker 化。 問題:$ docker-compose run --rm app sh -c "flake8" sh: flake8: not fou ...
[英]Pre-commit suddenly fails to install Flake8
預提交運行突然失敗,而沒有對預提交配置文件進行更改。 嘗試為 Flake8 初始化環境時,日志顯示以下錯誤消息: 預提交配置文件包括以下條目: ...
[英]Flake8: how to select all lints
根據: https://flake8.pycqa.org/en/6.0.0/user/options.html#cmdoption-flake8-select --select=<錯誤> 指定您希望 Flake8 報告的錯誤代碼列表。 與 --ignore 類似。 您可以指定錯誤代碼的 ...
[英]How to raise flake8 error when found particular string in whole project.?
當我運行flake8. 命令如果“print_queries”字符串存在於簽入 VCS 的項目文件中的任何位置(並且未排除),我想引發 flake8 錯誤。 這是我的flake8配置: 如何拒絕print_queries字符串檢查到 VCS 中? 我也在使用預提交。 ...
[英]sh: flake8: not found, though I installed it with python pip
在這里,我將在 docker 容器中使用 flake8。 我使用以下命令安裝了 flake8,一切都安裝成功。 $ sudo -H pip3 install flake8 // 工作正常它的位置路徑是- /usr/local/lib/python3.8/dist-packages 然后我執行了以 ...
[英]PEP-8 break up for loop
我正在嘗試找出一種方法來打破長循環以使其 PEP-8 有效。 (我正在使用 flake8 vscode 擴展)。 這是代碼: 我得到的錯誤是: 我試過了: 但我得到: 正確的做法是什么? 謝謝。 ...
[英]Changing assert statement to remove "== True" according to flake8 E712 produces error
我正在嘗試寫一個 pytest 的形式 pytests 通過了,但是一旦我嘗試提交到 GitLab,我收到以下消息並且提交失敗到 go。> flake8...................................................................Fa ...
[英]How to configure Flake8 for a PyCharm project on Windows?
我想將 Flake8 配置為使用 VirtualEnv 在 Pycharm 項目上運行。 我使用 Windows 10/11 作為操作系統。 我知道我需要將其配置為外部工具,因為市場上沒有插件。 我讀了這個問題PyCharm 中的描述性 flake8 錯誤,但它沒有提供所有詳細信息 ...
[英]How to enable linting for flake8 plugins in VSCode?
我安裝了 flake8 並且 VSCode 能夠使用波浪線檢測默認檢查。 現在,我安裝了flake8-docstring ,但 VSCode 沒有警告缺少 docstring。 例如,在 powershell 中運行以下命令,會得到預期的 output。 但是在 VSCode 中,它沒有顯示波浪線 ...
[英]How can I resolve flake8 error "D205: 1 blank line required between summary line and description"?
我正在嘗試使用 flake8(pydocstyle) 檢查我的文檔字符串的質量,我收到了這個錯誤: D205:摘要行和描述之間需要 1 個空白行這是我的代碼的樣子示例: 很難分開的長消息。 而 max line length = 100 如何正確地將句子轉移到另一行? 還是在這種情況下更容易忽略 ...
[英]Flake8 - line break before binary operator - how to fix it?
我不斷得到: 請幫我修復我的代碼,因為我無法弄清楚這里有什么問題: ...
[英]How can I enforce inheritance in my Django models?
在我的 Django 應用程序中,我有一個名為MyModel的抽象 model,它具有例如created_at和updated_at字段。 我希望我項目中的所有模型都是MyModel的子類,而不是直接使用django.db.models.Model 。 我們的應用程序上有幾個開發人員,所以我想使用 ...
[英]How to suppress a warning in one line for pylint and Flake8 at the same time
我想忽略 static 代碼分析中的特定行。 對於 Flake8,我會使用語法# noqa: F401 。 對於 pylint,我會使用語法# pylint: disable=unused-import 。 當我在開發代碼生成框架時,我希望代碼支持這兩種 linter。 有沒有辦法將這兩個指令結合起 ...
[英]Using GitHub Actions, how do you store flake8 exit code as a variable instead of failing the workflow?
我有一個 GitHub Action 工作流文件,它正在執行多個 linting 檢查。 flake8是第一個 linting 檢查,如果失敗,整個工作流程將失敗,這意味着后續的 linting 檢查名稱為:lint ...
[英]How to block pre-commit using 100% of my CPU?
我有預提交鈎子類型的預提交配置文件。 每次我推送到 repo 時,我的 CPU 都會顯示 100% 的使用電量。 為什么會發生? 如何設置最大功率的邊界? .pre-commit-config.yaml ...