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

Add an `--exclude-tests` option to bal scan

Open
#110 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
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
devtools

Research direction

Start by reading the bal scan option handling and Scan.toml configuration, then trace where package and workspace sources are collected and findings are passed to reporters and platform plugins. Add the exclusion at the point before those consumers receive results, covering package tests, module tests, and workspace members; done means both the CLI flag and config setting produce consistent findings across reporters and plugins.

Written by the indexing model from the issue text.

Description

Type/Improvement
Current Limitation

bal scan always analyzes the test sources of a package (tests/ and modules/*/tests/), and there is no option to leave them out. Findings in test code are usually not actionable, such as hard-coded credentials in test fixtures, and they inflate the counts that CI gates rely on.

The only workaround is to drop the findings after the scan by post-processing the SARIF report, which is what scan-ballerina does with its exclude-tests input.

Suggested Improvement
  • Add a --exclude-tests flag to bal scan, and an equivalent Scan.toml setting, that skips the test sources of the package and of each module (and of each member of a workspace).
  • Apply it before the results are handed to the reporters and the platform plugins, so that the SARIF/HTML/JSON reports and every platform get the same set of findings.
Version

Scan tool 0.12.0

Dominant language
Java
Stars
15
Forks
12
Avg merge
12h 17m
Merged PRs (30d)
13

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.