Skip to content

Conversation

@bbauti
Copy link
Contributor

@bbauti bbauti commented Mar 9, 2025

What

This PR adds a new environment variable OCO_OMIT_SCOPE that allows users to control whether to include the scope part in generated commit messages.

Why

Some users or projects prefer commit messages without scopes, following a simpler format of <type>: <subject> rather than <type>(<scope>): <subject>. This configuration option provides flexibility to accommodate different commit style preferences.

How to use

Set the environment variable OCO_OMIT_SCOPE to true to omit scopes in commit messages:

# Add to config file
OCO_OMIT_SCOPE=true

# Or set temporarily for a single command
OCO_OMIT_SCOPE=true oco

Examples:

With default configuration or OCO_OMIT_SCOPE=false:

feat(file.ts): add new changes

With OCO_OMIT_SCOPE=true:

feat: add new changes

Changes made

  • Added OCO_OMIT_SCOPE to the CONFIG_KEYS enum
  • Added the field to the ConfigType interface
  • Added a default value of false to the DEFAULT_CONFIG object
  • Added validation for the new variable
  • Updated the prompt generation logic to respect the setting
  • Updated all translation files to include scope-less commit examples
  • Updated the ConsistencyPrompt type to support scope-less formats

Testing

The functionality has been verified through manual testing and all existing tests continue to pass.

@di-sukharev di-sukharev merged commit 7945f44 into di-sukharev:dev Mar 11, 2025
3 checks passed
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.

2 participants