-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
help wantedinternal-issue-createdAn internal Google issue has been created to track this GitHub issueAn internal Google issue has been created to track this GitHub issue
Description
I would like to propose an option that could make the compiler fail if at least one warning is encountered, regardless of errors and exit with a non-zero exit code.
This could be a simple flags such as --fail-on-warnings
or a more sophisticated setting like --error-level
that could introduce more granular control, i.e. still exit with 0 if compilation failed with errors.
Use case for this is either a purist approach when no warnings are tolerated or code quality control CI job that verifies new code with --checks-only
.
cosinekitty and kaovilai
Metadata
Metadata
Assignees
Labels
help wantedinternal-issue-createdAn internal Google issue has been created to track this GitHub issueAn internal Google issue has been created to track this GitHub issue
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
brad4d commentedon Aug 13, 2019
I believe this option already exists. The magic words are
--jscomp_error=*
to say "treat all diagnostic groups as errors".l1bbcsg commentedon Aug 14, 2019
I don't think this is quite the right option. It seems to change behaviour much more elevating a lot of other warnings that are not normally reported to errors.
This example:
Produces a warning:
But with
--jscomp_error=*
there are now two errors:google-closure-compiler a.js --checks_only --warning_level verbose --jscomp_error=*
On a large code base I encountered many more new errors and compiler actually crashed with
java.lang.RuntimeException: INTERNAL COMPILER ERROR
.brad4d commentedon Aug 14, 2019
Created internal issue
http://b/139437890
brad4d commentedon Aug 14, 2019
This is looking harder to do than I'd wish, but I think the gist is that the proposed option would need to trigger doing
options.addWarningsGuard(new StrictWarningsGuard())
when the compiler options are created inCommandLineRunner#createOptions()
.