{"id":18981858,"url":"https://github.com/cph-cachet/detekt-verify-implementation","last_synced_at":"2025-04-19T20:02:14.125Z","repository":{"id":109497270,"uuid":"287039188","full_name":"cph-cachet/detekt-verify-implementation","owner":"cph-cachet","description":"A detekt plugin to enable static checking of concrete classes according to annotations on base classes.","archived":false,"fork":false,"pushed_at":"2024-10-28T22:10:06.000Z","size":122,"stargazers_count":6,"open_issues_count":10,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T12:46:07.579Z","etag":null,"topics":["dataclass","detekt-plugin","hacktoberfest","immutability","kotlin","static-analysis"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cph-cachet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-12T14:43:35.000Z","updated_at":"2024-10-28T22:10:10.000Z","dependencies_parsed_at":"2024-11-08T16:11:46.117Z","dependency_job_id":"f7cc4aa0-cd1e-4572-96cd-ea3ecb208315","html_url":"https://github.com/cph-cachet/detekt-verify-implementation","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cph-cachet%2Fdetekt-verify-implementation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cph-cachet%2Fdetekt-verify-implementation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cph-cachet%2Fdetekt-verify-implementation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cph-cachet%2Fdetekt-verify-implementation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cph-cachet","download_url":"https://codeload.github.com/cph-cachet/detekt-verify-implementation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249246192,"owners_count":21237007,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dataclass","detekt-plugin","hacktoberfest","immutability","kotlin","static-analysis"],"created_at":"2024-11-08T16:11:31.910Z","updated_at":"2025-04-19T20:02:14.088Z","avatar_url":"https://github.com/cph-cachet.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Detekt Plugin: Verify Implementation\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/dk.cachet.detekt.extensions/detekt-verify-implementation/badge.svg)](https://mvnrepository.com/artifact/dk.cachet.detekt.extensions/detekt-verify-implementation)\n\nThis is a plugin for [detekt](https://detekt.github.io/detekt/), a static code analyzer for Kotlin,\nwhich enables verifying whether concrete classes are implemented as specified **according to\nannotations applied to base types**.\n\nThe following detekt rules are included:\n\n-  `DataClass`: requires extending classes to be [data classes](https://kotlinlang.org/docs/reference/data-classes.html) or [object declarations](https://kotlinlang.org/docs/object-declarations.html#object-declarations).\n   This guarantees a predictable default implementation for `equals` and `hashcode` implementations, i.e., value equality instead of referential equality.\n-  `Immutable`: requires classes or extending classes to be immutable;\nthey may not contain mutable properties (var) or properties of mutable types (types with var properties).\n\nDue to the nature of this plugin, [a specific flavor of semantic versioning is used which makes more sense for linters](https://stylelint.io/about/semantic-versioning). Any minor update may report more errors than the previous release.\n\n\n## Enabling the Plugin in Gradle\n\nLoad the plugin through the [detekt Gradle configuration block](https://detekt.github.io/detekt/extensions.html#let-detekt-know-about-your-extensions):\n\n_Groovy DSL_\n\n```groovy\ndetekt {\n    dependencies {\n        detektPlugins \"dk.cachet.detekt.extensions:detekt-verify-implementation:1.2.5\"\n    }\n}\n```\n\nSince this plugin uses type resolution, the rules won't run when using the basic `detekt` task.\nUse `detektMain` or a custom detekt task, [as per the detekt documentation](https://detekt.dev/type-resolution.html).\n\n## Configuration\n\nBy default, the rules are not activated in the [detekt configuration file](https://detekt.github.io/detekt/configurations.html).\nTo enable a rule, set it to `active` and specify the fully qualified name of the `annotationClass` which determines which concrete classes to verify. For example:\n\n```yaml\nverify-implementation:\n  DataClass:\n    active: true\n    annotationClass: \"dk.cachet.carp.common.ImplementAsDataClass\"\n  Immutable:\n    active: true\n    annotationClass: \"dk.cachet.carp.common.Immutable\"\n```\n\nIn case the annotation class cannot be found and the rule is active, an `IllegalStateException` will be thrown.\n\nUsing `assumeNoAnnotations`, you can specify a list of fully qualified type names\nfor which it is assumed they don't have the annotation applied to them.\nThis may be useful when the plugin fails to analyze classes which are known not to carry the annotation.\n\n```yaml\nverify-implementation:\n  Immutable:\n    active: true\n    annotationClass: \"dk.cachet.carp.common.Immutable\"\n    assumeNoAnnotations: ['kotlin.Any']\n```\n\nAdditional rule-specific configuration options are described next.\n\n### Immutable\n\n- `assumeImmutable` can list fully qualified class names which won't be verified and are assumed to be immutable.\nThis may be useful when the plugin fails to analyze classes which you know to be immutable. Example configuration:\n\n```yaml\nverify-implementation:\n  Immutable:\n    active: true\n    annotationClass: \"dk.cachet.carp.common.Immutable\"\n    includes: ['**/domain/**']\n    assumeImmutable: [\n      'dk.cachet.carp.common.DateTime',\n      'kotlinx.serialization.json.Json'\n    ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcph-cachet%2Fdetekt-verify-implementation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcph-cachet%2Fdetekt-verify-implementation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcph-cachet%2Fdetekt-verify-implementation/lists"}