Skip to content

BSL150 - Prohibited words

Summary

Prohibited words

Identifiers

Field Value
Rule code BSL150
Compatible alias BadWords
Severity WARNING
Without configuration Yes
BSLLS JSON, ON mode without overrides No
Registry flag implemented Yes
Tags convention

The implemented flag describes the registry; it does not certify verified BSLLS parity.

Supported parameters

TOML BSLLS JSON Default
bad-words-pattern badWords ""
bad-words-find-in-comments findInComments true

TOML keys belong in [tool.onec-hbk-bsl]; JSON keys belong in diagnostics.parameters.BadWords.

Behavior

  • The public identifier BSL150 and alias BadWords are stable.
  • The rule reports the cases documented on this page.
  • Suppressions and project configuration are applied before publication.
  • The rule requires neither an external analyzer nor network access.

Configuration and suppression

BSL### is the primary stable identifier. The compatible alias is accepted in select, ignore, and compatible block suppression comments.

[tool.onec-hbk-bsl]
select = ["BSL150"]
ignore = ["BadWords"]

All three suppression families support both a current line and a range. When an opening comment follows code, it affects only that line. Use any one form:

  • noqa:
Value = "example";  // noqa: BSL150
  • bsl-disable:
Value = "example";  // bsl-disable: BSL150
  • compatible BSLLS form:
Value = "example";  // BSLLS:BadWords-off

When the same opening comment is on a line by itself, it starts a range. Close it with the matching marker from the same family:

// noqa: BSL150
// code without this diagnostic
// noqa-enable: BSL150

// bsl-disable: BSL150
// code without this diagnostic
// bsl-enable: BSL150

// BSLLS:BadWords-off
// code without this diagnostic
// BSLLS:BadWords-on

To disable the rule until the end of the file, omit the closing noqa-enable, bsl-enable, or BSLLS:…-on marker.

Opening and closing markers must belong to the same family.

Description

Software modules should not contain prohibited words. The list of forbidden words is set by a regular expression. The search is case-insensitive.

For example:

"singularity|avada kedavra|Donald"

"transcenden(tal|ce)"