![](/img/trans.png)
[英]Pylint warning typing final
我正在使用 pylint --list-msgs 我收到的警告之一是: :using-final-decorator-in-unsupported-version (W2602): *typing.final is not supported by all versions included in ...
[英]Pylint warning typing final
我正在使用 pylint --list-msgs 我收到的警告之一是: :using-final-decorator-in-unsupported-version (W2602): *typing.final is not supported by all versions included in ...
[英]How can I disable pylint's missing-module-docstring for unit tests?
我非常喜歡 pylint 的內置文檔字符串檢查器。 我很高興在我的所有類、所有函數和所有模塊上都需要文檔字符串。 但是,我不喜歡的是,pylint 還需要我所有測試模塊和所有pytest測試函數上的文檔字符串。 這會導致像下面這樣的低價值文檔字符串:"""Tests for foo.py""" ...
[英]C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
對於以下行,我遇到了 pylint 問題:“C0209:格式化可能是 f 字符串的常規字符串(考慮使用 f 字符串)” 我嘗試解決它,但我不確定這是否是解決它的正確方法。 有人可以建議嗎? ...
[英]Intellij PyCharm/IDEA - pylint.config.find_pylintrc() returns None
嘗試設置 Python 包路徑以在 IDEA/PyCharm 中將 pylint 作為外部工具運行並遵循PyLint“無法導入”錯誤 - 如何設置 PYTHONPATH? 設置 pylintrc。 但是, pylint.config.find_pylintrc()在 IDEA/PyChar ...
[英]Pylint nested pylintrc : Specify a configuration file
目標 我想使用 pylint 而不指定文件路徑(只需運行pylint而不是pylint --rcfile=linter/.pylintrc ),因為我想將所有與 linter 相關的文件保存在子文件夾linter/中。 我想在根文件夾中添加一個.pylintrc文件,只是重定向到實際的配置文件li ...
[英]Simplifying line length with pre-commit, flake8, black, isort, pylint, etc
當使用多個工具檢查或格式化 python 文件時,有沒有辦法一次性設置行長? 目前我有: .flake8文件: .isort.cfg文件: .black文件: .pylintrc文件: ...
[英]VSCode Python Linting .pylintrc in repository vs workspace root
我正在嘗試使用 vscode 獲取 pylint 以 respect.pylintrc 放置在存儲庫中。 我查看了 pylint 和 vscode python 擴展的文檔。 這似乎不可能。 文件夾結構: 我們目前有來自不同團隊的 +30 個存儲庫。 是否有可能以某種方式配置擴展,以便它可以識別來 ...
[英]How to add a custom-made "good-name" like "ax" to pylintrc settings in visual studio code?
為了避免處理由於在繪圖例程中使用變量ax而引發的警告,我想將其添加到我的 python 中的good-name變量列表中。 在Linux,這是最好的平台,這很容易做到。 但是,我試圖在安裝在 Windows 10 上的 Visual Studio 代碼中保留和維護我的代碼。有人知道如何在 Visu ...
[英]Pylint, how to disable rule with condition
我不想禁用整個項目的規則,而是針對已知場景。 喜歡:class A: def __init__(self, creator: Callback[[],B]) 大多數時候我使用x = A(lamda: Bx()) y = A(lamda: By()) 但它總是觸發unnecessary-la ...
[英]load customize pylint plugin
我正在嘗試編寫簡單的 pylint 插件,但任何輸入都會出現以下錯誤。 __init__py check_os_walk.py dir_traversal.py """ 遍歷目錄 """ 命令 venv/bin/pylint --load-plugins=$PWD/' init .py' di ...
[英]Linting error on BitBucket: TypeError: 'LinterStats' object is not subscriptable
我正在使用 BitBucket 管道使用 pylint 執行 linting 檢查。 幾個小時前它工作正常。 即使最終分數遠遠超過最低標准(8.0),我也一直面臨以下錯誤: 您的代碼已被評為 9.43/10 ...
[英]pylintrc configuration in visual studio code
我目前正在嘗試配置 pylint 以確保特定項目中的高編碼標准。 我的問題是,不知何故,我真的無法按照我想要的方式配置 pylint。 首先我嘗試使用VSC中的正常設置來配置pylint,這是按如下方式完成的(簡短示例): "python.linting.enabled": true ...
[英]How to set maximum limit of lines used inside a Python function using Pylint?
例子: 正如您在上面看到的 function 由從(def)開始到(print(d))結束的 6 行組成。 有沒有辦法在 Pylint 配置文件中設置python function 中使用的行的限制? 示例:max-lines-of-function=4 使用 Pylint 和配置文件。 ...
[英]How to ignore a specific Pylint message in Atom Editor?
當我使用制表符縮進時,我在 Windows 的原子中使用 Pylint linter package ,它給了我以下錯誤: W0311 Bad indentation Found 1 spaces, Expected 4. 即使 atom 正在使用“選項卡”(選項卡類型很難) 我使用以下命令創建了 ...
[英]PyLint Doesn't work on GitLab (Python 3.X)
我在 gitlab 上遇到了 Pylint 的問題。 出於某種原因,它在分析代碼的過程中崩潰了..但對我來說什么也沒說,只是崩潰了.. 下面是一些日志: core/db/sql/pgsql/__init__.py:162:8: E1101: Instance of 'Session ...
[英]Pylint variable name doesn't conform to snake_case naming style
我收到來自 pylint 的多個警告,例如:'''變量名“df”不符合蛇形命名風格''' 據我所知,這是因為變量名長度小於 3 個符號。 但是我想使用 df、i、x 等變量。 因此,我需要為 linting 異常添加幾個變量名。 我嘗試將該名稱添加到我的項目目錄中的 pylintrc 文件的 go ...
[英]How to disable pylint warnings and messages on vscode(python)?
我正在使用 Mac 並開始在 vscode 上使用 Python 進行編程。 安裝 pylint 並在第二天重新啟動計算機后,我收到了一堆警告和消息。 我如何禁用這些? 我知道在 pylintrc 文件中添加一些行,但我不知道在哪里可以找到它或如何在 Mac 上創建它。 謝謝 :) ...
[英]how to configure pylint for greater accuracy
從 pylint 獲得誤報考慮這段代碼:previous = None for word in ['you', 'cannot', 'be', 'serious']: if previous is not None: print(previous[0], word) ...
[英]How to change a error message into a warning message in pylint?
有沒有辦法在 pylintrc 文件中更改/指定規則的嚴重性級別(錯誤、警告)? ...
[英]PyCharm file type association (syntax highlighter) for .rc file
PyCharm 中.rc文件的正確文件類型關聯是什么? 我發現了什么 配置文件的語法熒光筆(.cfg、.ini、.rc) 建議使用Ini插件,但我認為.rc文件不是.ini文件。 我的具體用例在我的特定用例中,我有一個.pylintrc文件。 我不確定要選擇什么,目前,我只是選擇了Text 。 ...