• Stars
    star
    207
  • Rank 183,125 (Top 4 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created over 2 years ago
  • Updated 7 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of custom Android/Kotlin lint checks we use in our Android and Kotlin code bases at Slack.

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 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

dependencies {
  lintChecks("com.slack.lint:slack-lint-checks:<version>")
}

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 and MoshiX.

Misc

  • JavaOnlyDetector - detects use of Java-only APIs from Kotlin. Based on the original unreleased implementation in uber/lint-checks.
  • DaggerKotlinIssuesDetector - detects some known issues when using Dagger in Kotlin code.
  • RetrofitUsageDetector - detects some common issues when using 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 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.

More Repositories

1

nebula

A scalable overlay networking tool with a focus on performance, simplicity and security
Go
13,646
star
2

SlackTextViewController

⛔️**DEPRECATED** ⛔️ A drop-in UIViewController subclass with a growing text input view and other useful messaging features
Objective-C
8,332
star
3

PanModal

An elegant and highly customizable presentation API for constructing bottom sheet modals on iOS.
Swift
3,595
star
4

go-audit

go-audit is an alternative to the auditd daemon that ships with many distros
Go
1,541
star
5

circuit

⚑️ A Compose-driven architecture for Kotlin and Android applications.
Kotlin
1,250
star
6

EitherNet

A pluggable sealed API result type for modeling Retrofit responses.
Kotlin
730
star
7

goSDL

goSDL
PHP
516
star
8

slack-api-docs

API Docs for Slack.com
427
star
9

slack-gradle-plugin

Gradle and IntelliJ build tooling used in Slack's Android repo
Kotlin
418
star
10

compose-lints

Lint checks to aid with a healthy adoption of Compose
Kotlin
349
star
11

keeper

A Gradle plugin that infers Proguard/R8 keep rules for androidTest sources.
Kotlin
248
star
12

magic-cli

Ruby
196
star
13

astra

Astra is a cloud-native search and analytics engine for log, trace, and audit data
Java
189
star
14

simple-kubernetes-webhook

This project is aimed at illustrating how to build a fully functioning kubernetes admission webhook in the simplest way possible.
Go
170
star
15

csp-html-webpack-plugin

A plugin which, when combined with HTMLWebpackPlugin, adds CSP tags to the HTML output.
JavaScript
158
star
16

hack-sql-fake

A library for testing database driven code in Hack
Hack
75
star
17

hakana

Another typechecker for Hack, built by Slack
Rust
70
star
18

vscode-hack

Hack language & HHVM debugger support for Visual Studio Code
TypeScript
70
star
19

gsuite-oauth-third-party-app-report

Start enforcing G Suite third-party apps via OAuth
JavaScript
54
star
20

backend-interview-prep-questions

A few questions & data to help you prepare for the Slack HQ backend interview
PLpgSQL
45
star
21

moshi-gson-interop

An interop tool for safely mixing Moshi and Gson models in JSON serialization.
Kotlin
43
star
22

kotlin-cli-util

Kotlin CLI utilities, mostly intended for use with Clikt
Kotlin
33
star
23

tree-sitter-hack

Hack grammar for tree-sitter
JavaScript
28
star
24

hack-json-schema

Generate Hack JSON Schema validators based on a JSON Schema.
Hack
27
star
25

deanimator

Go package that can detect animated images and "deanimate" them by rendering just the first frame as a static image.
Go
24
star
26

es-query-simple

A tiny command line utility to query elasticsearch. "
Python
23
star
27

auto-value-kotlin

An AutoValue extension that generates binary and source compatible equivalent Kotlin data classes of AutoValue models.
Kotlin
23
star
28

go-rsyslog-pstats

Parses and forwards rsyslog process stats to a local statsite, statsd, or wire protocol compatible service.
Go
21
star
29

tiny-thumb

Novel, efficient, and practical image compression with visually appealing results. 🀏 ✨
Go
14
star
30

backend-interview-prerequisites

A project to ensure that your backend onsite interview at Slack runs smoothly.
Go
11
star
31

sqlite-go-connect

A simple go app that connects to a sqlite3 database
Go
11
star
32

sqlite-python-connect

Short bit of code to connect to a sqlite db and run a query in python
Python
10
star
33

hack-graphql

Playground for a hack graphql server
Hack
8
star
34

protoc-gen-ts

A Typescript Protocol Buffer Implementation from the Future ✨
TypeScript
8
star
35

htmlsanitizer-hack

A port of the PHP HTML Purifier originally developed by Edward Z. Yang into Hacklang
Hack
7
star
36

sqlite-java-connect

This is a minimal repo project that connects to a sqlite3 database and returns a single row.
Java
6
star
37

grpc-hack

A gRPC extension for HHVM
C++
4
star
38

slack-astra-app

Grafana plugin that adds support for Astra
TypeScript
4
star
39

sqlite-ruby-connect

Just a tiny lil something to connect to SQLite using Ruby
PLpgSQL
3
star
40

proto-hack

hacklang generator for protobuf
Hack
3
star
41

snow

Python
2
star
42

.github

1
star
43

go-metrics-prometheus

Go
1
star
44

quota

1
star