-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check that each supported board is mentioned in README.md
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#! /usr/bin/env python3 | ||
|
||
import os | ||
import sys | ||
import config | ||
import config.user_input.console | ||
from build_all_examples import run_program | ||
|
||
from config.boards import list_of_boards | ||
|
||
script_dir = os.path.dirname(__file__) | ||
ADL_root_dir = os.path.abspath(os.path.join(script_dir, "..")) | ||
top_readme_file = os.path.join(ADL_root_dir, "README.md") | ||
|
||
undocumented = [] | ||
|
||
error = \ | ||
"""Next boards were not mentioned in the top README.md file! | ||
Please, append each of them to the table in the Board List section. | ||
""" | ||
|
||
with open(top_readme_file, 'r', encoding='utf-8') as file: | ||
lines = [line for line in file] | ||
|
||
# No error on Custom_Board: | ||
lines.append("[Custom_Board]") | ||
|
||
for board in list_of_boards(): | ||
text = f"[{board}]" | ||
found = [line for line in lines if text in line] | ||
if not found: | ||
undocumented.append(board) | ||
|
||
if undocumented: | ||
print(error) | ||
print(undocumented) | ||
sys.exit(1) |