Skip to content

feat: add banner-style comment check to fail pipeline#34

Closed
alexmohr wants to merge 2 commits into
mainfrom
feature/no-banner-comment-check
Closed

feat: add banner-style comment check to fail pipeline#34
alexmohr wants to merge 2 commits into
mainfrom
feature/no-banner-comment-check

Conversation

@alexmohr
Copy link
Copy Markdown
Contributor

@alexmohr alexmohr commented May 5, 2026

Summary

  • Adds no-banner-comment-check.py script that detects lines consisting of repeated decorative characters (=, -, #, *, /, ~, _, +) and reports them with file path and line number
  • Wires the check into the pre-commit hook system via a new no-banner-comment-extensions input across action.yml, checks.yml, and run_checks.py, mirroring the existing no-unicode-extensions pattern exactly
  • Documents the new input in README.md

The check is opt-in and disabled by default. Enable it by passing a comma-separated list of extensions:

uses: eclipse-opensovd/cicd-workflows/.github/workflows/checks.yml@main
with:
  no-banner-comment-extensions: ".py,.rs,.c"

A line like # ============================================================ in a checked file will cause the pipeline to fail with:

src/foo.py:42: banner-style comment found: '# ============================================================'

Checklist

  • I have tested my changes locally
  • I have added or updated documentation
  • I have linked related issues or discussions
  • I have added or updated tests

Related

Notes for Reviewers


Alexander Mohr alexander.m.mohr@mercedes-benz.com, Mercedes-Benz Tech Innovation GmbH
Provider Information

@alexmohr alexmohr force-pushed the feature/no-banner-comment-check branch 4 times, most recently from 6d38b82 to 98c3e96 Compare May 5, 2026 19:33
alexmohr added 2 commits May 6, 2026 04:49
…mments

Adds a new check mirroring the no-unicode-check pattern. A new script
no-banner-comment-check.py detects lines consisting of repeated decorative
characters and fails the pre-commit hook.

The check is controlled via no-banner-comment-extensions (file extensions to
scan) and is configurable via banner-comment-chars (regex character class of
fill characters, default: =\-#\*/~_+) and banner-comment-min-length (minimum
run length, default: 5). These inputs are wired through action.yml,
checks.yml, and run_checks.py, with README documentation.
@alexmohr alexmohr force-pushed the feature/no-banner-comment-check branch from 98c3e96 to fb844af Compare May 6, 2026 04:54
@alexmohr
Copy link
Copy Markdown
Contributor Author

alexmohr commented May 6, 2026

Work integrated into PR #39 (feat/pre-commit-hook-args-config). The no-banner-comment-check.py script, PEP 723 header, and .pre-commit-config.yml hook entry (with args:) are all present on the args-config branch. The checks.yml/action.yml flag-passing approach was replaced by the config-args pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant