Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Use a consistent format for `bal scan` errors and warnings

Open
#134 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
cli

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

Type/Improvement
Current Limitation

Error and warning messages have no common format:

  • There is no command prefix. Some messages come from the launcher as ballerina: ... followed by Run 'bal help' for usage. instead of bal 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.getTargetPath wraps IOException in IllegalCharsetNameException.
    • saveToDirectory throws IllegalStateException.
    • accumulateWorkspaceReports throws UncheckedIOException.
  • 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 example Provide 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ballerina-platform/static-code-analysis-tool

All issues in ballerina-platform/static-code-analysis-tool

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.