Skip to content

Latest commit

 

History

History

description-banned-words

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Ban certain words from descriptions

Authors:

What this does and why

There are some words that just should not appear in description fields, but somehow they crop up time and time again. Eliminate them with this configurable rule that will error if they are used.

Tip: If there's a false positive, consider using the ignore file to skip that specific occurrence and keep the rule in place for everything else.

Code

An example of redocly.yaml with a configurable rule:

rules:
  rule/descriptions-avoid-words:
    subject:
      type: any
      property: description
    assertions:
      notPattern: /(simple|random|just)/i

Edit the notPattern section to add as many pipe-separated terms as you'd like to exclude.

Examples

Acceptable description field:

      description: Fetch all registered users in a collection.

Unacceptable description field (but choose your own banned words):

      description: Fetch all registered users in a simple collection.