erplibre/script/maintenance
Mathieu Benoit f2ba74fd59 [IMP] format : un formateur par contexte, ruff pour l'outillage
« make format » donnait isort et black à tout fichier Python : la cible py37,
plus petit dénominateur commun de six dépôts d'addons, imposait son style au
code de ce dépôt. Le contexte décide désormais — les modules Odoo gardent isort
et black, le reste passe par ruff, réglé dans .ruff.toml, comme la norme OCA
depuis qu'elle a quitté black. Les dépôts rapatriés sous script/ en sont
écartés, chemin nommé compris. La cible y reste py310 : dès 3.14 ruff écrit
« except A, B: » sans parenthèses, que le python3 des hooks ne sait pas lire.
Vérifié : un fichier reçoit deux normes selon son chemin, et aucun dépôt
rapatrié n'est touché.

--- EN ---

"make format" gave isort and black to every Python file: the py37 target,
lowest common denominator of six addons repositories, imposed its style on this
repository's code. Context now decides — Odoo modules keep isort and black,
everything else goes through ruff, set in .ruff.toml, as the OCA standard does
since it left black. The repositories checked out under script/ are excluded, a
named path included. The target stays py310 there: from 3.14 on, ruff writes
"except A, B:" unparenthesised, which the python3 of the hooks cannot read.
Checked: one file gets two standards by its path, and no checked-out
repository is touched.

Assisted-by: Claude Opus 5
2026-09-24 13:30:08 -04:00
..
autopep8.sh [IMP] refactoring .venv.erplibre 2025-10-31 01:34:26 -04:00
black.sh [IMP] format : un formateur par contexte, ruff pour l'outillage 2026-09-24 13:30:08 -04:00
format.sh [IMP] support multi version odoo on same workspace 2025-10-31 01:36:26 -04:00
format_bash.sh [IMP] support multi version odoo on same workspace 2025-10-31 01:36:26 -04:00
format_file_to_commit.py [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
format_python.sh [IMP] format : un formateur par contexte, ruff pour l'outillage 2026-09-24 13:30:08 -04:00
prettier.sh [FIX] script python: missing color log error 2024-05-03 23:13:59 -04:00
prettier_xml.sh [FIX] script python: missing color log error 2024-05-03 23:13:59 -04:00