Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e804b25

Browse files
committedJun 10, 2025·
Revert "[LintDiff] Skip readme.md files with no "input-file:" string (Azure#35174)"
This reverts commit fc12f4e.
1 parent 26a5525 commit e804b25

File tree

3 files changed

+1
-32
lines changed

3 files changed

+1
-32
lines changed
 

‎eng/tools/lint-diff/src/processChanges.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,9 @@ export async function buildState(
135135
// For readme files that have changed but there are no affected swaggers,
136136
// add them to the map with no tags
137137
for (const changedReadme of existingChangedFiles.filter(readme)) {
138-
const readmePath = resolve(rootPath, changedReadme);
139-
140-
// Skip readme.md files that don't have "input-file:" as autorest cannot
141-
// scan them.
142-
const readmeContent = await readFile(readmePath, { encoding: "utf-8" });
143-
if (!readmeContent.includes("input-file:")) {
144-
continue;
145-
}
146-
147138
const service = specModels.get(getService(changedReadme))!;
148139
const readmes = await service.getReadmes();
149-
const readmeObject = readmes.get(readmePath)!;
140+
const readmeObject = readmes.get(resolve(rootPath, changedReadme))!;
150141

151142
if (!changedFileAndTagsMap.has(changedReadme)) {
152143
changedFileAndTagsMap.set(changedReadme, {

‎eng/tools/lint-diff/test/fixtures/buildState/specification/no-input-file/readme.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎eng/tools/lint-diff/test/processChanges.test.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,4 @@ describe("buildState", () => {
249249
),
250250
).not.toThrow();
251251
});
252-
253-
test.skipIf(isWindows())("does not include readme files that has no input-file:", async () => {
254-
const actual = await buildState(
255-
["specification/no-input-file/readme.md"],
256-
"test/fixtures/buildState/",
257-
);
258-
259-
expect(actual).toEqual([new Map<string, ReadmeAffectedTags>(), []]);
260-
});
261252
});

0 commit comments

Comments
 (0)
Please sign in to comment.