Skip to content

WRONG_INDENTATION warning message ignores indentationSize setting #1886

@colesnodgrass

Description

@colesnodgrass

Describe the bug

WRONG_INDENTATION message is hard-coded to 4 spaces instead of being based on the indentationSize value.

WRONG_INDENTATION(true, "3.3.1", "only spaces are allowed for indentation and each indentation should equal to 4 spaces (tabs are not allowed)"),

Given the following configuration

- name: WRONG_INDENTATION
  enabled: true
  configuration:
    indentationSize: 2

Expected behavior

[WRONG_INDENTATION] only spaces are allowed for indentation and each indentation should equal to 2 spaces (tabs are not allowed): expected 2 but was 4 (diktat-ruleset:indentation)

Observed behavior

[WRONG_INDENTATION] only spaces are allowed for indentation and each indentation should equal to 4 spaces (tabs are not allowed): expected 2 but was 4 (diktat-ruleset:indentation)

Steps to Reproduce

Environment information

  • diktat version: 2.0.0
  • build tool (maven/gradle): gradle
  • how is diktat run (CLI, plugin, etc.): ./gradlew diktatCheck
  • kotlin version: 1.9.21

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions