Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/detekt/detekt-compiler-plugin
Experimental support for detekt as a Kotlin compiler plugin
https://github.com/detekt/detekt-compiler-plugin
compilers detekt detekt-plugin gradle gradle-plugin hacktoberfest kotlin kotlin-compiler kotlin-compiler-plugin linter linters static-analysis
Last synced: 9 days ago
JSON representation
Experimental support for detekt as a Kotlin compiler plugin
- Host: GitHub
- URL: https://github.com/detekt/detekt-compiler-plugin
- Owner: detekt
- Archived: true
- Created: 2020-01-01T15:42:58.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-02-02T23:28:45.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T06:47:15.955Z (7 months ago)
- Topics: compilers, detekt, detekt-plugin, gradle, gradle-plugin, hacktoberfest, kotlin, kotlin-compiler, kotlin-compiler-plugin, linter, linters, static-analysis
- Language: Kotlin
- Homepage:
- Size: 424 KB
- Stars: 56
- Watchers: 8
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
- awesome-list - detekt/detekt-compiler-plugin - Experimental support for detekt as a Kotlin compiler plugin (Kotlin)
README
# Detekt Compiler Plugin
![Pre Merge Checks](https://github.com/detekt/detekt-compiler-plugin/workflows/Pre%20Merge%20Checks/badge.svg)
[![gradle plugin](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/io/github/detekt/gradle/compiler-plugin/io.github.detekt.gradle.compiler-plugin.gradle.plugin/maven-metadata.xml.svg?label=Gradle&style=flat-square)](https://plugins.gradle.org/plugin/io.github.detekt.gradle.compiler-plugin)⚠️ This repository is archived as the development of the `detekt-compiler-plugin` has been moved to the [detekt repo](https://github.com/detekt/detekt/tree/main/detekt-compiler-plugin) ⚠️
Experimental support for integrating detekt as a Kotlin compiler plugin
![image](docs/detekt-compiler-plugin.png "image")
### Usage
```kotlin
plugins {
id("io.github.detekt.gradle.compiler-plugin") version "0.4.0"
}detekt {
isEnabled = true // or with a property: System.getProperty("runDetekt") != null
// everything from https://detekt.github.io/detekt/kotlindsl.html#options-for-detekt-configuration-closure
// is supported to declare, only some options are used. See limitations.
}
```detekt plugins can be added to your project using the `detektPlugins` configuration:
```kotlin
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:")
}
```Reports can be customized using the `detekt` extension which is added to `KotlinCompile` tasks. Using Groovy this might
look like:```groovy
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
detekt {
reports {
xml.enabled.set(true)
txt.enabled.set(false)
create("custom") {
enabled.set(false)
}
}
}
}
```### Limitations
Everything our Gradle plugin (`DetektExtension`) supports, is also supported on the declaration side with this plugin.
However only the following options are implemented/passed down to detekt:
- config
- baseline
- debug
- buildUponDefaultConfig