A small library of lint rules that can be applied to an Android project.
The following lint rules are provided:
-
PrintStackTrace (Error) - Detects the use of printStackTrace method calls.
Example.java:17: Do not use printStackTrace [PrintStackTrace] } catch (Exception e) { e.printStackTrace(); ~~~~~~~~~~~~~~~ }
To disable a lint rule, in your modules's build.gradle
, add a disable
statement for the rule.
lintOptions {
...
disable 'PrintStackTrace'
...
}
implementation 'biz.davidpearson.android:custom-lint-rules:0.3.0'
- The
.aar
production is based on the LinkedIn Engineering blog post Writing Custom Lint Checks with Gradle - The lint rule code and tests are inspired by the lint rules in Jake Wharton's Timber project.
Copyright 2017-2020 David Pearson
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.