realpython / realpython/materials

Ruff lints the whole repo

オープン 初心者向け
#729 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Jupyter Notebook
スター
5.2k
フォーク
5.3k
平均マージ
4日 10時間
マージ済み PR(30日)
10

説明

ℹ️ 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:

  1. 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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

.github/workflows/linters.yaml から始めて、既存の Check code style ステップを確認し、その後 pull request を開いて、現在 Ruff がチェックしているファイルを検証します。ワークフローを更新して、Ruff の format コマンドと lint コマンドが変更された Python ファイルだけを受け取るようにし、Python ファイルが変更されていない場合にチェックが問題なくスキップされることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
github-actions, python
領域
ci-cd, tooling
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
68/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。