Skip to content

Commit a074c55

Browse files
committed
Beheer: verplaats linter configuratie
Hiermee bereiken we twee doelen: 1. De naamgeving is niet gelimiteerd aan Spectral, omdat ook andere tooling deze configuratie kan gebruiken 2. Omdat het nu in `media/` staat, publiceren we deze configuratie nu ook op een aparte plek. Hierdoor is het mogelijk om voor andere tooling om automatisch het bestand te pakken, in plaats van die uit een bijlage van het standaarddocument te halen Uiteindelijk zorgen we ervoor dat tooling zoals developer.overheid.nl nu naar deze configuratie kunnen verwijzen en ook automatisch up-to-date zijn met wijzigingen die we aanbrengen.
1 parent b01451a commit a074c55

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

examples/run-spectral-linter.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ if ! [ -f "$1" ]; then
77
exit 1
88
fi
99

10-
spectral lint -r $CURRENT_DIRECTORY/../linter/spectral.yml $1
10+
spectral lint -r $CURRENT_DIRECTORY/../media/linter.yml $1

js/config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async function initializeHighlightJSYaml() {
2424

2525
let spectralConfiguration;
2626
async function fetchSpectralConfiguration() {
27-
const spectralResponse = await fetch('linter/spectral.yml');
27+
const spectralResponse = await fetch('media/linter.yml');
2828
spectralConfiguration = await spectralResponse.text();
2929
}
3030

linter/run-linter-tests.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const readFile = utils.promisify(fs.readFile);
1111
const readdir = utils.promisify(fs.readdir);
1212
const writeFile = utils.promisify(fs.writeFile);
1313

14-
const SPECTRAL_RULESET_LOCATION = path.join(__dirname, 'spectral.yml');
14+
const SPECTRAL_RULESET_LOCATION = path.join(__dirname, '..', 'media', 'linter.yml');
1515

1616
function computeTestCommand(apiLocation) {
1717
return `spectral lint -r ${SPECTRAL_RULESET_LOCATION} ${apiLocation}/openapi.json || true`
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#
1414
# ```
1515
# npm install -g @stoplight/spectral-cli
16-
# curl -L https://static.developer.overheid.nl/adr/ruleset.yaml > .spectral.yml
17-
# spectral lint -r .spectral.yml $OAS_URL_OR_FILE
16+
# curl -L https://static.developer.overheid.nl/adr/ruleset.yaml > .linter.yml
17+
# spectral lint -r .linter.yml $OAS_URL_OR_FILE
1818
# ```
1919

2020
extends: spectral:oas

0 commit comments

Comments
 (0)