Skip to content

Fix rules #1631

@bhirsz

Description

@bhirsz

Meta ticket for rules that can have fixes. For now I am doingonly brief overview and focus on defying whether it's easy / safe to implement fix or it may require more work or is not possible. I will add separate stories for rules we want to address first. We also need to check for potential coverage by formatters.

Can't fix - it usually means it needs manual intervention, as it may require bigger refactoring in the code.

ANN

  • ANN01 missing-section-variable-type - can't fix. we could potentially derive it from value, but it would be unsafe
  • ANN02 missing-argument-type - can't fix
  • ANN03 missing-for-loop-variable-type - can't fix

ARG

  • ARG01 unused-argument - easy to implement but extremely unsafe
  • ARG02 argument-overwritten-before-usage - unsafe, unclear what the fix could be - needs manual intervention
  • ARG03 undefined-argument-default - easy (just add EMPTY), partly similar to formatters like ReplaceEmptyValues
  • ARG04 undefined-argument-value - easy, potentially unsafe
  • ARG05 invalid-argument - can't fix
  • ARG06 duplicated-argument-name - can't fix
  • ARG07 arguments-per-line - we can offer splitting into multiple lines, mid difficulty, safe

COM

  • COM01 todo-in-comment - can't fix
  • COM02 missing-space-aften-comment - easy, safe fix
  • COM03 invalid comment - can't fix
  • COM04 ignored data - easy, safe fix (add *** Comments ***)
  • COM05 bom-encoding-in-file - can't fix (well, let's not waste time on it)
  • COM06 commented-out-code - can't fix

DEPR

  • DEPR01 if-can-be-used - can be fixed, mid diff - same as RunKeywordIf but requires handling model itself due to complexity. Need to be either reworked or deprecated after split of deprecated-statement
  • DEPR02 deprecated-statement - can be fixed, but rule needs to be split first
  • DEPR03 deprecated-with-name - can be fixed, easy and safe
  • DEPR04 deprecated-singular-header - can be fixed, easy and safe
  • DEPR05 replace-set-variable-with-var - can be fixed, mid - already handled by ReplaceWithVAR
  • DEPR06 replace-create-with-var - can be fixed, mid - already handled by ReplaceWithVAR
  • DEPR07 deprecated-force-tags - can be fixed, mid - already handled by ReplaceWithVAR

DOC

  • DOC01 missing-doc-keyword - can't fix
  • DOC02 missing-doc-test-case - can't fix
  • DOC03 missing-doc-suite - can't fix
  • DOC04 missing-doc-resource-file - can't fix

DUP

  • DUP01 duplicated-test-case - can't fix
  • DUP02 duplicated-keyword - can't fix
  • DUP03 duplicated-variable - can be fixed, probably safe assuming we remove ignored (second) value
  • DUP04 duplicated-resource - can be fixed, potentially safe
  • DUP05 duplicated-library - can be fixed, potentially safe
  • DUP06 duplicated-metadata - can be fixed, but hard to decide how exactly
  • DUP07 duplicated-variables-import - can be fixed
  • DUP08 section-already-defined - can be fixed, but it's big change (merging whole sections) - see MergeAndOrderSections formatter
  • DUP09 both-tests-and-tasks - can't fix
  • DUP10 duplicated-setting - can be fixed, but we can say it's unsafe

ERR - can't fix

  • ERR01 parsing-error - can't fix
  • ERR03 missing-keyword-name - can't fix
  • ERR04 variables-import-with-args - can't fix
  • ERR05 invalid-continuation-mark - can't fix
  • ERR08 non-existing-setting - can't fix
  • ERR09 setting-not-supported - can't fix
  • ERR12 invalid-for-loop - can't fix
  • ERR13 invalid-if - can't fix
  • ERR14 return-in-test-case - can't fix
  • ERR15 invalid-section-in-resource - can't fix
  • ERR16 invalid-setting-in-resource - can't fix
  • ERR17 unsupported-setting-in-init-file - can't fix

IMP

  • IMP01 wrong-import-order - can fix, potentially safe
  • IMP02 builtin-imports-not-sorted - can fix, safe
  • IMP03 non-builtin-imports-not-sorted - can fix, unsafe or dangerous
  • IMP04 resources-imports-not-sorted - can fix, unsafe or dangerous

KW

  • KW01 sleep-keyword-used - can't fix
  • KW02 not-allowed-keyword- can't fix
  • KW03 no-embedded-keyword-arguments- can't fix

