Report a [[platform]] entry without a name in Scan.toml

Open Beginner friendly
#217 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
tooling

Research direction

Start from the Scan.toml parsing of the [[platform]] table and the code added by #215 that already reports a non-string name or path at its position; mirror that path for the missing/empty name case, including the source position. Reproduce first with the nmae typo from the issue and run bal scan --platforms=sonarqube, then a plain bal scan, to see both silent outcomes. Done means an entry without a usable name is reported with its position instead of being skipped, and the existing #215 tests still pass.

Written by the indexing model from the issue text.

Description

Area/Configuration Type/Improvement
Area

Configuration

Description

A [[platform]] entry in Scan.toml with no name, or an empty one, is skipped without a message, although the docs say both name and path are required. With a typo such as nmae = "sonarqube", bal scan --platforms=sonarqube fails with "platform 'sonarqube' is not available; add its plugin to the [[platform]] table of Scan.toml", which points the user at an entry that already exists.

Raised in the review of #215 (comment) and left out of the 0.14.0 / 0.11.2 release-readiness fixes. #215 already reports a non-string name or path as an error at its position; a missing or empty name is the remaining silent case.

Steps to Reproduce
  1. In a package, add this Scan.toml:

    [[platform]]
    nmae = "sonarqube"
    path = "plugin.jar"
    
  2. Run bal scan --platforms=sonarqube.

Expected Behavior

The entry without a name is reported with its position. Whether it is an error (exit 1) or a warning is to be decided.

Actual Output

bal scan: error: platform 'sonarqube' is not available; add its plugin to the [[platform]] table of Scan.toml. A plain bal scan ignores the entry silently.

Scan Tool Version

0.14.0 (with #215)

Dominant language
Java
Stars
15
Forks
12
Avg merge
2d 8h
Merged PRs (30d)
29

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.