Skip to content

Fix: CLI failes when running with non exsisting file #150

Merged
andrzej-janczak merged 1 commit intomainfrom
fix/pluto-1439
Jun 16, 2025
Merged

Fix: CLI failes when running with non exsisting file #150
andrzej-janczak merged 1 commit intomainfrom
fix/pluto-1439

Conversation

@andrzej-janczak
Copy link
Copy Markdown
Contributor

@andrzej-janczak andrzej-janczak commented Jun 13, 2025

Now:

go run cli-v2.go  analyze --format sarif ./what
❌ Error: cannot find file or directory './what'
exit status 1

Before:

2025/06/11 14:28:37 Failed to merge SARIF outputs: failed to parse SARIF file /tmp/codacy-analysis-2905944739/semgrep.sarif: unexpected end of JSON input
  • this PR include it tests update

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Jun 13, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.01% 22.22%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (f97be27) 5419 1420 26.20%
Head commit (745a45e) 5443 (+24) 1426 (+6) 26.20% (-0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#150) 27 6 22.22%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@andrzej-janczak andrzej-janczak enabled auto-merge (squash) June 13, 2025 10:16
- Added a new function to validate the existence of provided paths before analysis.
- Updated the analyze command's short and long descriptions for clarity.
- Improved error logging when failing to retrieve the current working directory.
- Enhanced SARIF output merging to handle empty files and invalid JSON more gracefully
@andrzej-janczak andrzej-janczak merged commit 579b70a into main Jun 16, 2025
10 checks passed
@andrzej-janczak andrzej-janczak deleted the fix/pluto-1439 branch June 16, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants