From 55d35ef2ff3780a1c51f21a55de595719313cc39 Mon Sep 17 00:00:00 2001 From: Tom Carman Date: Tue, 7 May 2024 19:19:28 +0100 Subject: [PATCH 1/2] fix: change sarif file path to be relative --- src/commands/metalint/run.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/commands/metalint/run.ts b/src/commands/metalint/run.ts index 756dd3a..af72c4b 100644 --- a/src/commands/metalint/run.ts +++ b/src/commands/metalint/run.ts @@ -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'; @@ -65,7 +65,8 @@ export default class MetalintRun extends SfCommand { 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); From dbed975c2593c0a88f2e76ed56309abe2d0049ce Mon Sep 17 00:00:00 2001 From: Tom Carman Date: Tue, 7 May 2024 19:55:48 +0100 Subject: [PATCH 2/2] chore: add a sf demo project --- .../default/objects/Log__e/Log__e.object-meta.xml | 8 ++++++++ .../objects/Log__e/fields/Data__c.field-meta.xml | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 force-app/main/default/objects/Log__e/Log__e.object-meta.xml create mode 100644 force-app/main/default/objects/Log__e/fields/Data__c.field-meta.xml diff --git a/force-app/main/default/objects/Log__e/Log__e.object-meta.xml b/force-app/main/default/objects/Log__e/Log__e.object-meta.xml new file mode 100644 index 0000000..c2b6ce9 --- /dev/null +++ b/force-app/main/default/objects/Log__e/Log__e.object-meta.xml @@ -0,0 +1,8 @@ + + + Deployed + HighVolume + + Logs + PublishImmediately + diff --git a/force-app/main/default/objects/Log__e/fields/Data__c.field-meta.xml b/force-app/main/default/objects/Log__e/fields/Data__c.field-meta.xml new file mode 100644 index 0000000..ab0851f --- /dev/null +++ b/force-app/main/default/objects/Log__e/fields/Data__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Data__c + false + false + false + false + + 131072 + LongTextArea + 3 +