![](/img/trans.png)
[英]pre-commit fails to install isort 5.11.4 with error "RuntimeError: The Poetry configuration is invalid"
預提交突然開始在我們今天的構建中安裝isort掛鈎失敗,並出現以下錯誤 好像跟詩歌配置有關。。 ...
[英]pre-commit fails to install isort 5.11.4 with error "RuntimeError: The Poetry configuration is invalid"
預提交突然開始在我們今天的構建中安裝isort掛鈎失敗,並出現以下錯誤 好像跟詩歌配置有關。。 ...
[英]django project: isort ignores local .cfg file's "skip" parameter
我在我的 Django 項目中使用“isort”,問題是當我在項目級別執行 isort 命令時,它會忽略應用程序級別“.isort.cfg”文件的跳過參數。 我的 isort 版本是 5.11.4。 本地/應用程序級別的“.isort.cfg”文件: 如何強制它不忽略嵌套文件夾 cfg 文件? 命令 ...
[英]VS Code: "The isort server crashed 5 times in the last 3 minutes..."
我可能弄亂了一些環境路徑變量。 在了解 Django 和虛擬環境的同時,我正在修改 VS Code,並更改我的 Python 安裝的目錄路徑。 在弄清楚如何指向 VS Code 的默認 Python 路徑時,我刪除了一些用戶路徑變量。 然后,isort開始拒絕跑步。 我試過卸載擴展,刪除 ms-p ...
[英]How can I utilize asyncio to make third party file operations faster?
我正在使用一個名為isort的第三方庫。 isort有一個可用的 function 可以打開和讀取文件。 為了加快速度,我嘗試更改名為isort.check_file以使其異步執行。 方法check_file采用文件路徑,但是我嘗試的當前行為不起作用。 但是,這似乎不起作用。 如何使庫調用iso ...
[英]How to configure isort for a PyCharm project on Windows?
我想將 iSort 配置為使用 VirtualEnv 在 Pycharm 項目上運行。 我使用 Windows 10/11 作為操作系統。 我知道我需要將其配置為外部工具,因為市場上沒有插件。 ...
[英]Sort every thirdparty imports as different sections using isort
我正在嘗試使用flake8和isort庫。 我想將每個第三方模塊分類到不同的部分,簡單地說,我想在每個第三方模塊之間換一條線。 例如我有這個 我希望這是 ...
[英]isort sorting things differently when running locally than in CI/other machines
在本地運行 isort 時(例如python -m isort.或poetry run isort. , isort的排序似乎與 CI 中的不同,因此當我的 CI 作業使用python -m isort --check-only.格式是否正確時會失敗。 正確的: 錯誤,本地運行 ...
[英]How can I keep grouped imports by module with isort for renamed imports?
我有以下導入: from PyPDF2.constants import ( CatalogAttributes as CA, Core as CO, DocumentInformationAttributes as DI, EncryptionDictAttribu ...
[英]Simplifying line length with pre-commit, flake8, black, isort, pylint, etc
當使用多個工具檢查或格式化 python 文件時,有沒有辦法一次性設置行長? 目前我有: .flake8文件: .isort.cfg文件: .black文件: .pylintrc文件: ...
[英]isort config to always have multiple imports in parenthesis
我正在尋找一個 isort 配置,如果它是單個導入,則每次導入只有一行,但是一旦你有多個導入,它就會切換到括號,所以它看起來像下面 ...
[英]pre-commit isort no module named 'setuptools'
我正在嘗試運行預提交鈎子,但是當它們遇到拋出以下錯誤的 isort 鈎子時它們會失敗: 我正在使用 docker,並且我已經檢查了 setuptools 是否安裝在我的機器上,以及我的 docker 上。 我不明白為什么會發生此錯誤。 我認為 isort 設置了它自己的環境,但是為什么不安裝它,因為 ...
[英]disable isort check for 2 empty lines before <anything>
如何在<anything>之前禁用isort檢查 2 個空行 我嘗試告訴isort忽略空格,但這沒有幫助: ...
[英]How to make isort always produce multi-line output when there are multiple imports on a line?
我目前在我的項目中使用isort --profile=black --line-length=79作為 python 個文件的 linter。 這會產生垂直懸掛縮進( isort 文檔中的模式 3,類型為 output: 不過,這種多行模式僅適用於行長於 79 個字符的情況。 是否有一種模式會在同 ...
[英]sort recommit ignore python file even if asked to scan specifically
我有: 我執行: 我在日志中看到的: 我不明白為什么它說跳過? 我給了它直接路徑到 python 文件怎么可能沒有文件要檢查? ...
[英]Can Black be configured to ignore imports?
從現在開始,我將在我的所有 Python 項目中改用黑色。 到目前為止,我一直使用 autopep8 作為我的自動格式化程序和 isort 來對我的導入進行排序。 但是在使用 Black 時,我發現 Black 在格式化我的代碼的同時也完成了 isort 的工作。 雖然我不介意 Black 對我的 ...
[英]VSCode: how to config 'Organize imports' for Python (isort)
鏡像問題至 《 How to config VSCode's Organize Imports order? 》指的是一個.js項目我想配置 VSCode 如何調用isort ,這樣我就可以在調用Organize imports in a.py 文件時進行自定義。 特別是,VSCode 已經開始刪 ...
[英]How to specify directories to isort with config file?
如何僅使用配置文件指定要使用 isort 對哪些文件進行排序? 我希望能夠進行isort. 並讓它只拾取某些目標目錄。 我正在使用 pyproject.toml 並且我已經嘗試過 和 和 無濟於事 ...
[英]How to run isort via ALE in Vim?
我想通過ALE插件設置要在 Vim 中使用的isort 。 我已將此快捷方式添加到我的.vimrc : 但是,當我激活它時,什么也沒有發生。 我在全局和 virtualenv 中都安裝了isort 。 誰能給我一個提示如何調試/解決這個問題? ...
[英]Is there a way for isort to automatically detect firstparty vs thirdparty modules in a codebase with multiple standalone packages?
在project代碼庫中,一個名為plugins的文件夾中有多個獨立包,每個 package 都在自己的文件夾中,里面有一個setup.py文件,項目本身是一個 python package 有自己的setup.py文件。 我有兩個文件夾, project/project和plugins/mypl ...
[英]Make isort recognize imports from Django apps as first-party imports
我正在處理一個包含許多不同 Django 應用程序的項目。 我想在這個項目中使用isort ,但是來自 Django 應用程序的from myapp1.mymodule import myfunction ( from myapp1.mymodule import myfunction )被iso ...