Skip to content

Commit 32c94a7

Browse files
authored
Formalise installing spectral/redocly and running them against example/scratch specs (zircote#1722)
1 parent 28f1b87 commit 32c94a7

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ docs/.vitepress/cache/
88
docs/.vitepress/dist/
99
docs/node_modules/
1010
docs/package-lock.json
11+
node_modules/
12+
package-lock.json
1113
scratch/
1214
vendor/
1315
.idea/

composer.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,12 @@
8888
"lint": "Test codestyle",
8989
"test": "Run all PHP, codestyle and rector tests",
9090
"analyse": "Run static analysis (phpstan/psalm)",
91-
"spectral-examples": "Run spectral lint over all .yaml files in the Examples folder",
91+
"spectral-examples": "Run spectral lint over all .yaml files in the docs/examples folder",
9292
"spectral-scratch": "Run spectral lint over all .yaml files in the tests/Fixtures/Scratch folder",
9393
"spectral": "Run all spectral tests",
94+
"redocly-examples": "Run redocly lint over all .yaml files in the docs/examples folder",
95+
"redocly-scratch": "Run redocly lint over all .yaml files in the tests/Fixtures/Scratch folder",
96+
"redocly": "Run all redocly tests",
9497
"docs:gen": "Rebuild reference documentation",
9598
"docs:dev": "Run dev server for local development of gh-pages",
9699
"docs:build": "Re-build static gh-pages"
@@ -110,12 +113,18 @@
110113
"export XDEBUG_MODE=off && phpstan analyse --memory-limit=2G",
111114
"export XDEBUG_MODE=off && psalm --threads=1"
112115
],
113-
"spectral-examples": "for ff in `find Examples -name '*.yaml'`; do spectral lint $ff; done",
114-
"spectral-scratch": "for ff in `find tests/Fixtures/Scratch -name '*.yaml'`; do spectral lint $ff; done",
116+
"spectral-examples": "for ff in `find docs/examples -name '*.yaml'`; do npm run spectral lint $ff; done",
117+
"spectral-scratch": "for ff in `find tests/Fixtures/Scratch -name '*.yaml'`; do npm run spectral lint $ff; done",
115118
"spectral": [
116119
"@spectral-examples",
117120
"@spectral-scratch"
118121
],
122+
"redocly-examples": "for ff in `find docs/examples -name '*.yaml'`; do npm run redocly lint $ff; done",
123+
"redocly-scratch": "for ff in `find tests/Fixtures/Scratch -name '*.yaml'`; do npm run redocly lint $ff; done",
124+
"redocly": [
125+
"@redocly-examples",
126+
"@redocly-scratch"
127+
],
119128
"docs:gen": [
120129
"@php tools/refgen.php",
121130
"@php tools/procgen.php",

package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "swagger-php-tools",
3+
"version": "1.0.0",
4+
"license": "Apache-2.0",
5+
"scripts": {
6+
"spectral": "spectral",
7+
"redocly": "redocly"
8+
},
9+
"devDependencies": {
10+
"@stoplight/spectral-cli": "^6",
11+
"@redocly/cli": "^1.30"
12+
}
13+
}

0 commit comments

Comments
 (0)