Skip to content
This repository was archived by the owner on Jan 3, 2024. It is now read-only.

specs with just formatting changes are not linted #10

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure/rest-api-specs-scripts",
"version": "0.3.9",
"version": "0.4.0",
"description": "Scripts for the Azure RestAPI specification repository 'azure-rest-api-specs'.",
"types": "dist/index.d.ts",
"main": "dist/index.js",
Expand Down Expand Up @@ -29,12 +29,13 @@
"@types/js-yaml": "^3.12.1",
"@types/node": "^11.13.6",
"@types/request": "^2.48.1",
"@types/jsonpath": "^0.2.0",
"typescript": "^3.4.4"
},
"dependencies": {
"@octokit/rest": "^16.25.0",
"@azure/avocado": "^0.4.1",
"@azure/avocado": "^0.4.8",
"@azure/oad": "^0.6.3",
"@octokit/rest": "^16.25.0",
"@ts-common/string-map": "^0.3.0",
"fs-extra": "^7.0.1",
"glob": "^7.1.3",
Expand Down
5 changes: 3 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export const getConfigFilesChangedInPR = async (pr: devOps.PullRequestProperties
console.log(filesChanged);

// traverse up to readme.md files
const configFiles = new Set();
const configFiles = new Set<string>();
for (let fileChanged of filesChanged) {
while (fileChanged.startsWith("specification")) {
if (fileChanged.toLowerCase().endsWith("readme.md") && fs.existsSync(fileChanged)) {
Expand Down Expand Up @@ -273,7 +273,8 @@ export const getFilesChangedInPR = async (pr: devOps.PullRequestProperties | und
let result = getSwaggers();
if (pr !== undefined) {
try {
let filesChanged = (await pr.diff()).map(file => file.path)
let filesChanged = await pr.structuralDiff().toArray()

console.log('>>>>> Files changed in this PR are as follows:')
console.log(filesChanged);
let swaggerFilesInPR = filesChanged.filter(function (item: string) {
Expand Down