Section banner comment
Section banner comment. A banner comment. If the file needs signposts this big, it holds more than one module.
This is how the comment reads inline, under the flagged line.
Why it matters
// ===== Helpers ===== banners split a file into chapters instead of splitting it into files. Models add them to look organised.
What to do
Delete the banner. If the sections are real, move each one to its own module.
Examples
# ========== Helpers ==========
# (helpers live in helpers/dates.py)
What it catches
It reads a pattern on each line, aware of strings and comments. Languages: TypeScript and JavaScript, Python, Go, Rust, Java, C and similar. Scope: All files. These cases are the rule's own tests: the first set must be flagged and the second must not.
Flagged
// ===== Helpers =====
src/app.py
# ------------------------------
Left alone
// Helpers for parsing dates.
Research
Banner comments (`# ===== Helpers =====`) in short files. They add length and no information.
Turn it off or change it
In a config file for the CLI, or in the API's rules field:
{
"rules": {
"disable": [
"section-banner"
],
"severity": {
"section-banner": "medium"
}
}
}