Skip to content

Commit

Permalink
[tsv] Call getSuppressions()
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeharder committed May 17, 2024
1 parent 827d43c commit 7ee3312
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions eng/tools/typespec-validation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"dependencies": {
"globby": "^14.0.1",
"simple-git": "^3.24.0",
"suppressions": "file:../suppressions",
"yaml": "^2.4.2"
},
"devDependencies": {
Expand Down
8 changes: 8 additions & 0 deletions eng/tools/typespec-validation/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { FormatRule } from "./rules/format.js";
import { LinterRulesetRule } from "./rules/linter-ruleset.js";
import { NpmPrefixRule } from "./rules/npm-prefix.js";
import { TsvRunnerHost } from "./tsv-runner-host.js";
import { getSuppressions, Suppression } from "suppressions";

export async function main() {
const host = new TsvRunnerHost();
Expand All @@ -31,6 +32,13 @@ export async function main() {
}
console.log("Running TypeSpecValidation on folder: ", absolutePath);

const suppressions: Suppression[] = await getSuppressions("TypeSpecValidation", absolutePath);
if (suppressions && suppressions[0]) {
// Use reason from first matching suppression and ignore rest
console.log(` Suppressed: ${suppressions[0].reason}`);
return;
}

const rules = [
new FolderStructureRule(),
new NpmPrefixRule(),
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7ee3312

Please sign in to comment.