[go: nahoru, domu]

Add style check for some inclusive language in Java

This CL adds an additional check in the chromium style list to warn
for the use of the terms: dummy, sanity and blind. There are inclusive
alternatives to these terms, see go/dgc-word-list


AX-Relnotes: N/A
Bug: N/A
Change-Id: I13b0a62785cbed5e3cc5e48a22809990b557a1d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4582731
Commit-Queue: Mark Schillaci <mschillaci@google.com>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1152541}
diff --git a/tools/android/checkstyle/chromium-style-5.0.xml b/tools/android/checkstyle/chromium-style-5.0.xml
index 674bc83..90d9327 100644
--- a/tools/android/checkstyle/chromium-style-5.0.xml
+++ b/tools/android/checkstyle/chromium-style-5.0.xml
@@ -208,5 +208,11 @@
       <property name="format" value="ThemeOverlay\_BrowserUI\_Fullscreen"/>
       <property name="message" value="Fullscreen AlertDialogs must use FullscreenAlertDialog and fullscreen Dialogs must use ChromeDialog. Not doing this will break automotive devices. (This check is triggered by the presence of ThemeOverlay_BrowserUI_Fullscreen and does not know if you are already using the correct class)"/>
     </module>
+    <module name="RegexpSinglelineJava">
+      <property name="id" value="InclusiveLanguageCheck"/>
+      <property name="severity" value="warning"/>
+      <property name="format" value="([dD]ummy)|([sS]anity)|([bB]lind)"/>
+      <property name="message" value="&#xA;&#xA;Please use inclusive language where possible.&#xA;&#xA;Instead of 'dummy', use a term such as placeholder or empty (e.g. PlaceholderImpl, not DummyImpl).&#xA;Instead of 'sanity', use a term such as 'confidence' (e.g. confidence check, not sanity check).&#xA;Instead of 'blind', use a term such as unaware (e.g. being unaware of, not being blind to. unconfirmed change, not blind change).&#xA;&#xA;For more info see: go/dgc-word-list&#xA;"/>
+    </module>
   </module>
 </module>