Use a consistent format for `bal scan` errors and warnings
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by reading the bal scan command and the named ScanUtils.getTargetPath, saveToDirectory, and accumulateWorkspaceReports paths, then inspect how suppression diagnostics are formatted. Reproduce the listed error and warning cases and trace where each message or exception is emitted. Done means scan errors, warnings, source diagnostics, and I/O failures follow the formats and behavior described in the suggested improvement.
Written by the indexing model from the issue text.
Description
Current Limitation
Error and warning messages have no common format:
- There is no command prefix. Some messages come from the launcher as
ballerina: ...followed byRun 'bal help' for usage.instead ofbal scan --help. - Messages vary in case and punctuation, and some contain several sentences. Examples:
The specified path is not a valid Ballerina project: nope. Please provide ...,package is empty. please add at least one .bal file,invalid kind ... Expected one of .... - The fix is folded into the message, not given separately.
- Some failures surface Java exceptions:
ScanUtils.getTargetPathwrapsIOExceptioninIllegalCharsetNameException.saveToDirectorythrowsIllegalStateException.accumulateWorkspaceReportsthrowsUncheckedIOException.
- Suppression diagnostics print as
ERROR [file:(l:c,l:c)] message, which editors and CI annotators cannot parse.
Suggested Improvement
- Print errors as
bal scan: error: <message>, with an optional indented suggestion line, for exampleProvide the package root: bal scan /path/to/pkg. - Messages are one line, start in lowercase, have no trailing period, and name the path, flag or value involved.
- Print warnings as
bal scan: warning: <message>. - Print source diagnostics as
<path>:<line>:<col>: <severity>: <message>. - Catch I/O failures and report them as errors, never as stack traces or exception class names.
Version
0.13.0-SNAPSHOT
- Dominant language
- Java
- Stars
- 15
- Forks
- 12
- Avg merge
- 11h 57m
- Merged PRs (30d)
- 14
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ballerina-platform/static-code-analysis-tool
-
Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ballerina-platform/static-code-analysis-tool#140 ·
Maintainers usually reply within 1 day
-
Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ballerina-platform/static-code-analysis-tool#139 ·
Maintainers usually reply within 1 day
-
Type/Improvement
Difficulty 3/5 1-2 days Newbie friendliness 62/100
ballerina-platform/static-code-analysis-tool#138 ·
Maintainers usually reply within 1 day
-
Type/Improvement
Difficulty 3/5 1-2 days Newbie friendliness 63/100
ballerina-platform/static-code-analysis-tool#137 ·
Maintainers usually reply within 1 day
-
Type/Improvement
Difficulty 3/5 1-2 days Newbie friendliness 62/100
ballerina-platform/static-code-analysis-tool#136 ·
Maintainers usually reply within 1 day
All issues in ballerina-platform/static-code-analysis-tool
Similar issues
-
Good First Issue
Difficulty 1/5 Under an hour Newbie friendliness 75/100
hiero-ledger/hiero-sdk-java#3025 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
DogFooding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
OpenAEV-Platform/openaev#8768 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
federicoiosue/Omni-Notes#1039 ·
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
micronaut-projects/micronaut-core#14179 ·
Maintainers usually reply within 1 day