Skip to content

Commit

Permalink
feat: Add commitlint hook
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkoOleksiyenko authored and quentinderoubaix committed Mar 22, 2024
1 parent 1149eca commit df55561
Show file tree
Hide file tree
Showing 5 changed files with 694 additions and 0 deletions.
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx commitlint --help-url 'https://github.com/AmadeusITGroup/AgnosUI/blob/main/COMMIT.md' --edit
30 changes: 30 additions & 0 deletions COMMIT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Commit convention

## Context

Every commit to the repository should follow the predefined commit convention in order to have easier understanding of the changes. We have decided to base it on the <a href="https://www.conventionalcommits.org/en/v1.0.0/" target="_blank">conventional commits</a>.

Basic structure:

> \<type\>(\<optional scope\>): \<description\>
>
> that becomes:
> feat(slider): Add slider component
For more detailed examples refer to the <a href="https://www.conventionalcommits.org/en/v1.0.0/" target="_blank">conventional commits rules</a>.

## Type options

- **build**: Changes that affect the build system, external dependencies or the local environment
- **cd**: Changes to the CD configuration files and scripts
- **chore**: Updates of the dependencies without the code changes
- **ci**: Changes to the CI configuration files and scripts
- **docs**: Changes related to the documentation only
- **feat**: A new feature
- **fix**: A bug fix
- **perf**: Changes that improve the performance
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **revert**: Revert previous commit
- **style**: Changes that do not affect the meaning of the code (white-space, fromatting, missing semi-colons etc.)
- **test**: Changes related to tests only
21 changes: 21 additions & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {RuleConfigSeverity} from '@commitlint/types';

export default {
rules: {
'body-leading-blank': [RuleConfigSeverity.Warning, 'always'],
'body-max-line-length': [RuleConfigSeverity.Error, 'always', 100],
'footer-leading-blank': [RuleConfigSeverity.Warning, 'always'],
'footer-max-line-length': [RuleConfigSeverity.Error, 'always', 100],
'header-max-length': [RuleConfigSeverity.Error, 'always', 100],
'header-trim': [RuleConfigSeverity.Error, 'always'],
'subject-empty': [RuleConfigSeverity.Error, 'never'],
'subject-full-stop': [RuleConfigSeverity.Error, 'never', '.'],
'type-case': [RuleConfigSeverity.Error, 'always', 'lower-case'],
'type-empty': [RuleConfigSeverity.Error, 'never'],
'type-enum': [
RuleConfigSeverity.Error,
'always',
['build', 'cd', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test'],
],
},
};
Loading

0 comments on commit df55561

Please sign in to comment.