Skip to content

Commit

Permalink
feat(metadata): Add YAML check/format npm scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
petejohanson committed Sep 11, 2021
1 parent 9001116 commit 7e0034c
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/hardware-metadata-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ on:
- "app/scripts/west_commands/metadata.py"

jobs:
check-metadata-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- uses: bahmutov/npm-install@v1
with:
working-directory: app
- name: Prettier Check
run: npm run prettier:check
working-directory: app
validate-metadata:
runs-on: ubuntu-latest
container:
Expand All @@ -30,6 +41,5 @@ jobs:
- name: Export Zephyr CMake package (west zephyr-export)
run: west zephyr-export
- name: Validate Hardware Metadata
run: |
cd app
west metadata check
working-directory: app
run: west metadata check
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build/
node_modules/
3 changes: 3 additions & 0 deletions app/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
endOfLine: "auto",
};
36 changes: 36 additions & 0 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "zmkfirmware",
"version": "1.0.0",
"description": "ZMK Firmware tooling",
"private": "true",
"scripts": {
"prettier:check": "prettier --check boards/**/*.yml",
"prettier:format": "prettier --write boards/**/*.yml"
},
"repository": {
"type": "git",
"url": "git+https://github.com/zmkfirware/zmk.git"
},
"author": "ZMK Contributors",
"license": "MIT",
"bugs": {
"url": "https://github.com/zmkfirware/zmk/issues"
},
"homepage": "https://zmk.dev/",
"devDependencies": {
"prettier": "^2.4.0"
}
}

0 comments on commit 7e0034c

Please sign in to comment.