Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1081)

Unified Diff: tools/android/checkstyle/chromium-style-5.0.xml

Issue 1993243002: ⛲ Add presubmit to prevent SharedPreferences misuse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add suppression for ContextUtils. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/android/checkstyle/chromium-style-5.0.xml
diff --git a/tools/android/checkstyle/chromium-style-5.0.xml b/tools/android/checkstyle/chromium-style-5.0.xml
index 6557f61768f1840ffd905abc54c91ce39cc244cf..700f449ad37be984af58b41b8d58536844f83b4e 100644
--- a/tools/android/checkstyle/chromium-style-5.0.xml
+++ b/tools/android/checkstyle/chromium-style-5.0.xml
@@ -7,6 +7,9 @@
<module name="Checker">
<property name="severity" value="warning"/>
<property name="charset" value="UTF-8"/>
+ <module name="SuppressionFilter">
+ <property name="file" value="tools/android/checkstyle/suppressions.xml"/>
+ </module>
<module name="TreeWalker">
<module name="AvoidStarImport">
<property name="severity" value="error"/>
@@ -208,6 +211,13 @@
<property name="ignoreComments" value="true"/>
<property name="message" value="Avoid android.app.AlertDialog; if possible, use android.support.v7.app.AlertDialog instead, which has a Material look on all devices. (Some parts of the codebase can’t depend on the support library, in which case android.app.AlertDialog is the only option)"/>
</module>
+ <module name="RegexpSinglelineJava">
+ <property name="id" value="SharedPreferencesCheck"/>
+ <property name="severity" value="error"/>
+ <property name="format" value="getDefaultSharedPreferences"/>
+ <property name="ignoreComments" value="true"/>
+ <property name="message" value="Use ContextUtils.getAppSharedPreferences() instead to access app-wide SharedPreferences."/>
+ </module>
</module>
<!-- Non-TreeWalker modules -->

Powered by Google App Engine
This is Rietveld 408576698