Skip to content

Commit

Permalink
Fix target definition (#64)
Browse files Browse the repository at this point in the history
Fixes #63
  • Loading branch information
mitchspano authored Aug 13, 2023
1 parent 3df86f5 commit 6628b7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export async function performStaticCodeAnalysisOnFilesInDiff(
scannerFlags: ScannerFlags
) {
console.log(
"Performing static code analysis on all of the files in the difference..."
"Performing static code analysis on all of the relevant files..."
);
try {
const findings = await scanFiles(scannerFlags);
Expand Down Expand Up @@ -129,7 +129,7 @@ function filterFindingsToDiffScope(
reporter: Reporter
) {
console.log(
"Filtering the findings to just the lines which are part of the pull request..."
"Filtering the findings to just the lines which are part of the context..."
);

for (let finding of findings) {
Expand Down Expand Up @@ -219,12 +219,13 @@ async function main() {
console.log("Beginning sfdx-scan-pull-request run...");
const { pullRequest, scannerFlags, reporter, inputs } = initialSetup();
validateContext(pullRequest, inputs.target);

const filePathToChangedLines = await getDiffInPullRequest(
pullRequest?.base?.ref,
pullRequest?.head?.ref,
pullRequest?.base?.repo?.clone_url
);
let filePathToChangedLines = inputs.target
? new Map<string, Set<number>>()
: await getDiffInPullRequest(
pullRequest?.base?.ref,
pullRequest?.head?.ref,
pullRequest?.base?.repo?.clone_url
);

const filesToScan = getFilesToScan(filePathToChangedLines, inputs.target);
if (filesToScan.length === 0) {
Expand Down

0 comments on commit 6628b7d

Please sign in to comment.