Browse Source

feat(metadata): Add YAML check/format npm scripts.

xmkb
Peter Johanson 3 years ago committed by Pete Johanson
parent
commit
c7e513634d
  1. 16
      .github/workflows/hardware-metadata-validation.yml
  2. 1
      app/.gitignore
  3. 3
      app/.prettierrc.js
  4. 36
      app/package-lock.json
  5. 23
      app/package.json

16
.github/workflows/hardware-metadata-validation.yml

@ -15,6 +15,17 @@ on: @@ -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: @@ -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
app/.gitignore vendored

@ -1 +1,2 @@ @@ -1 +1,2 @@
build/
node_modules/

3
app/.prettierrc.js

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
module.exports = {
endOfLine: "auto",
};

36
app/package-lock.json generated

@ -0,0 +1,36 @@ @@ -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
}
}
}

23
app/package.json

@ -0,0 +1,23 @@ @@ -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"
}
}
Loading…
Cancel
Save