Files
ardupilot/pyproject.toml
T
Peter BarkerandClaude Opus 4.8 4be67e3e25 Tools: enforce one allowed subsystem per commit in CI
Add check_commit_subsystems() to check_branch_conventions.py, which uses
the allowed_subsystems library to verify, for every commit on the branch,
that:

  - the declared subsystem prefix is an allowed subsystem (a libraries/
    directory, a directory the commit creates, or a curated extra), and
  - every file changed in the commit belongs to that subsystem.

When a file does not belong to the declared subsystem the error lists the
subsystem(s) it could be part of; when the prefix itself is unknown the
error suggests the closest allowed name ("did you mean ...?").  Revert and
fixup! commits are skipped (handled by the existing checks).  This runs in
the existing test_branch_conventions.yml workflow; no CI configuration
change is required.

The generic git helpers get_added_paths_for_commit() and
created_library_dirs() live on BuildScriptBase so other build scripts can
reuse them.  Register allowed_subsystems as a known-first-party module in
pyproject.toml so the new import sorts correctly under ruff/isort.

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

102 lines
2.1 KiB
TOML

[tool.ruff]
target-version = "py39" # Default Python of the oldest Standard Support Debian + Ubuntu LTS.
# This should be kept in sync with `min_ver` in the files `./wscript` and `./waf`.
line-length = 127
lint.select = [
"BLE001", # flake8-blind-except
"E", # pycodestyle
"F", # Pyflakes
]
lint.ignore = [
"E402", # module-import-not-at-top-of-file
]
lint.extend-select = [
"I", # isort
"TID", # flake8-tidy-imports
]
lint.flake8-tidy-imports.ban-relative-imports = "all"
lint.per-file-ignores."Tools/autotest/autotest.py" = ["I001"] # unsorted-imports
per-file-target-version."Tools/scripts/mavlink_parse.py" = "py310"
[tool.ruff.lint.isort]
force-single-line = true
lines-between-types = 1
known-first-party = [
"allowed_subsystems",
"annotate_params",
"antennatracker",
"arducopter",
"balancebot",
"blimp",
"board_list",
"build_binaries_history",
"build_script_base",
"controller",
"dma_resolver",
"emit",
"emit_md",
"examples",
"extract_param_defaults",
"gen_stable",
"generate_manifest",
"hal_common",
"helicopter",
"jsonemit",
"mdemit",
"param",
"param_check",
"pysim",
"quadplane",
"rover",
"sailboat",
"vehicle_test_suite",
"waflib",
]
[tool.isort]
profile = "black"
skip = ["./modules/", "./build/"]
force_single_line = true
lines_between_types = 1
known_first_party = [
"annotate_params",
"antennatracker",
"arducopter",
"blimp",
"board_list",
"build_binaries_history",
"build_script_base",
"controller",
"dma_resolver",
"emit",
"emit_md",
"extract_param_defaults",
"gen_stable",
"generate_manifest",
"hal_common",
"helicopter",
"jsonemit",
"mdemit",
"param",
"param_check",
"pysim",
"quadplane",
"rover",
"sailboat",
"vehicle_test_suite",
"waflib",
]
[tool.black]
line-length = 120
skip-string-normalization = true
[tool.mypy]
ignore_missing_imports = true
exclude = [
'modules/',
'build/',
'cmake-build-debug/',
'/setup\.py$'
]