Fix ruff lint findings deferred from copier template adoption

Abierto
#214 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Refactorización
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
tooling

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Python
Estrellas
47
Forks
15
Merge medio
1 d 23 h
PR fusionados (30 d)
3

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DiamondLightSource/pythonSoftIOC

Todos los issues de DiamondLightSource/pythonSoftIOC

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.