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
-
kind/bug Ubuntu 24
难度 2/5 1-3 小时 新手友好度 72/100
kubernetes-sigs/kubespray#13532 ·
-
Needs Design Priority: Wishlist
难度 2/5 1-3 小时 新手友好度 84/100
elementary/flatpak-platform#253 ·
-
tagbot-manual
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 62/100
-
难度 2/5 1-3 小时 新手友好度 70/100