tags-unique

Since 0.0.1 · fixed by --fix · In the rulesets: Recommended at warning, Strict at error, All at error

This rule checks that no two tags have the same name, compared without regard to case.

Rule details

Operations refer to tags by name, so two tags named user and User are one group to the reader and two to the tools, with two descriptions, and the operations tagged User land in whichever the tool picks. Two tags with the same name are a typo or a merge that kept both sides.

The rule reports Tag name is not unique (...) on the later tag.

Examples

Good.

tags:
  - name: User
  - name: Product

Bad. One tag, or a typo?

tags:
  - name: user
    description: First tag
  - name: User
    description: Is this another tag, or a typo?

Automatic fixes

--fix removes a duplicate whose name, description and external documentation are those of the first tag, and a duplicate that has a name only in favor of the one with a description. Duplicates whose descriptions or external documentation differ stay for you to merge.

Turn it off or change its severity

In apigenie.yaml, off turns the rule off and warning or error sets its severity; a rule with options takes the severity and the options as a pair, [warning, options]. lint.rules has the details.

commands:
  lint:
    rules:
      tags-unique: off
Was this helpful?