Skip to content

Commit 1d85aae

Browse files
blicklycopybara-github
authored andcommitted
Align the diagnostics in CheckMissingRequires
Make the MISSING_REQUIRE diagnostics default to warning, and the MISSING_REQUIRE_TYPE diagnositcs default to disabled. This is a step toward unifying behavior of this pass inside goog.provide files and outside, and may also help with replacing the CheckMissingAndExtraRequires pass, which doesn't have an equivalent of the MISSING_REQUIRE_TYPE diagnostics. PiperOrigin-RevId: 325847664
1 parent 2b29a98 commit 1d85aae

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/com/google/javascript/jscomp/CheckMissingRequires.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ public class CheckMissingRequires extends AbstractModuleCallback implements Comp
4242
+ "use the alias instead.");
4343

4444
public static final DiagnosticType MISSING_REQUIRE_TYPE =
45-
DiagnosticType.warning(
45+
DiagnosticType.disabled(
4646
"JSC_MISSING_REQUIRE_TYPE",
4747
"''{0}'' references a fully qualified namespace, which is disallowed by the style"
4848
+ " guide.\nPlease add a goog.requireType, assign or destructure it into an alias, "
4949
+ "and use the alias instead.");
5050

5151
public static final DiagnosticType MISSING_REQUIRE_IN_PROVIDES_FILE =
52-
DiagnosticType.disabled(
52+
DiagnosticType.warning(
5353
"JSC_MISSING_REQUIRE_IN_PROVIDES_FILE",
5454
"''{0}'' references a namespace which was not required by this file.\n"
5555
+ "Please add a goog.require.");

test/com/google/javascript/jscomp/CheckMissingRequiresTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ protected CompilerPass getProcessor(Compiler compiler) {
3939
@Override
4040
protected CompilerOptions getOptions() {
4141
CompilerOptions options = super.getOptions();
42+
options.setWarningLevel(DiagnosticGroups.STRICTER_MISSING_REQUIRE_TYPE, CheckLevel.WARNING);
4243
options.setWarningLevel(
4344
DiagnosticGroups.STRICTER_MISSING_REQUIRE_IN_PROVIDES_FILE, CheckLevel.WARNING);
4445
options.setWarningLevel(

0 commit comments

Comments
 (0)