Ruff lints the whole repo
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start with .github/workflows/linters.yaml and inspect the existing Check code style step, then open a pull request to verify which files Ruff currently checks. Update the workflow so the Ruff format and lint commands receive only modified Python files, and confirm the check skips cleanly when no Python files changed.
Written by the indexing model from the issue text.
Description
ℹ️ 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
- Dominant language
- Jupyter Notebook
- Stars
- 5.2k
- Forks
- 5.3k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 10
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from realpython/materials
-
п Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
realpython/materials#763 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
realpython/materials#738 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
realpython/materials#737 ·
-
проект2 Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
realpython/materials#725 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 15/100
realpython/materials#721 ·
All issues in realpython/materials
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
repo:raw-data
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
hotosm/raw-data-api#316 · 1 comment ·
-
agentic-workflows cascade-suspected
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
willow
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
openedx/openedx-authz#460 ·