Ruff lints the whole repo
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 68/100
研究方向
從 .github/workflows/linters.yaml 開始,檢查現有的 Check code style 步驟,然後開啟一個 pull request,以確認 Ruff 目前檢查哪些檔案。更新工作流程,使 Ruff 的格式化與 lint 指令只接收已修改的 Python 檔案,並確認在沒有 Python 檔案變更時檢查會正常略過。
由索引模型根據 Issue 內容生成。
描述
ℹ️ Please note that the best way to get support for Real Python courses & articles is to join one of our weekly Office Hours calls or in the RP Community Slack.
You can report issues and problems here, but we typically won't be able to provide 1:1 support outside the channels listed above.
Describe the bug
Currently, Ruff lints all the files in the repo, which can be inefficient.
To Reproduce
Steps to reproduce the behavior:
- Open a PR and take a look at the Ruff check details.
Expected behavior
Lint only the modified Python files.
Additional context
Proposed update to file .github/workflows/linters.yaml
- name: Check code style
run: |
. venv/bin/activate
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
git fetch origin ${{ github.base_ref }}
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.sha }} -- '*.py')
else
CHANGED_FILES=$(git diff --name-only HEAD^ -- '*.py')
fi
if [ -n "$CHANGED_FILES" ]; then
python -m ruff format --check $CHANGED_FILES
python -m ruff check $CHANGED_FILES
fi
- 主要語言
- Jupyter Notebook
- 星號
- 5.2k
- 分支
- 5.3k
- 平均合併
- 4 天 10 小時
- 30 天內合併 PR
- 10
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
realpython/materials 的其他 Issue
-
п 未關閉
難度 5/5 一週以上 新手友好度 1/100
realpython/materials#763 ·
-
難度 1/5 1 小時以內 新手友好度 55/100
realpython/materials#738 ·
-
難度 1/5 1 小時以內 新手友好度 45/100
realpython/materials#737 ·
-
проект2 未關閉
難度 5/5 一週以上 新手友好度 15/100
realpython/materials#725 ·
-
難度 3/5 1-2 天 新手友好度 15/100
realpython/materials#721 ·
查看 realpython/materials 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 84/100
copse-dev/agent-pane#2953 ·
-
難度 2/5 1-3 小時 新手友好度 90/100
simonw/sqlite-utils#872 ·
-
難度 1/5 1 小時以內 新手友好度 84/100
-
難度 2/5 1-3 小時 新手友好度 84/100
danielmiessler/LifeOS#2215 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
sympozium-ai/sympozium#627 ·