diff options
author | Tor Norbye <tnorbye@google.com> | 2012-02-21 12:25:09 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-02-21 12:31:31 -0800 |
commit | 105dc49ddd885c07b520dd343aa326c306d2c3de (patch) | |
tree | 4462bc33d2d460d3e3e8d7c229677c1c86f49591 /lint/cli | |
parent | 556b907792f0658a6c3f676e23469b83175e3431 (diff) | |
download | sdk-105dc49ddd885c07b520dd343aa326c306d2c3de.zip sdk-105dc49ddd885c07b520dd343aa326c306d2c3de.tar.gz sdk-105dc49ddd885c07b520dd343aa326c306d2c3de.tar.bz2 |
Fix lint library project configuration handling
A lint.xml file in a library project should be able to suppress lint
errors in that project. This changeset fixes a couple of bugs which
prevented this from working: In Eclipse, the configuration was cached,
which meant a single lint run through multiple projects would just use
the configuration of the first encountered project. And from the
command line driver, the code to handle --check handling would
override configuration severity in one scenario.
Change-Id: Ib08e2b14582ab53e5ab89244738d1bd77839610e
Diffstat (limited to 'lint/cli')
-rw-r--r-- | lint/cli/src/com/android/tools/lint/Main.java | 2 | ||||
-rw-r--r-- | lint/cli/src/com/android/tools/lint/TextReporter.java | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lint/cli/src/com/android/tools/lint/Main.java b/lint/cli/src/com/android/tools/lint/Main.java index 1484a1d..607b882 100644 --- a/lint/cli/src/com/android/tools/lint/Main.java +++ b/lint/cli/src/com/android/tools/lint/Main.java @@ -1023,7 +1023,7 @@ public class Main extends LintClient { // Detectors shouldn't be returning ignore as a default severity, // but in case they do, force it up to warning here to ensure that // it's run - if (severity == Severity.IGNORE) { + if (severity == Severity.IGNORE && severity == issue.getDefaultSeverity()) { return Severity.WARNING; } else { return severity; diff --git a/lint/cli/src/com/android/tools/lint/TextReporter.java b/lint/cli/src/com/android/tools/lint/TextReporter.java index 4d08c0b..47202d1 100644 --- a/lint/cli/src/com/android/tools/lint/TextReporter.java +++ b/lint/cli/src/com/android/tools/lint/TextReporter.java @@ -38,8 +38,10 @@ class TextReporter extends Reporter { StringBuilder output = new StringBuilder(issues.size() * 200); if (issues.size() == 0) { + mWriter.write('\n'); mWriter.write("No issues found."); mWriter.write('\n'); + mWriter.flush(); } else { for (Warning warning : issues) { int startLength = output.length(); |