generated from detekt/detekt-custom-rule-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
# Detekt custom rule template | ||
# Meisterplan Detekt Rules | ||
|
||
This repository is a template. You can use it to generate your own repository to write and share your custom rules. | ||
This repo contains [Detekt](https://detekt.dev/) Rules useful for developing [Meisterplan](https://github.com/meisterplan). | ||
|
||
## How to use it | ||
|
||
1. Create a new repository using this one as a template. [Click here][create_template] | ||
2. Edit MyRule to fit your use case | ||
3. Share your rule! You can upload your rule to [Maven Central][maven_central] if you want. If you don't want to do all | ||
the steps that Maven Central requires you can just share your rule using [jitpack][jitpack]. | ||
4. Extra: you can remove all this README and explain what your rule does and how to configure it. | ||
|
||
## Documentation | ||
|
||
You can find the documentation about how to write custom [rules here][custom_rule_documentation]. | ||
|
||
## Note | ||
|
||
Remember that, by default, all rules are disabled. To configure your rules edit the file in | ||
`src/main/resources/config/config.yml`. | ||
|
||
[create_template]: https://github.com/detekt/detekt-custom-rule-template/generate | ||
|
||
[maven_central]: https://search.maven.org/ | ||
|
||
[custom_rule_documentation]: https://detekt.github.io/detekt/extensions.html | ||
|
||
[jitpack]: https://jitpack.io/ | ||
Look up the [most recent version](todo) and add the dependency to your `build.gradle.kts`: | ||
```kotlin | ||
repositories { | ||
// ... | ||
maven { url = uri("https://jitpack.io") } | ||
} | ||
|
||
dependencies { | ||
// ... | ||
detektPlugins("com.meisterplan.detektrules:detekt-rules:VERSION") | ||
} | ||
``` | ||
|
||
And configure your detekt configuration (usually `detekt-overrides.yml`) by enabling the desired rules: | ||
```yaml | ||
meisterplan: | ||
CopyOnDataClassWithNonPublicConstructor: | ||
active: true | ||
# ... | ||
``` |