Spelling Rule with Custom Filters

This rule is a specialized spelling checker that enforces correct spelling while allowing specific technical terms, product names, and common programming patterns to pass through. It's particularly tailored for documentation in the Nuclio project ecosystem.

The rule is important because it helps maintain consistent and correct spelling throughout documentation while being smart enough to recognize valid technical terms and patterns that might otherwise be flagged as spelling errors. This reduces false positives and makes the spelling checker more useful for technical documentation.

Examples of what's allowed (won't be flagged):

  • Product names: "Nuclio", "Iguazio"
  • Technical terms: "Dockerfile", "APIs", "URLs"
  • Programming patterns: camelCase words (like "myFunction")
  • Infrastructure terms: "namespace", "runtime"
  • Code blocks: Anything between triple backticks (```)
  • Common abbreviations: "SDK", "CPU", "GPU"
  • Technical tools: "minikube", "kaniko"
  • Programming-specific terms: "preload", "cron"

The rule will flag any misspelled words that don't match these patterns or aren't included in the main dictionary or the custom ignore file (Nuclio/ignore.txt). It issues a warning-level message asking "Did you really mean '[misspelled word]'?"

Rule Source

This rule comes from: https://github.com/nuclio/nuclio

Rule Definition

# Copyright 2023 The Nuclio Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
extends: spelling
message: "Did you really mean '%s'?"
level: warning
ignore:
  - Nuclio/ignore.txt
filters:
  - "[Nn]uclio('s)?"
  - "[Ii]guazio('s)?"
  - "[Gg]ateway('s)?"
  - "[Kk]aniko('s)?"
  - "Dockerfile(s)?"
  - "[a-z]+[A-Z][a-zA-Z]*|[a-z]+(_[a-z]+)+"
  - "[Aa][Cc][Kk][Ss]?"
  - "Golan[gd]('s)?"
  - "[Mm]inikube"
  - "(?:RPCs?|CRDs?|SDKs?|APIs?|VMs?|CPUs?|GPUs?|CLIs?|apis?|repos?|apigateways?|functionevents?)"
  - "[Uu][Rr][Ll][s]?"
  - "[Nn]uctl"
  - "```.*```"
  - "([Nn]amespaces?|namespaced)"
  - "[Cc]ron"
  - "[Rr]untimes?"
  - "[Pp]reload(ed)?"
  - "[Pp]re"