Skip to content

Commit

Permalink
chore(ci): fix commitlint (#592)
Browse files Browse the repository at this point in the history
* chore(dev): added break to the list of type of commit

* chore(project): add commitlint when trying to commit
  • Loading branch information
ematipico committed Sep 21, 2018
1 parent b8d544b commit 1e0fa65
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 39 deletions.
3 changes: 2 additions & 1 deletion .cz-config.js
Expand Up @@ -26,6 +26,7 @@ module.exports = {
{ value: "feat", name: "feat: A new feature" },
{ value: "fix", name: "fix: Bugs, typos, etc" },
{ value: "misc", name: "misc: Other formats like tweaks and such" },
{ value: "tests", name: "tests: Tests, jest, binTestCases, etc" }
{ value: "tests", name: "tests: Tests, jest, binTestCases, etc" },
{ value: "break", name: "break: changes that break the behaviour of the cli" }
]
};
15 changes: 7 additions & 8 deletions commitlint.config.js
Expand Up @@ -7,23 +7,22 @@
"use strict";

module.exports = {
extends: ["cz", "@commitlint/config-lerna-scopes", "@commitlint/config-angular"],
extends: ["cz", "@commitlint/config-lerna-scopes"],
rules: {
"body-leading-blank": [1, "always"],
"body-tense": [1, "always", ["present-imperative"]],
"footer-leading-blank": [1, "always"],
"footer-tense": [1, "always", ["present-imperative"]],
"header-max-length": [2, "always", 80],
lang: [0, "always", "eng"],
"scope-case": [2, "always", "lowerCase"],
"scope-empty": [0, "never"],
"subject-case": [1, "always", "lowerCase"],
"subject-case": [2, "never", ["sentence-case", "start-case", "pascal-case", "upper-case"]],
"subject-empty": [0, "never"],
"subject-full-stop": [2, "never", "."],
"subject-tense": [1, "always", ["present-imperative"]],
"type-case": [2, "always", "lowerCase"],
"type-empty": [2, "never"]
// The scope-enum : defined in the cz-config
// The 'type-enum': defined in the cz-config
// turn it on once CLI will be inside its own package, so the scope will be the name of the pacakged
// part of the @commitlint/config-lerna-scopes
"scope-enum": [0, "never"],
"type-empty": [2, "never"],
"type-enum": [2, "always", ["ast", "break", "chore", "cli", "docs", "feat", "fix", "misc", "tests", "break"]]
}
};
67 changes: 38 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Expand Up @@ -35,6 +35,7 @@
"lint:codeOnly": "eslint \"{bin}/**/!(__testfixtures__)/*.js\" \"{bin}/**.js\"",
"lint": "eslint \"./bin/*.js\" \"./test/**/*.js\" \"packages/**/!(node_modules)/*.test.js\"",
"precommit": "lint-staged",
"commitmsg": "commitlint -E GIT_PARAMS",
"pretest": "npm run build && npm run lint && npm run tslint",
"reportCoverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json --disable=gcov",
"test": "nyc jest",
Expand All @@ -47,6 +48,10 @@
"{packages,bin}/**/!(__testfixtures__)/**.js": [
"eslint --fix",
"git add"
],
"{packages,bin}/**/!(__testfixtures__)/**.ts": [
"tslint --fix",
"git add"
]
},
"jest": {
Expand Down Expand Up @@ -106,7 +111,6 @@
},
"devDependencies": {
"@commitlint/cli": "^7.1.2",
"@commitlint/config-angular": "^7.1.2",
"@commitlint/config-lerna-scopes": "^7.1.2",
"@commitlint/prompt-cli": "^7.1.2",
"@commitlint/travis-cli": "^7.1.2",
Expand Down

0 comments on commit 1e0fa65

Please sign in to comment.