Skip to content

Commit

Permalink
Add getting-started section (#28)
Browse files Browse the repository at this point in the history
* Initial pass at getting-started

* Add getting-started to mkdocs
  • Loading branch information
ShaishavGandhi committed Oct 22, 2019
1 parent e83ec3b commit 39abfd9
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
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

0 comments on commit 39abfd9

Please sign in to comment.