saveourtool/diktat

The literals used to `@Suppress` Diktat checks should be configurable via `diktat-analysis.yml`

Open

#1628 aperta il 16 mar 2023

Vedi su GitHub
 (0 commenti) (0 reazioni) (1 assegnatario)Kotlin (40 fork)github user discovery
enhancementgood first issue

Metriche repository

Star
 (571 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

The literals used to @Suppress Diktat checks should be configurable via diktat-analysis.yml, e.g.:

- name: MAGIC_NUMBER
  aliases: [ MagicNumber ]
  enabled: true

Then the following code should trigger no warnings:

@Suppress("MagicNumber")
fun f() {
    g(42)
}

Environment information

  • diktat version: 1.2.4.2

Related

  • #1627
  • #1530

@nulls, @petertrr, feel free to comment.

Guida contributor