LEN

  • LEN01 too-long-keyword - can't fix
  • LEN02 too-few-calls-in-keyword - can't fix
  • LEN03 too-many-calls-in-keyword - can't fix
  • LEN04 too-long-test-case - can't fix
  • LEN05 too-few-calls-in-test-case - can't fix
  • LEN06 too-many-calls-in-test-case - can't fix
  • LEN07 too-many-arguments - can't fix
  • LEN08 line-too-long - can fix, but can be complex - fixed by SplitTooLongLine
  • LEN09 empty-section - can fix, safe
  • LEN10 number-of-returned-values - can't fix
  • LEN11 empty-metadata - can fix, just remove?
  • LEN12 empty-documentation - can fix, just remove?
  • LEN13 empty-force-tags - can fix, just remove?
  • LEN14 empty-default-tags - can fix, just remove?
  • LEN15 empty-variables-import - can fix, just remove?
  • LEN16 empty-resource-import - can fix, just remove?
  • LEN17 empty-library-import - can fix, just remove?
  • LEN18 empty-setup - can fix, just remove?
  • LEN19 empty-suite-setup - can fix, just remove?
  • LEN20 empty-test-setup - can fix, just remove?
  • LEN21 empty-teardown - can fix, just remove?
  • LEN22 empty-suite-teardown - can fix, just remove?
  • LEN23 empty-test-teardown - can fix, just remove?
  • LEN24 empty-timeout - can fix, just remove? it could be also implicit override
  • LEN25 empty-test-timeout - can fix, just remove?
  • LEN26 empty-arguments - can fix, just remove?
  • LEN27 too-many-test-cases - can't fix
  • LEN28 file-too-long - can't fix
  • LEN29 empty-test-template - can fix, just remove?
  • LEN30 empty-template - can fix, just remove?
  • LEN31 empty-keyword-tags - can fix, just remove?
  • LEN32 too-long-variable-name = can't fix

MISC

  • MISC01 keyword-after-return
  • MISC02 empty-return
  • MISC03 nested-for-loop
  • MISC04 inconsistent-assignment
  • MISC05 inconsistent-assignment-in-variables
  • MISC06 can-be-resource-file
  • MISC07 if-can-be-merged
  • MISC08 statement-outside-loop
  • MISC09 inline-if-can-be-used
  • MISC10 unreachable-code
  • MISC11 multiline-inline-if
  • MISC13 expression-can-be-simplified
  • MISC14 misplaced-negative-condition
  • MISC15 unused-disabler

NAME

  • NAME01 not-allowed-char-in-name
  • NAME02 wrong-case-in-keyword-name
  • NAME03 keyword-name-is-reserved-word
  • NAME04 underscore-in-keyword-name
  • NAME05 setting-name-not-in-title-case
  • NAME06 section-name-invalid
  • NAME07 not-capitalized-test-case-title
  • NAME08 section-variable-not-uppercase
  • NAME09 else-not-upper-case
  • NAME10 keyword-name-is-empty
  • NAME11 test-case-name-is-empty
  • NAME12 empty-library-alias
  • NAME13 duplicated-library-alias
  • NAME14 bdd-without-keyword-call
  • NAME15 not-allowed-char-in-filename
  • NAME16 invalid-section
  • NAME17 mixed-task-test-settings
  • NAME18 wrong-case-in-keyword-call

ORD

  • ORD01 test-case-section-out-of-order
  • ORD02 keyword-section-out-of-order
  • ORD03 section-out-of-order

SPC

  • SPC01 trailing-whitespace
  • SPC02 missing-trailing-blank-line
  • SPC03 empty-lines-between-sections
  • SPC04 empty-lines-between-test-cases
  • SPC05 empty-lines-between-keywords
  • SPC06 mixed-tabs-and-spaces
  • SPC08 bad-indent
  • SPC09 empty-line-after-section
  • SPC10 too-many-trailing-blank-lines
  • SPC11 misaligned-continuation
  • SPC12 consecutive-empty-lines
  • SPC13 empty-lines-in-statement
  • SPC14 variable-not-left-aligned
  • SPC15 misaligned-continuation-row
  • SPC16 suite-setting-not-left-aligned
  • SPC17 bad-block-indent
  • SPC18 first-argument-in-new-line
  • SPC19 not-enough-whitespace-after-setting
  • SPC20 not-enough-whitespace-after-newline-marker
  • SPC21 not-enough-whitespace-after-variable
  • SPC22 not-enough-whitespace-after-suite-setting

TAG

  • TAG01 tag-with-space
  • TAG02 tag-with-or-and
  • TAG03 tag-with-reserved-word
  • TAG05 could-be-test-tags
  • TAG06 tag-already-set-in-test-tags
  • TAG07 unnecessary-default-tags
  • TAG08 empty-tags
  • TAG09 duplicated-tags
  • TAG10 could-be-keyword-tags
  • TAG11 tag-already-set-in-keyword-tags

VAR

  • VAR01 empty-variable
  • VAR02 unused-variable
  • VAR03 variable-overwritten-before-usage
  • VAR04 no-global-variable
  • VAR05 no-suite-variable
  • VAR06 no-test-variable
  • VAR07 non-local-variables-should-be-uppercase
  • VAR08 possible-variable-overwriting
  • VAR09 hyphen-in-variable-name
  • VAR10 inconsistent-variable-name
  • VAR11 overwriting-reserved-variable
  • VAR12 duplicated-assigned-var-name

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions