From b3f7085b69dd0aa60172a6c550216da5b7cf72dd Mon Sep 17 00:00:00 2001 From: Daniil Sapa Date: Fri, 22 Nov 2024 01:54:24 +0200 Subject: [PATCH] Fix 404s in rule description links (#130) --- .changeset/thirty-turtles-search.md | 5 +++++ packages/steiger/src/app.ts | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/thirty-turtles-search.md diff --git a/.changeset/thirty-turtles-search.md b/.changeset/thirty-turtles-search.md new file mode 100644 index 0000000..37ba73f --- /dev/null +++ b/.changeset/thirty-turtles-search.md @@ -0,0 +1,5 @@ +--- +'steiger': patch +--- + +Fix 404s in rule description links diff --git a/packages/steiger/src/app.ts b/packages/steiger/src/app.ts index dccbad6..c44a824 100644 --- a/packages/steiger/src/app.ts +++ b/packages/steiger/src/app.ts @@ -9,8 +9,12 @@ import { runRule } from './features/run-rule' import { removeGlobalIgnoreFromVfs } from './features/remove-global-ignores-from-vfs' import { calculateFinalSeverities } from './features/calculate-diagnostic-severities' +// TODO: make this part of a plugin function getRuleDescriptionUrl(ruleName: string) { - return new URL(`https://github.com/feature-sliced/steiger/tree/master/packages/steiger-plugin-fsd/src/${ruleName}`) + const withoutNamespace = ruleName.split('/')[1] + return new URL( + `https://github.com/feature-sliced/steiger/tree/master/packages/steiger-plugin-fsd/src/${withoutNamespace}`, + ) } async function runRules({ vfs, rules }: { vfs: Folder; rules: Array }) {