Merge pull request #947 from jepler/check-features-at-build-time

Check features at build time
This commit is contained in:
Melissa LeBlanc-Williams 2022-05-10 09:04:55 -06:00 committed by GitHub
commit 43c90b3458
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 3 deletions

View file

@ -30,6 +30,10 @@ jobs:
- uses: actions/checkout@v1
with:
submodules: true
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: 3.x
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
@ -38,6 +42,9 @@ jobs:
run: |
gem install bundler:1.17.3
bundle install --full-index
pip install python-frontmatter
- name: Check feature names
run: python3 check-features.py
- name: Build site with jekyll
run: |
bundle exec jekyll build -d build

View file

@ -12,7 +12,7 @@ features:
- STEMMA QT/QWIIC
- USB-C
- Breadboard-Friendly
- Wi-Fi (two version, onboard antenna or uFL connector)
- Wi-Fi
---
What has your favorite Espressif WiFi microcontroller, comes with [our favorite connector - the STEMMA QT](http://adafruit.com/stemma), a chainable I2C port, and has lots of Flash and RAM memory for your next IoT project? What will make your next IoT project flyyyyy? What a cutie pie! Or is it... a **QT Py**? This diminutive dev board comes with one of our new favorite lil chips, the **ESP32-S2**!

View file

@ -10,7 +10,7 @@ download_instructions:
date_added: 2021-2-14
features:
- Wi-Fi
- Bluetooth/BLE
- Bluetooth/BTLE
- STEMMA QT/QWIIC
- Arduino Shield Compatible
- USB-C

View file

@ -8,7 +8,6 @@ board_url: "https://www.raspberrypi.com/products/raspberry-pi-zero/"
board_image: "raspberry_pi_zero.jpg"
date_added: 2022-2-14
features:
- 40-pin GPIO
---
**NOTE**: Not all features are supported in CircuitPython.

18
check-features.py Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/python3
from pathlib import Path
import frontmatter
with open('template.md', "rt") as f:
metadata, content = frontmatter.parse(f.read())
acceptable_features = set(metadata['features'])
failed = False
for filename in Path('_board').glob("*.md"):
with open(filename, "rt") as f:
metadata, content = frontmatter.parse(f.read())
features = metadata.get('features') or ()
for feature in sorted(set(features) - acceptable_features):
print(f"{filename}:0: Non-standard feature: {feature}")
failed = True
raise SystemExit(failed)