Fix MD034/no-bare-urls lint errors by converting bare URLs to proper
markdown link syntax [text](url). Link text is derived from the URL:
- GitHub repos use the repository name
- ArduPilot ecosystem URLs use descriptive names
- Vendor/product URLs use the vendor name
- Documentation sites include "documentation" suffix
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
global: fix MD007 unordered list indentation in markdown files
Normalize unordered list indentation to use 2-space multiples:
- Top-level list items start at column 0
- Nested list items use 2 additional spaces per level
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
global: fix MD009 trailing whitespace in markdown files
Remove trailing whitespace from all affected markdown files.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
global: fix MD010 hard tabs in markdown files
Replace hard tab characters with 4 spaces.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
global: fix MD012 multiple consecutive blank lines in markdown
Collapse multiple consecutive blank lines to single blank lines
across all markdown files (excluding vendored code).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
global: fix MD007 list indentation base level in markdown
Shift list indentation left by 2 spaces so top-level list items
start at column 0 instead of column 2.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD022 blank lines around headings in markdown
Ensure headings are surrounded by blank lines as required by
markdownlint MD022 rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD032 blank lines around lists in markdown
Ensure lists are surrounded by blank lines as required by
markdownlint MD032 rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD031 blank lines around code blocks in markdown
Ensure fenced code blocks are surrounded by blank lines as required
by markdownlint MD031 rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD047 files should end with single newline
Ensure all markdown files end with exactly one newline character
as required by markdownlint MD047 rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD023 headings must start at beginning of line
Remove leading whitespace from heading lines as required by
markdownlint MD023 rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD007 remaining list indentation in markdown
Fix unordered list indentation to use correct spacing as required
by markdownlint MD007 rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD030 spaces after list markers in markdown
Reduce multiple spaces after list markers to single space as
required by markdownlint MD030 rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD022 blank lines around setext headings
Ensure setext-style headings (underlined with === or ---) are
surrounded by blank lines as required by markdownlint MD022 rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD018 missing space after hash in headings
Add space after hash marks in atx-style headings as required by
markdownlint MD018 rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD019 multiple spaces after hash in headings
Reduce multiple spaces after hash marks to single space in
atx-style headings as required by markdownlint MD019 rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD012 multiple consecutive blank lines in markdown
Remove multiple consecutive blank lines and ensure files end with
exactly one newline as required by markdownlint MD012 rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD023 headings with leading whitespace
Remove leading whitespace from setext-style heading text lines
as required by markdownlint MD023 rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD022 blank line after heading in markdown
Add missing blank line after heading as required by markdownlint
MD022 rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD009 trailing non-breaking space in markdown
Remove trailing non-breaking space (U+00A0) as required by
markdownlint MD009 rule.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tools/scripts: fix MD012 remaining multiple blank lines in markdown
Remove leading blank lines and whitespace-only lines that create
multiple consecutive blank lines.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a step to test_branch_conventions.yml to build and test any boards
that are modified in a PR using test_new_boards.py.
Also fix git references to use github.event.pull_request.base.ref
instead of github.base_ref for consistency, add container and
submodule support to the workflow.
Reveal the true cause for most of our colcon failures by no longer
redirecting the exception to `/dev/null`.
The test harness tolerates failures in our processes during shutdown
(which cause most of the printed error messages), but can throw internal
errors which cause `AssertionError: When running test <x> launch service
failed when finishing, return code '1'` in `finalize_launch_service`.
By default it just discards the actual exception with the helpful
message `Error: [launch]: Caught exception in launch (see debug for
traceback)`. Edit the source code to default debug mode to on so the
exception is printed and we can see what is actually going on. Sadly,
there appears to be no more sensible approach.
This shows that we need
https://github.com/ros2/launch/commit/801d7cda05a87a74d59cb3d4752307d001956584
which we should get if we update the Docker images.
There are still some failures due to startup errors on ArduPilot's side
but this cause appears to be the majority of them. And if there are
other sources of this exception the traceback will enable us to see
them.
[`Tools/ros2/ardupilot_dds_tests/test/test_pep257.py`](https://github.com/ArduPilot/ardupilot/blob/master/Tools/ros2/ardupilot_dds_tests/test/test_pep257.py) ensures [PEP 257 – Docstring Conventions](https://peps.python.org/pep-0257) compliance for all Python files in Tools/ros2.
Partially addresses the concern at
* https://github.com/ArduPilot/ardupilot/pull/30426#issuecomment-2994329025
Here are two solutions (we should pick just one) that replicate this functionality in pre-commit.
1. Use `flake8` plus `flake8-docstring` to run the 'ament-style` rules on Tools/ros2.
2. Run [`ament_pep257`](https://pypi.org/project/ament-lint-pep257) on Tools/ros2.
Quick equivalent commands:
```
uv tool run --with=flake8-docstrings flake8 --select=D \
--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404 Tools/ros2
uv tool run --from=ament-lint-pep257 ament_pep257 Tools/ros2 > /dev/null
```
How was this tested?
1. Run both equivalent commands to ensure no errors.
2. `pre-commit run flake8 --all-files` to ensure no errors.
3. `pre-commit run ament-pep257 --all-files` to ensure no errors.
Edit `Tools/ros2/ardupilot_sitl/src/ardupilot_sitl/utilities.py` and add a leading or trailing space inside the docstring, and save the file.
Rerun the four commands to ensure that each raises a `D210: No whitespaces allowed surrounding docstring text` error.
github is making the variable substition, leading there to there being a closing quroate on the echo line within the existing single quotes. That's bad when shell is parsing that line; it starts to try to run it as a shell script
This was just supposed to make life easier for the next person seeing what was in this object - so we can just remove it.
Somewhat unbelievably, the commit hash having certain values can
actually change the size of the binary. GCC might be able to identify
another string as a suffix of the commit hash string and therefore be
able to omit that other string and replace it with a pointer into the
middle of the commit hash string. This has been observed of the cause of
spurious size differences in CI.
The `no_version` binaries with constant commit hashes are the ones that
are compared for features and contents, and they are compatible with the
size compare script, so let's compare their sizes instead.
This does beg the question as to why we re-compile with these
environment variables instead of starting with them (perhaps ccache?),
nor why we manually set them instead of using the relevant `waf` flag,
but those can be future improvements.
`*.elf` files don't exist (the built ELF files instead have no
extension). `*.apj` and `*.abin` files both have git hashes inside so
they will always differ. Correctly ignore them and compare only ELF and
`*.bin`.
Also rename the action as it compares the full file, not a checksum.
Avoids always claiming that MatekH743-bdshot has a difference.
This GitHub Action fails occasionally, so let's upgrade its flake8 to see if that provides more stable runs.
https://pypi.org/project/flake8 --> v7.2.0
flake8: Both the local issue and the flake8 issue it points to were closed 4 or 5 years ago, so let's test with current flake8.
This GitHub Action fails occasionally, so let's upgrade its MAVProxy to see if that provides more stable runs.
* https://pypi.org/project/MAVProxy --> v1.8.71
Given the changes in MAVProxy, should we upgrade?
* https://github.com/ArduPilot/MAVProxy/releases
---
`pip install -U` can be quite opaque to readers because `pip install` currently has six `--u*` options.
% `python3 -m pip install --help | grep "\-\-u"`
```
--user Install to the Python user install directory for
-U, --upgrade Upgrade all specified packages to the newest
--upgrade-strategy <upgrade_strategy>
--use-pep517 Use PEP 517 for building source distributions
--use-feature <feature> Enable new functionality, that may be backward
--use-deprecated <feature> Enable deprecated functionality, that will be
```