Skip to content

feat: add max-header-length for header length check#85

Open
aj3sh wants to merge 1 commit into
opensource-nepal:mainfrom
aj3sh:max-header-length
Open

feat: add max-header-length for header length check#85
aj3sh wants to merge 1 commit into
opensource-nepal:mainfrom
aj3sh:max-header-length

Conversation

@aj3sh

@aj3sh aj3sh commented Mar 13, 2026

Copy link
Copy Markdown
Member

Description

  • add max-header-length for header length check
  • disable default header length check
  • update dependency actions version
  • add release details on contributing file

Related Issue

Fixes #67

Type of Change

Please mark the appropriate option below to describe the type of change your pull request introduces:

  • Bug fix
  • New feature
  • Enhancement
  • Documentation update
  • Refactor
  • Other (please specify)

Checklist

  • My pull request has a clear title and description.
  • I have used semantic commit messages.
    Examples: "fix: Fixed foobar bug", "feat(accounts): Added foobar feature".
  • I have added/updated the necessary documentation on README.md.
  • I have added appropriate test cases (if applicable) to ensure the changes are functioning correctly.

Additional Notes

[Add any additional notes or context that you think the reviewers should know about.]

By submitting this pull request, I confirm that I have read and complied with the contribution guidelines of this project.

@aj3sh
aj3sh requested review from golesuman and sugat009 March 13, 2026 06:43

@sugat009 sugat009 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supply chain security: please keep SHA pins for write-privileged actions. See inline comments.

Comment thread .github/workflows/release-please.yml
Comment thread .github/workflows/release-please.yml Outdated

@sugat009 sugat009 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: --max-header-length falsy check allows invalid values. See inline comment with reproduction steps.

Comment thread src/commitlint/linter/validators.py

@sugat009 sugat009 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question on the architectural direction for configurable validator options. See inline comment.

Comment thread src/commitlint/linter/validators.py Outdated

@sugat009 sugat009 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional review comments using conventional comments labels.

Comment thread github_actions/action/utils.py Outdated
Comment thread src/commitlint/config.py
Comment thread src/commitlint/cli.py Outdated
Comment thread tests/test_cli.py Outdated
@aj3sh
aj3sh force-pushed the max-header-length branch from be9b5b3 to 7844137 Compare March 28, 2026 16:07
@aj3sh
aj3sh requested a review from sugat009 March 28, 2026 16:21
@aj3sh
aj3sh force-pushed the max-header-length branch from 7844137 to 3c7c482 Compare April 12, 2026 11:42

@sugat009 sugat009 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: feat: add max-header-length

Good feature addition overall. The AppParams dataclass is well-proportioned, positive_int_type handles edge cases correctly, and the validate_fns rename removes ambiguity with the module name.

Two test bugs need fixing before merge, and one product decision needs resolution. See inline comments.

Findings

# Label File Finding
1 issue (blocking) test__linter.py:29 skip_detail test passes False instead of True (copy-paste bug)
2 issue (blocking) test_run_commitlint.py:65 All 4 tests fail in isolation due to env var leakage
3 question (blocking) validators.py:77 Breaking change: header length check is now opt-in (was always 72)
4 issue utils.py:67 Docstring claims "returns None" but raises ValueError
5 suggestion utils.py:76 Add positive-int validation to match CLI path
6 suggestion cli.py:276 DRY: extract AppParams construction with dataclasses.replace
7 suggestion test_cli.py:409 Missing test coverage for --file/--hash/--from-hash + max-header-length
8 nitpick app_params.py:18 Typo: "Specially" and "Github"
9 nitpick validators.py:36 self.params public vs self._commit_message private
10 suggestion release-please.yml:22 Pin actions to commit hashes in privileged workflow

Comment thread tests/test_linter/test__linter.py Outdated
Comment thread tests/test_github_actions/test_run/test_run_commitlint.py
Comment thread src/commitlint/linter/validators.py
Comment thread github_actions/action/utils.py
Comment thread github_actions/action/utils.py
Comment thread src/commitlint/cli.py
Comment thread tests/test_cli.py
Comment thread src/commitlint/app_params.py Outdated
Comment thread src/commitlint/linter/validators.py Outdated
Comment thread .github/workflows/release-please.yml Outdated
@aj3sh
aj3sh force-pushed the max-header-length branch 3 times, most recently from b217a77 to 75cfe78 Compare May 17, 2026 13:11
@aj3sh
aj3sh requested a review from sugat009 May 17, 2026 13:20
@aj3sh
aj3sh force-pushed the max-header-length branch from 75cfe78 to 2d0ac0e Compare May 18, 2026 13:54
- [Breaking change] disable default header length check
- update dependency actions version
- add release details on contributing file
@aj3sh
aj3sh force-pushed the max-header-length branch from 2d0ac0e to 0f12164 Compare May 18, 2026 13:59
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.

Commitlint fails after squash merge

2 participants