Fix ruff lint findings deferred from copier template adoption

オープン
#214 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
tooling

調査の方向性

Start with [tool.ruff.lint] in pyproject.toml, then run ruff check . to see the current findings. Apply the listed safe fixes and review the manual findings in the named source and test files, checking behavior for B905, B006, B026, and E721. Done when only the permanent N and F401/F403/F405 ignores remain, ruff check . passes, and the test suite is green.

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

説明

Adopting python-copier-template (PR to follow) brings in the template's ruff lint config, but to keep that PR free of code churn it adds temporary ignores. This issue tracks removing them.

Assessment (template ruff config against current master)

407 findings in total:

Group Count Plan
F401 / F403 / F405 (star re-exports) 182 Keep ignored permanently, as under flake8: the public API is built from from x import *
N8xx / N999 (pep8-naming) 126 Keep ignored permanently: public API uses camelCase (aOut, longIn, SetDeviceName, ...)
Auto-fixable (I001 import sorting, UP015/UP004/UP034/UP010/UP041/UP006) 55 Mechanical ruff check --fix, ~190 changed lines across 26 files
Manual ~44 See below
Manual findings
  • SLF001 private-member access (~22 in softioc/): autosave.py, builder.py, cothread_dispatcher.py, device_core.py, pythonSoftIoc.py, softioc.py. Mostly intentional intra-package access; decide per site between # noqa: SLF001, a per-file ignore, or a small API change.
  • UP031 %-formatting (16): device_core.py, fields.py, tests.
  • B905 zip() without strict=: builder.py:120, device_core.py:76-77, tests/test_record_values.py:389. Pick strict=True only where lengths must match.
  • B006 mutable default argument: softioc.py:346.
  • B026 star-arg after keyword: device.py:328,331.
  • E721 type comparison: builder.py:209.
  • B007 unused loop variable: tests/test_records.py:248.
  • C4 (C408/C416/C402): one each.

(Counts from master at 4cb7ce4; findings in _version_git.py drop out if it is replaced by setuptools_scm.)

Done when

  • The temporary ignores (I001, UP, SLF001, B, C4, E721) are removed from [tool.ruff.lint] in pyproject.toml, leaving only the permanent N and F401/F403/F405 ignores.
  • ruff check . passes and the test suite is green.
  • Suggested split: one commit for ruff check --fix (safe fixes only), then separate commits for the manual groups, so behavioural ones (B905, B006, B026, E721) are easy to review.
主要言語
Python
スター
47
フォーク
15
平均マージ
1日 23時間
マージ済み PR(30日)
3

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

DiamondLightSource/pythonSoftIOC のほかの issue

DiamondLightSource/pythonSoftIOC の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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