Skip to content

BSL232 — Protected modules

Summary

Protected modules

Identifiers

Field Value
Rule code BSL232
Compatible alias ProtectedModule
Severity INFORMATION
Enabled by default Yes
Implemented Yes
Tags design

Behavior

  • The public identifier BSL232 and alias ProtectedModule 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 = ["BSL232"]
ignore = ["ProtectedModule"]

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: BSL232
  • bsl-disable:
Value = "example";  // bsl-disable: BSL232
  • compatible BSLLS form:
Value = "example";  // BSLLS:ProtectedModule-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: BSL232
// code without this diagnostic
// noqa-enable: BSL232

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

// BSLLS:ProtectedModule-off
// code without this diagnostic
// BSLLS:ProtectedModule-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

The absence of module sources in the configuration is not recommended. In the case of a closed, password-protected module, the quality of the code decreases, it is impossible to review the code, and versioning of changes is not carried out.

Examples

Sources