Skip to content

Commit

Permalink
fixup! Add custom lint rule project.
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-signal committed May 5, 2020
1 parent 45254dc commit 0904e1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private LintFix quickFixIssueLog(@NotNull UCallExpression logCall) {
String methodName = logCall.getMethodName();
UExpression tag = arguments.get(0);

String fixSource = "org.whispersystems.libsignal.logging.Log.";
String fixSource = "org.thoughtcrime.securesms.logging.Log.";

switch (arguments.size()) {
case 2:
Expand Down
8 changes: 4 additions & 4 deletions lintchecks/src/test/java/org/signal/lint/LogDetectorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public void androidLogUsed_LogNotSignal_2_args() {
" Log.d(\"TAG\", \"msg\");\n" +
" ~~~~~~~~~~~~~~~~~~~\n" +
"1 errors, 0 warnings")
.expectFixDiffs("Fix for src/foo/Example.java line 5: Replace with org.whispersystems.libsignal.logging.Log.d(\"TAG\", \"msg\"):\n" +
.expectFixDiffs("Fix for src/foo/Example.java line 5: Replace with org.thoughtcrime.securesms.logging.Log.d(\"TAG\", \"msg\"):\n" +
"@@ -5 +5\n" +
"- Log.d(\"TAG\", \"msg\");\n" +
"+ org.whispersystems.libsignal.logging.Log.d(\"TAG\", \"msg\");");
"+ org.thoughtcrime.securesms.logging.Log.d(\"TAG\", \"msg\");");
}

@Test
Expand All @@ -49,9 +49,9 @@ public void androidLogUsed_LogNotSignal_3_args() {
" Log.w(\"TAG\", \"msg\", new Exception());\n" +
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
"1 errors, 0 warnings")
.expectFixDiffs("Fix for src/foo/Example.java line 5: Replace with org.whispersystems.libsignal.logging.Log.w(\"TAG\", \"msg\", new Exception()):\n" +
.expectFixDiffs("Fix for src/foo/Example.java line 5: Replace with org.thoughtcrime.securesms.logging.Log.w(\"TAG\", \"msg\", new Exception()):\n" +
"@@ -5 +5\n" +
"- Log.w(\"TAG\", \"msg\", new Exception());\n" +
"+ org.whispersystems.libsignal.logging.Log.w(\"TAG\", \"msg\", new Exception());");
"+ org.thoughtcrime.securesms.logging.Log.w(\"TAG\", \"msg\", new Exception());");
}
}

0 comments on commit 0904e1f

Please sign in to comment.