From 0382648590a20cd145d11ed6b375f79410f1d567 Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Fri, 16 Jun 2023 13:59:32 -0700 Subject: [PATCH] Add a method that returns all warning-level checks PiperOrigin-RevId: 540993905 --- .../errorprone/scanner/BuiltInCheckerSuppliers.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/main/java/com/google/errorprone/scanner/BuiltInCheckerSuppliers.java b/core/src/main/java/com/google/errorprone/scanner/BuiltInCheckerSuppliers.java index dac68a26247..c65fb6a3628 100644 --- a/core/src/main/java/com/google/errorprone/scanner/BuiltInCheckerSuppliers.java +++ b/core/src/main/java/com/google/errorprone/scanner/BuiltInCheckerSuppliers.java @@ -617,6 +617,14 @@ public static ScannerSupplier errorChecks() { return allChecks().filter(Predicates.in(ENABLED_ERRORS)); } + /** + * Returns a {@link ScannerSupplier} with the {@link BugChecker}s that are in the ENABLED_WARNINGS + * list. + */ + public static ScannerSupplier warningChecks() { + return allChecks().filter(Predicates.in(ENABLED_WARNINGS)); + } + /** A list of all checks with severity ERROR that are on by default. */ public static final ImmutableSet ENABLED_ERRORS = getSuppliers(