From 87c9f6b2a03297502fde8ed755301d6633972952 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 3 Apr 2019 12:04:24 +0200 Subject: [PATCH] Improve lint configuration --- matrix-sdk-android/build.gradle | 4 +++ matrix-sdk-android/lint.xml | 33 +++++++++++++++++++ .../res/layout/adapter_item_icon_and_text.xml | 13 ++++---- vector/build.gradle | 30 +---------------- vector/lint.xml | 33 +++++++++++++++++++ 5 files changed, 78 insertions(+), 35 deletions(-) create mode 100644 matrix-sdk-android/lint.xml create mode 100644 vector/lint.xml diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 78c8eaabd8..e3b9ba732a 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -58,6 +58,10 @@ android { adbOptions { installOptions "-g" } + + lintOptions { + lintConfig file("lint.xml") + } } static def gitRevision() { diff --git a/matrix-sdk-android/lint.xml b/matrix-sdk-android/lint.xml new file mode 100644 index 0000000000..3e4078d7d9 --- /dev/null +++ b/matrix-sdk-android/lint.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/matrix-sdk-android/src/main/res/layout/adapter_item_icon_and_text.xml b/matrix-sdk-android/src/main/res/layout/adapter_item_icon_and_text.xml index 4227dd9be6..03de7154d8 100644 --- a/matrix-sdk-android/src/main/res/layout/adapter_item_icon_and_text.xml +++ b/matrix-sdk-android/src/main/res/layout/adapter_item_icon_and_text.xml @@ -1,20 +1,21 @@ + android:paddingBottom="10dp"> + android:src="@drawable/matrix_user" /> + android:textColor="@android:color/white" + tools:text="A text here" /> \ No newline at end of file diff --git a/vector/build.gradle b/vector/build.gradle index 3957a8a0ff..be66c06da4 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -107,35 +107,7 @@ android { } lintOptions { - warning 'MissingTranslation' - - // Treat some warnings as errors - // Resources - error 'TypographyEllipsis' - warning 'ImpliedQuantity' - - // UX - error 'ButtonOrder' - - // Layout - error 'UnknownIdInLayout' - error 'StringFormatCount' - error 'HardcodedText' - error 'SpUsage' - error 'ObsoleteLayoutParam' - error 'InefficientWeight' - error 'DisableBaselineAlignment' - error 'ScrollViewSize' - - // RTL - error 'RtlEnabled' - error 'RtlHardcoded' - error 'RtlSymmetry' - - // Code - error 'SetTextI18n' - error 'ViewConstructor' - error 'UseValueOf' + lintConfig file("lint.xml") } compileOptions { diff --git a/vector/lint.xml b/vector/lint.xml new file mode 100644 index 0000000000..3e4078d7d9 --- /dev/null +++ b/vector/lint.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +