chore(commitlint): allow breaking change flag without scope case #2912
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See discussion in #2905
Greptile Overview
Updated On: 2025-10-21 06:48:01 UTC
Greptile Summary
This PR updates the commitlint configuration at the repository root to properly parse Conventional Commits breaking change syntax and accommodate the project's scope naming conventions. The changes add a custom parser preset with an explicit regex pattern that correctly captures the
!breaking change marker (supporting bothtype!: subjectandtype(scope)!: subjectformats) and maps it to a dedicated field. Additionally, thescope-caserule is disabled to allow non-lowercase scopes such as JIRA ticket IDs (e.g.,FXC-3760) and PascalCase component names, which are common in the project's commit messages. Line length limits are also increased from 72 to 120 characters for more flexibility. These configuration-only changes integrate with the existing pre-commit hook workflow defined in.pre-commit-config.yamlfor advisory commit message validation.Changed Files
.commitlintrc.jsonheaderPatternregex to capture breaking change!flag, disabledscope-caseenforcement, and increased line length limits to 120 charactersConfidence score: 5/5
Sequence Diagram
sequenceDiagram participant Developer participant Git participant PreCommit as Pre-commit Hook participant Commitlint participant Parser as Custom Parser Preset Developer->>Git: "git commit -m 'feat(FXC-3760)!: add feature'" Git->>PreCommit: Trigger pre-commit hooks PreCommit->>Commitlint: Validate commit message Commitlint->>Parser: Parse message with custom regex Note over Parser: Pattern: ^([^\\(\\s:!]+)(?:\\(([^)]+)\\))?(!)?: (.+)$ Parser->>Parser: Extract fields:<br/>type="feat"<br/>scope="FXC-3760"<br/>breaking="!"<br/>subject="add feature" Parser-->>Commitlint: Return parsed components Commitlint->>Commitlint: Validate rules:<br/>- header length (12-120 chars)<br/>- type in enum<br/>- scope-case [0] (disabled) Commitlint-->>PreCommit: Validation passed PreCommit-->>Git: Hook successful Git-->>Developer: Commit accepted