Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 23, 2025

This PR implements Conventional Commits support for the repository following the specification at https://www.conventionalcommits.org/en/v1.0.0/.

What Changed

Dependencies

Configuration

  • Created commitlint.config.js with comprehensive rules supporting all standard commit types
  • Added .husky/commit-msg hook for automatic validation on every commit with offline support
  • Added commitlint script to package.json for manual validation

Documentation

  • Updated contributing guidelines with detailed conventional commit format examples and requirements

Testing

  • Added tests to verify commitlint configuration is properly set up

How It Works

All commit messages are now automatically validated using commitlint when developers make commits. The validation supports all standard conventional commit types:

  • feat: - New features
  • fix: - Bug fixes
  • docs: - Documentation changes
  • style: - Code style changes (formatting, etc.)
  • refactor: - Code refactoring
  • perf: - Performance improvements
  • test: - Adding or updating tests
  • build: - Build system changes
  • ci: - CI/CD configuration changes
  • chore: - Maintenance tasks
  • revert: - Reverting previous commits

Offline Support

The implementation works reliably in offline environments. The commit hook uses npx --no-install commitlint which ensures it only uses locally installed dependencies and won't attempt to download packages from the internet. This makes the hook work in offline environments, restricted networks, or CI systems as long as dependencies have been installed via pnpm install.

Examples

Valid commit messages:

feat: add OpenAPI 3.1 specification support
fix: resolve nullable schema generation issue
docs: update API documentation for new endpoints

Invalid commit messages:

Add new feature          # Missing type
FEAT: new feature        # Uppercase not allowed
feat:                    # Missing description

Benefits

  • Standardized History: Consistent commit message format across the entire project
  • Automated Changelog: Enables automatic changelog generation based on commit types
  • Better Collaboration: Clear commit message structure helps team members understand changes
  • Tooling Integration: Compatible with semantic versioning and release automation tools

The implementation is minimal and doesn't disrupt existing workflows - it only adds validation to ensure commit messages follow the conventional format.

Fixes #2685.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link

vercel bot commented Sep 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
hey-api-docs Ready Ready Preview Comment Sep 23, 2025 10:24am

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

changeset-bot bot commented Sep 23, 2025

⚠️ No Changeset found

Latest commit: cadbd94

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI and others added 2 commits September 23, 2025 10:13
- Add @commitlint/cli and @commitlint/config-conventional dependencies
- Create commitlint.config.js with conventional commit rules
- Set up Husky commit-msg hook for automatic validation
- Update documentation with conventional commit guidelines
- Add tests to verify commitlint configuration
- Add commitlint script to package.json for manual validation

The implementation supports all standard conventional commit types:
feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

Commit messages are automatically validated on commit to ensure
they follow the conventional commits specification.

Co-authored-by: mrlubos <[email protected]>
@Copilot Copilot AI changed the title [WIP] Copilot should use Conventional Commits feat: implement conventional commits with commitlint validation Sep 23, 2025
@Copilot Copilot AI requested a review from mrlubos September 23, 2025 10:25
Copilot finished work on behalf of mrlubos September 23, 2025 10:25
@@ -0,0 +1 @@
npx --no-install commitlint --edit "$1" No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

@dosu explain to me whether this will run offline as well?

Copy link
Member

Choose a reason for hiding this comment

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

@copilot explain to me whether this will run offline as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the hook will run offline! The implementation uses npx --no-install commitlint which ensures it only uses locally installed dependencies and won't attempt to download packages from the internet.

How it works offline:

  • When developers run pnpm install, commitlint and its dependencies are installed locally
  • The hook uses npx --no-install which restricts npx to only use already-installed packages
  • If commitlint isn't installed locally, the hook will fail with a clear error rather than trying to download it

Requirements for offline use:

  • Dependencies must be installed first with pnpm install
  • Both @commitlint/cli and @commitlint/config-conventional need to be available locally

This approach ensures the hook works reliably in offline environments, CI systems, or any scenario where internet access might be restricted. The commit accedb8 addresses this specifically.

@Copilot Copilot AI requested a review from mrlubos September 23, 2025 11:27
Copilot finished work on behalf of mrlubos September 23, 2025 11:27
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.

Copilot should use Conventional Commits
2 participants