@govbr-ds/commitlint-config 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.commitlintrc.js +144 -0
- package/README.md +82 -0
- package/package.json +41 -0
package/.commitlintrc.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
defaultIgnores: true,
|
|
3
|
+
extends: ['@commitlint/config-conventional'],
|
|
4
|
+
formatter: '@commitlint/format',
|
|
5
|
+
helpUrl: 'https://gov.br/ds/wiki/git-gitlab/guias/commit/',
|
|
6
|
+
ignores: [(commit) => commit.includes('[skip ci]')],
|
|
7
|
+
prompt: {
|
|
8
|
+
messages: {
|
|
9
|
+
emptyWarning: 'Item obrigatório. Por favor preencha conforme orientação.',
|
|
10
|
+
lowerLimitWarning: 'Abaixo do limite de caracteres',
|
|
11
|
+
max: 'Máximo de %d caracteres',
|
|
12
|
+
min: 'Mínimo de %d caracteres',
|
|
13
|
+
skip: '(OPCIONAL)',
|
|
14
|
+
upperLimitWarning: 'Acima do limite de caracteres',
|
|
15
|
+
},
|
|
16
|
+
questions: {
|
|
17
|
+
body: {
|
|
18
|
+
description: 'Descrição DETALHADA da mudança (Use \\n para quebrar linhas)',
|
|
19
|
+
},
|
|
20
|
+
breaking: {
|
|
21
|
+
description: 'Descrição BREVE da(s) BREAKING CHANGE(S)',
|
|
22
|
+
},
|
|
23
|
+
breakingBody: {
|
|
24
|
+
description:
|
|
25
|
+
'A descrição DETALHADA é obrigatória para BREAKING CHANGE(S). Descreva EM DETALHES a mudança. (Use \\n para quebrar linhas)',
|
|
26
|
+
},
|
|
27
|
+
isBreaking: {
|
|
28
|
+
description: 'Existe BREAKING CHANGE?',
|
|
29
|
+
},
|
|
30
|
+
isIssueAffected: {
|
|
31
|
+
description: 'Essa mudança relaciona/fecha alguma(s) issue(s)?',
|
|
32
|
+
},
|
|
33
|
+
issues: {
|
|
34
|
+
description:
|
|
35
|
+
'Liste a(s) issue(s) (Veja https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)',
|
|
36
|
+
},
|
|
37
|
+
issuesBody: {
|
|
38
|
+
description:
|
|
39
|
+
'A descrição DETALHADA é obrigatória quando um commit relaciona/fecha uma issue. Descreva EM DETALHES a mudança. (Use \\n para quebrar linhas)',
|
|
40
|
+
},
|
|
41
|
+
scope: {
|
|
42
|
+
description: 'Qual é o escopo dessa mudança? (ex: button, table, package.json)',
|
|
43
|
+
},
|
|
44
|
+
subject: {
|
|
45
|
+
description: 'Descrição BREVE sobre a mudança (Veja https://gov.br/ds/wiki/git-gitlab/guias/commit/)',
|
|
46
|
+
},
|
|
47
|
+
type: {
|
|
48
|
+
description:
|
|
49
|
+
'ANTES DE ENVIAR UM COMMIT, LEIA A NOSSA DOCUMENTAÇÃO SOBRE O ASSUNTO: https://gov.br/ds/wiki/git-gitlab/guias/commit/\n\n Selecione o tipo da mudança',
|
|
50
|
+
enum: {
|
|
51
|
+
build: {
|
|
52
|
+
description: 'Mudanças no sistema de build (ex: npm, node, webpack, vite...)',
|
|
53
|
+
},
|
|
54
|
+
chore: {
|
|
55
|
+
description: 'Alterações diversas que não se encaixam em outros tipos',
|
|
56
|
+
},
|
|
57
|
+
ci: {
|
|
58
|
+
description:
|
|
59
|
+
'Alterações nos arquivos e scripts de configuração de ambiente (Gitlab, Pipelines, Permissões...)',
|
|
60
|
+
},
|
|
61
|
+
deprecated: {
|
|
62
|
+
description: 'Marca o recurso como obsoleto. Provavelmente será removido em uma próxima versão',
|
|
63
|
+
},
|
|
64
|
+
docs: {
|
|
65
|
+
description: 'Atividades de documentação (tutorial, guia, etc...)',
|
|
66
|
+
},
|
|
67
|
+
feat: {
|
|
68
|
+
description: 'Nova feature, recurso, elemento, comportamento, etc...',
|
|
69
|
+
},
|
|
70
|
+
fix: {
|
|
71
|
+
description: 'Correção em feature, recurso, elemento, comportamento, etc...',
|
|
72
|
+
},
|
|
73
|
+
lint: {
|
|
74
|
+
description:
|
|
75
|
+
'Mudanças que não alteram o significado/comportamento (espaços, formatação, semi-vírgulas ausentes...)',
|
|
76
|
+
},
|
|
77
|
+
ops: {
|
|
78
|
+
description: 'Atividades operacionais relacionadas a design e desenvolvimento',
|
|
79
|
+
},
|
|
80
|
+
perf: {
|
|
81
|
+
description: 'Melhoria de desempenho (tempo de execução, tamanho, carregamento...)',
|
|
82
|
+
},
|
|
83
|
+
refactor: {
|
|
84
|
+
description: 'Altera o conteúdo sem mudar o resultado final (ex: organização de pastas, camadas...)',
|
|
85
|
+
},
|
|
86
|
+
removed: {
|
|
87
|
+
description: 'Recurso excluído definitivamente do projeto',
|
|
88
|
+
},
|
|
89
|
+
revert: {
|
|
90
|
+
description: 'Reverte um commit',
|
|
91
|
+
},
|
|
92
|
+
test: {
|
|
93
|
+
description: 'Atividades relacionadas a testes',
|
|
94
|
+
},
|
|
95
|
+
wip: {
|
|
96
|
+
description: 'Trabalho ainda não finalizado',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
// https://commitlint.js.org/#/reference-rules
|
|
103
|
+
rules: {
|
|
104
|
+
'body-full-stop': [0, 'always', '.'],
|
|
105
|
+
'body-leading-blank': [2, 'always'],
|
|
106
|
+
'body-max-length': [2, 'always', Infinity],
|
|
107
|
+
'body-max-line-length': [2, 'always', Infinity],
|
|
108
|
+
'footer-leading-blank': [2, 'always'],
|
|
109
|
+
'footer-max-length': [2, 'always', Infinity],
|
|
110
|
+
'footer-max-line-length': [2, 'always', Infinity],
|
|
111
|
+
'header-case': [0, 'always', 'lower-case'],
|
|
112
|
+
'header-full-stop': [0, 'always', '.'],
|
|
113
|
+
'header-max-length': [2, 'always', 100],
|
|
114
|
+
'header-min-length': [2, 'always', 20],
|
|
115
|
+
'scope-case': [0, 'always', 'lower-case'],
|
|
116
|
+
'scope-max-length': [2, 'always', Infinity],
|
|
117
|
+
'subject-case': [0, 'always', 'lower-case'],
|
|
118
|
+
'subject-full-stop': [0, 'always', '.'],
|
|
119
|
+
'subject-max-length': [2, 'always', Infinity],
|
|
120
|
+
'type-case': [0, 'always', 'lower-case'],
|
|
121
|
+
'type-enum': [
|
|
122
|
+
2,
|
|
123
|
+
'always',
|
|
124
|
+
[
|
|
125
|
+
'build',
|
|
126
|
+
'chore',
|
|
127
|
+
'ci',
|
|
128
|
+
'deprecated',
|
|
129
|
+
'docs',
|
|
130
|
+
'feat',
|
|
131
|
+
'fix',
|
|
132
|
+
'lint',
|
|
133
|
+
'ops',
|
|
134
|
+
'perf',
|
|
135
|
+
'refactor',
|
|
136
|
+
'removed',
|
|
137
|
+
'revert',
|
|
138
|
+
'test',
|
|
139
|
+
'wip',
|
|
140
|
+
],
|
|
141
|
+
],
|
|
142
|
+
'type-max-length': [2, 'always', Infinity],
|
|
143
|
+
},
|
|
144
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# GovBR-DS - Commit Config
|
|
2
|
+
|
|
3
|
+
## Objetivo
|
|
4
|
+
|
|
5
|
+
Compartilhar os padrões de commit entre os projetos do [GovBR-DS](https://gitlab.com/govbr-ds 'GovBR-DS').
|
|
6
|
+
|
|
7
|
+
## Como instalar
|
|
8
|
+
|
|
9
|
+
1. Instale as seguintes dependências
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install --save-dev @govbr-ds/commitlint-config husky @commitlint/cz-commitlint@17.8.1
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Como configurar
|
|
16
|
+
|
|
17
|
+
1. Crie um arquivo `.commitlintrc.js` na raiz do seu projeto e e importe a configuração:
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
module.exports = {
|
|
21
|
+
extends: ['@govbr-ds/commitlint-config'],
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
1. Inclua o seguinte código no seu `package.json`
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
"scripts": {
|
|
29
|
+
"commit": "git-cz",
|
|
30
|
+
},
|
|
31
|
+
"config": {
|
|
32
|
+
"commitizen": {
|
|
33
|
+
"path": "@commitlint/cz-commitlint"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
1. Conforme a documentação do [Husky](https://github.com/typicode/husky) inclua o hook `commit-msg` com o código abaixo:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx --no -- commitlint --edit $1
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
E configure o `package.json` com o seguinte script:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
"scripts": {
|
|
48
|
+
"prepare": "husky || true"
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Como contribuir?
|
|
53
|
+
|
|
54
|
+
Antes de abrir um Merge Request tenha em mente algumas informações:
|
|
55
|
+
|
|
56
|
+
- Esse é um projeto opensource e contribuições são bem-vindas.
|
|
57
|
+
- Para facilitar a aprovação da sua contribuição, escolha um título curto, simples e explicativo para o MR, e siga os padrões da nossa [wiki](https://gov.br/ds/wiki/ 'Wiki').
|
|
58
|
+
- Quer contribuir com o projeto? Confira o nosso guia [como contribuir](../../CONTRIBUTING.md 'Como contribuir?').
|
|
59
|
+
|
|
60
|
+
## Reportar bugs/necessidades
|
|
61
|
+
|
|
62
|
+
Você pode usar as [issues](https://gitlab.com/govbr-ds/tools/govbr-ds-config-tools/-/issues/new) para nos informar os problemas que tem enfrentado ao usar nossa biblioteca ou mesmo o que gostaria que fizesse parte do projeto. Por favor use o modelo que mais se encaixa na sua necessidade e preencha com o máximo de detalhes possível.
|
|
63
|
+
|
|
64
|
+
Nos comprometemos a responder a todas as issues
|
|
65
|
+
|
|
66
|
+
## Precisa de ajuda?
|
|
67
|
+
|
|
68
|
+
> Por favor **não** crie issues para fazer perguntas...
|
|
69
|
+
|
|
70
|
+
Use nossos canais abaixo para obter tirar suas dúvidas:
|
|
71
|
+
|
|
72
|
+
- Site do GovBR-DS [http://gov.br/ds](http://gov.br/ds)
|
|
73
|
+
|
|
74
|
+
- Usando nosso canal no discord [https://discord.gg/U5GwPfqhUP](https://discord.gg/U5GwPfqhUP)
|
|
75
|
+
|
|
76
|
+
## Padrão de commits
|
|
77
|
+
|
|
78
|
+
Para mais informações sobre o padrão de commits consulte [a nossa Wiki](https://gov.br/ds/wiki/git-gitlab/guias/commit/ 'Padrão de commit').
|
|
79
|
+
|
|
80
|
+
## Licença
|
|
81
|
+
|
|
82
|
+
Nesse projeto usamos a licença MIT.
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@govbr-ds/commitlint-config",
|
|
3
|
+
"version": "3.2.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Padrão de commits para projetos do Padrão Digital de Governo",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"govbr-ds",
|
|
8
|
+
"commitlint"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://gov.br/ds/",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://gitlab.com/govbr-ds/tools/govbr-ds-config-tools/issues"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git@gitlab.com:govbr-ds/tools/govbr-ds-config-tools.git"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "SERPRO (http://serpro.gov.br/)",
|
|
20
|
+
"main": ".commitlintrc.js",
|
|
21
|
+
"files": [
|
|
22
|
+
".commitlintrc.js"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"commit": "git-cz",
|
|
26
|
+
"lint:md": "markdownlint -d --fix **/*.md"
|
|
27
|
+
},
|
|
28
|
+
"config": {
|
|
29
|
+
"commitizen": {
|
|
30
|
+
"path": "@commitlint/cz-commitlint"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@commitlint/cli": "^17.8.1",
|
|
35
|
+
"@commitlint/config-conventional": "^17.8.1",
|
|
36
|
+
"@commitlint/cz-commitlint": "^17.8.1",
|
|
37
|
+
"@commitlint/format": "^17.8.1",
|
|
38
|
+
"@commitlint/lint": "^17.8.1",
|
|
39
|
+
"commitizen": "^4.3.0"
|
|
40
|
+
}
|
|
41
|
+
}
|