Run semantic validation only on specification files (#14)
This commit is contained in:
Родитель
3da86fe62e
Коммит
f5e82e30b1
|
@ -1,5 +1,9 @@
|
|||
# Changelog
|
||||
|
||||
## 0.4.1
|
||||
|
||||
- Fix semantic validation should only run on specification files
|
||||
|
||||
## 0.4.0
|
||||
|
||||
- fix exec function
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@azure/rest-api-specs-scripts",
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.1",
|
||||
"description": "Scripts for the Azure RestAPI specification repository 'azure-rest-api-specs'.",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.js",
|
||||
|
|
|
@ -7,12 +7,13 @@ import * as oav from 'oav'
|
|||
|
||||
export async function main() {
|
||||
const pr = await devOps.createPullRequestProperties(cli.defaultConfig())
|
||||
const swaggersToProcess = await utils.getFilesChangedInPR(pr);
|
||||
// Useful when debugging a test for a particular swagger.
|
||||
// Just update the regex. That will return an array of filtered items.
|
||||
// swaggersToProcess = swaggersToProcess.filter(function(item) {
|
||||
// return (item.match(/.*Microsoft.Logic.*2016-06-01.*/ig) !== null);
|
||||
// });
|
||||
let swaggersToProcess = await utils.getFilesChangedInPR(pr);
|
||||
swaggersToProcess = swaggersToProcess.filter(function (item) {
|
||||
// Useful when debugging a test for a particular swagger.
|
||||
// Just update the regex. That will return an array of filtered items.
|
||||
// return (item.match(/.*Microsoft.Logic.*2016-06-01.*/ig) !== null);
|
||||
return (item.match(/.*specification\/.*/ig) !== null);
|
||||
});
|
||||
for (const swagger of swaggersToProcess) {
|
||||
try {
|
||||
await oav.validateSpec(swagger, {consoleLogLevel: 'error', pretty: true});
|
||||
|
|
Загрузка…
Ссылка в новой задаче