diff options
| author | Nick Brassel <nick@tzarc.org> | 2023-01-19 12:05:29 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-19 01:05:29 +0000 |
| commit | 327f7ee9a74f1740106d46e65e909208a1372ad3 (patch) | |
| tree | 479d7f9c47454b72717cf10e0e4917979b214211 /lib/python/qmk/cli | |
| parent | 17c9388af5432f8e6d97828f6772eaf8031a786b (diff) | |
Fixup ChibiOS header inclusion search ordering. (#19623)
* Add STM32F446-Nucleo onekey.
* Fixup onekey build for F446, all keymaps.
* Fixup board inclusion search ordering.
Diffstat (limited to 'lib/python/qmk/cli')
| -rw-r--r-- | lib/python/qmk/cli/lint.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/python/qmk/cli/lint.py b/lib/python/qmk/cli/lint.py index c67809a697..897a6c4c0d 100644 --- a/lib/python/qmk/cli/lint.py +++ b/lib/python/qmk/cli/lint.py | |||
| @@ -12,6 +12,8 @@ from qmk.path import is_keyboard, keyboard | |||
| 12 | from qmk.git import git_get_ignored_files | 12 | from qmk.git import git_get_ignored_files |
| 13 | from qmk.c_parse import c_source_files | 13 | from qmk.c_parse import c_source_files |
| 14 | 14 | ||
| 15 | CHIBIOS_CONF_CHECKS = ['chconf.h', 'halconf.h', 'mcuconf.h', 'board.h'] | ||
| 16 | |||
| 15 | 17 | ||
| 16 | def _list_defaultish_keymaps(kb): | 18 | def _list_defaultish_keymaps(kb): |
| 17 | """Return default like keymaps for a given keyboard | 19 | """Return default like keymaps for a given keyboard |
| @@ -64,6 +66,15 @@ def _handle_json_errors(kb, info): | |||
| 64 | return ok | 66 | return ok |
| 65 | 67 | ||
| 66 | 68 | ||
| 69 | def _chibios_conf_includenext_check(target): | ||
| 70 | """Check the ChibiOS conf.h for the correct inclusion of the next conf.h | ||
| 71 | """ | ||
| 72 | for i, line in enumerate(target.open()): | ||
| 73 | if f'#include_next "{target.name}"' in line: | ||
| 74 | return f'Found `#include_next "{target.name}"` on line {i} of {target}, should be `#include_next <{target.name}>` (use angle brackets, not quotes)' | ||
| 75 | return None | ||
| 76 | |||
| 77 | |||
| 67 | def _rules_mk_assignment_only(kb): | 78 | def _rules_mk_assignment_only(kb): |
| 68 | """Check the keyboard-level rules.mk to ensure it only has assignments. | 79 | """Check the keyboard-level rules.mk to ensure it only has assignments. |
| 69 | """ | 80 | """ |
| @@ -121,6 +132,12 @@ def keymap_check(kb, km): | |||
| 121 | cli.log.error(f'{kb}/{km}: The file "{file}" does not have a license header!') | 132 | cli.log.error(f'{kb}/{km}: The file "{file}" does not have a license header!') |
| 122 | ok = False | 133 | ok = False |
| 123 | 134 | ||
| 135 | if file.name in CHIBIOS_CONF_CHECKS: | ||
| 136 | check_error = _chibios_conf_includenext_check(file) | ||
| 137 | if check_error is not None: | ||
| 138 | cli.log.error(f'{kb}/{km}: {check_error}') | ||
| 139 | ok = False | ||
| 140 | |||
| 124 | return ok | 141 | return ok |
| 125 | 142 | ||
| 126 | 143 | ||
| @@ -153,6 +170,12 @@ def keyboard_check(kb): | |||
| 153 | cli.log.error(f'{kb}: The file "{file}" does not have a license header!') | 170 | cli.log.error(f'{kb}: The file "{file}" does not have a license header!') |
| 154 | ok = False | 171 | ok = False |
| 155 | 172 | ||
| 173 | if file.name in CHIBIOS_CONF_CHECKS: | ||
| 174 | check_error = _chibios_conf_includenext_check(file) | ||
| 175 | if check_error is not None: | ||
| 176 | cli.log.error(f'{kb}: {check_error}') | ||
| 177 | ok = False | ||
| 178 | |||
| 156 | return ok | 179 | return ok |
| 157 | 180 | ||
| 158 | 181 | ||
