tools/boards.txt.py rewrite by mcspr · Pull Request #8595 · esp8266/Arduino (original) (raw)

Previously mentioned in #6690 and matrix back in april
Quite a lot of lines, though. (diff review might be useless :)
Drafting, to avoid the branch getting stale.

Updated CLI interface, using argparse and sub-commands

> tools/boards.txt.py --help
...
> tools/boards.txt.py generate --help # old *gen functions, either --all or specific --<name>
...
> tools/boards.txt test # new 'doctest' based verifier for our own code
> tools/boards.txt names # old boardslist
# Available board names. Delete or comment out the boards you do not need:
...

Things of note

CI adds test before running any generators. This is both useful for verifying the internal logic for regions and layouts, plus formatting could be verified as well. Could be replaced with unittest if the 'comments are tests' approach seems too foreign :) Plus, we should probably have even more of those; I definitely missed some.

Some side effects, since we are changing a lot of things anyway