summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Johanson <peter@peterjohanson.com>2021-09-10 16:33:39 +0000
committerPete Johanson <peter@peterjohanson.com>2021-09-11 00:50:36 -0400
commitc7e513634d2425dbdf21ccd693872301f80cad65 (patch)
tree2f1a367034540e77bdd66192197ff536aefc46dc
parent39eb80562d5174e42c8a184e0261674888ac5fd7 (diff)
feat(metadata): Add YAML check/format npm scripts.
-rw-r--r--.github/workflows/hardware-metadata-validation.yml16
-rw-r--r--app/.gitignore1
-rw-r--r--app/.prettierrc.js3
-rw-r--r--app/package-lock.json36
-rw-r--r--app/package.json23
5 files changed, 76 insertions, 3 deletions
diff --git a/.github/workflows/hardware-metadata-validation.yml b/.github/workflows/hardware-metadata-validation.yml
index 3972ed8..1318b4b 100644
--- a/.github/workflows/hardware-metadata-validation.yml
+++ b/.github/workflows/hardware-metadata-validation.yml
@@ -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:
@@ -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
diff --git a/app/.gitignore b/app/.gitignore
index 567609b..3e2e84b 100644
--- a/app/.gitignore
+++ b/app/.gitignore
@@ -1 +1,2 @@
build/
+node_modules/
diff --git a/app/.prettierrc.js b/app/.prettierrc.js
new file mode 100644
index 0000000..806328d
--- /dev/null
+++ b/app/.prettierrc.js
@@ -0,0 +1,3 @@
+module.exports = {
+ endOfLine: "auto",
+};
diff --git a/app/package-lock.json b/app/package-lock.json
new file mode 100644
index 0000000..afd730a
--- /dev/null
+++ b/app/package-lock.json
@@ -0,0 +1,36 @@
+{
+ "name": "zmkfirmware",
+ "version": "1.0.0",
+ "lockfileVersion": 2,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "zmkfirmware",
+ "version": "1.0.0",
+ "license": "MIT",
+ "devDependencies": {
+ "prettier": "^2.4.0"
+ }
+ },
+ "node_modules/prettier": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.0.tgz",
+ "integrity": "sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ==",
+ "dev": true,
+ "bin": {
+ "prettier": "bin-prettier.js"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ }
+ },
+ "dependencies": {
+ "prettier": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.0.tgz",
+ "integrity": "sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ==",
+ "dev": true
+ }
+ }
+}
diff --git a/app/package.json b/app/package.json
new file mode 100644
index 0000000..e75d969
--- /dev/null
+++ b/app/package.json
@@ -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"
+ }
+} \ No newline at end of file