Commit Graph
3 Commits
Author SHA1 Message Date
Henry WurzburgandClaude Sonnet 5 d6d783a9cf Tools: prefer hwdef over HAL name when splitting/relabelling commits
libraries/<HAL>/hwdef/... changes were being tagged with the HAL library
name (e.g. AP_HAL_ChibiOS) since it was listed before hwdef as a
candidate subsystem, and an already-declared HAL name was treated as
valid and left alone. Make hwdef -- the deepest directory in the path --
the canonical tag in both cases, since it applies uniformly across
every HAL rather than being tied to one library.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-29 16:45:27 +10:00
Randy Mackay 657d2bf006 Tools: allowed_subsystems.py fix to support AC_PosControl 2026-07-28 06:47:45 +09:00
Peter BarkerandClaude Opus 4.8 f490ad3400 Tools: add allowed_subsystems definitive subsystem list
Add Tools/scripts/allowed_subsystems.py, the single source of truth for
which subsystem prefixes are permitted in commit messages and which
subsystem(s) a changed file may belong to.

A subsystem is allowed if it is a directory under libraries/ (computed
dynamically), a libraries/ directory created by the commit itself, or one
of the curated non-library extras (vehicles, Tools, autotest, waf, hwdef,
modules, a few common class prefixes, ...).  subsystems_for_path() returns
an ordered list of candidate subsystems for a path, since some files are
conventionally committed under more than one name (an autotest under
autotest or Tools; a ChibiOS hwdef file under hwdef or AP_HAL_ChibiOS).
suggest_subsystem() offers the closest allowed name for a mistyped prefix.

The functionality is exposed as an AllowedSubsystems object; running the
file directly prints every valid subsystem name.  It is consumed by
check_branch_conventions.py, the git-subsystems-split tool and the sample
pre-commit hook.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 08:08:08 +10:00