Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/slackhq/slack-lints
A collection of custom Android/Kotlin lint checks we use in our Android and Kotlin code bases at Slack.
https://github.com/slackhq/slack-lints
android android-lint kotlin lint static-analysis
Last synced: 3 months ago
JSON representation
A collection of custom Android/Kotlin lint checks we use in our Android and Kotlin code bases at Slack.
- Host: GitHub
- URL: https://github.com/slackhq/slack-lints
- Owner: slackhq
- License: apache-2.0
- Created: 2021-10-20T18:30:44.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-30T08:03:03.000Z (3 months ago)
- Last Synced: 2024-07-30T11:14:22.477Z (3 months ago)
- Topics: android, android-lint, kotlin, lint, static-analysis
- Language: Kotlin
- Homepage:
- Size: 3.08 MB
- Stars: 222
- Watchers: 9
- Forks: 11
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
slack-lints
===========This repository contains a collection of custom Android/Kotlin lint checks we use in our Android and Kotlin code bases at Slack.
While we do publish artifacts to Maven Central, some of the lints checks may only really be relevant to Slack's codebase. We [develop
these in the open](https://slack.engineering/developing-in-the-open/) to knowledge-share with the community.## Installation
Add the dependency to the `lintChecks` configuration. Note for non-android projects, you must apply the `com.android.lint` Gradle plugin to use this.
[![Maven Central](https://img.shields.io/maven-central/v/com.slack.lint/slack-lint-checks.svg)](https://mvnrepository.com/artifact/com.slack.lint/slack-lint-checks)
```kotlin
dependencies {
lintChecks("com.slack.lint:slack-lint-checks:")
}
```## Overview
### Do Not Mock
The `slack.lint.mocking` package contains several detectors and utilities for detecting mocking
of types that should not be mocked. This is similar to ErrorProne's `DoNotMockChecker` and acts as
an enforcement layer to APIs and classes annotated with `@DoNotMock`. This also detects common types that should never be mocked, such as Kotlin `data` classes or AutoValue classes.### Inclusivity
In order to write more inclusive code, we have an `InclusiveNamingChecker` tool to check for a
configurable list of non-inclusive names.### Moshi
`MoshiUsageDetector` contains a wealth of checks for common programmer errors when writing classes
for use with [Moshi](https://github.com/square/moshi) and [MoshiX](https://github.com/ZacSweers/MoshiX).### Misc
* `JavaOnlyDetector` - detects use of Java-only APIs from Kotlin. Based on the original unreleased implementation in [uber/lint-checks](https://github.com/uber/lint-checks).
* `DaggerKotlinIssuesDetector` - detects some known issues when using [Dagger](https://github.com/google/dagger) in Kotlin code.
* `RetrofitUsageDetector` - detects some common issues when using [Retrofit](https://github.com/square/retrofit).
* `DenyListedApi` – detects use of APIs that just shouldn't be used.
* `MustUseNamedParams` – can be used on functions that should _always_ use named parameters. Useful for APIs that have a lot of parameters and/or may change their order and you want to keep changes source-compatible.
* ...and a plethora of others!License
--------Copyright 2021 Slack Technologies, LLC
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 athttp://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.