Skip to content

Commit

Permalink
fix: change sarif file path to be relative
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcarman committed May 7, 2024
1 parent 9ed8e23 commit 55d35ef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/commands/metalint/run.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { pathToFileURL } from 'node:url';
// import * as path from 'node:path';
// import { pathToFileURL } from 'node:url';
import * as path from 'node:path';
import { SarifBuilder, SarifRunBuilder, SarifResultBuilder, SarifRuleBuilder } from 'node-sarif-builder';
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
Expand Down Expand Up @@ -65,7 +65,8 @@ export default class MetalintRun extends SfCommand<MetalintRunResult> {
ruleId: 'fields-must-have-descriptions',
messageText: 'Field is missing a description',
level: 'error' as const,
fileUri: pathToFileURL(field).toString(),
// fileUri: pathToFileURL(field).toString(),
fileUri: path.relative(process.cwd(), field).replace(/\\/g, '/'),
};

sarifResultBuilder.initSimple(sarifResultInit);
Expand Down

0 comments on commit 55d35ef

Please sign in to comment.