Add an `--exclude-tests` option to bal scan
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
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
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-testsflag tobal scan, and an equivalentScan.tomlsetting, 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
- 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 5/5 Over a week Newbie friendliness 35/100
ballerina-platform/static-code-analysis-tool#142 ·
Maintainers usually reply within 1 day
-
Type/Improvement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
ballerina-platform/static-code-analysis-tool#141 ·
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
All issues in ballerina-platform/static-code-analysis-tool
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
quarkiverse/quarkus-google-cloud-services#1188 ·
Maintainers usually reply within 1 day
-
Component: Frontend Component: Web Component Type: Maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
it-at-m/refarch-templates#1944 ·
Maintainers usually reply within 2 days
-
priority: p2 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
googleapis/java-genai#1372 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
-
GeoSeries scale and skew tests fail with pytest 9.2.0Possibly taken @jiayuasu claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day