Skip to content

feat: refactored the main validation logic#4

Merged
srajasimman merged 1 commit intomainfrom
claude/code-analysis-improvements-0SYty
Apr 15, 2026
Merged

feat: refactored the main validation logic#4
srajasimman merged 1 commit intomainfrom
claude/code-analysis-improvements-0SYty

Conversation

@srajasimman
Copy link
Copy Markdown
Owner

This pull request improves the robustness and flexibility of the commit message validation workflow and adds support for testing the codebase using Jest. The main changes include refactoring the commit message validation logic for better error handling and maintainability, enhancing the commit message pattern to support a wider range of valid scopes, and introducing Jest as a development dependency for testing.

Commit Message Validation Improvements:

  • Refactored the main validation logic in commit-message-validator.js for better readability and maintainability, including extracting pattern construction to a separate function and improving error handling for invalid regex patterns.
  • Enhanced the conventional commit message pattern to allow scopes with uppercase/lowercase letters, digits, underscores, slashes, and hyphens, making the validation more flexible.
  • Improved error reporting by escaping backticks in invalid commit messages and providing more informative PR comments when validation fails.
  • Added checks to skip validation for PRs with no commits or commits with empty messages, with appropriate log messages.

Testing Support:

  • Added jest as a development dependency and configured it in package.json to enable testing with the Node environment and to match test files ending with .test.js.

@srajasimman srajasimman merged commit 2718c65 into main Apr 15, 2026
1 check failed
@srajasimman srajasimman deleted the claude/code-analysis-improvements-0SYty branch April 15, 2026 19:30
@github-actions
Copy link
Copy Markdown

One or more commits have invalid message format.
❌ Commit 0ba724c has an invalid message format: "Add Jest as a dev dependency and configure test environment"

Please follow the Conventional Commits format: [optional scope]:
Example: feat(auth): add login functionality

For more information, visit: https://www.conventionalcommits.org/

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