Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getting-started section #28

Merged
merged 2 commits into from
Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

As a codebase increases in size and complexity, static analysis checks become a very useful tool in ensuring high quality, bug free code. This repository provides a collection of lint checks based on Android Lint that guard against common pitfalls and bugs that you might encounter in day to day development.

See [project website](https://uber.github.io/lint-checks) for more details.
See [project website](https://uber.github.io/getting-started) for more details.

## Download

Expand Down
61 changes: 61 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Getting Started

To add lint-checks to your project, simply add the relevant artifact in your app/module's `build.gradle` file.
```groovy
dependencies {
lintChecks "com.uber.lint-checks:lint-checks:x.y.z
}
```

## Lint Modules

Here's a list of lint modules that this project provides:

#### Java/Kotlin Lint Checks
```groovy
lintChecks "com.uber.lint-checks:lint-checks:x.y.z
```
#### Android Lint Checks
```groovy
lintChecks "com.uber.lint-checks:lint-checks-android:x.y.z
```
#### RxJava Lint Checks
```groovy
lintChecks "com.uber.lint-checks:lint-checks-rxjava:x.y.z
```
The list of individual lint checks in each module can be found [here](https://uber.github.io/lint-checks/CHECKS/)

## Integrating In An Existing Codebase

Integrating new tooling into an existing codebase can be a pain. Luckily, Android Lint makes it easy to start using lint by providing a [baseline](https://developer.android.com/studio/write/lint#snapshot). A baseline lets you take a snapshot of your project and then uses the snapshot as a baseline for future inspection runs.

To create a baseline add the following in your `build.gradle` file.
```groovy
android {
lintOptions {
baseline file("lint-baseline.xml")
}
}
```
More info on baselines can be found in the [official documentation](https://developer.android.com/studio/write/lint#snapshot)

## Enabling/Disabling Lint Checks

There are cases when a particular lint check is not applicable to your codebase or when you want to _enable_ a lint check that's disabled by default.

You can use Android Lint's `lintOptions` to customize your own setup.

```groovy
android {
lintOptions {
// Turns off checks for the issue IDs you specify.
disable 'RxJavaDistinct'
// Turns on checks for the issue IDs you specify. These checks are in
// addition to the default lint checks.
enable 'FrameworkPair'
}
}
```

For more info on lintOptions, take a look at the [official documentation](https://developer.android.com/studio/write/lint)

1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ markdown_extensions:

nav:
- 'Overview': index.md
- 'Getting Started': getting-started.md
- 'Checks' : CHECKS.md
- 'Changelog' : changelog.md
- 'Contributing': contributing.md
Expand Down