Skip to content

Commit

Permalink
fix: nicer error messages (#93)
Browse files Browse the repository at this point in the history
* style: reformat code

* refactor(cli): use babel for async/await

* fix(cli): nice error message for missing input

* chore: add npx

* chore: add appropriate run scripts

* chore: fix typo
  • Loading branch information
marionebl authored Oct 14, 2017
1 parent 4165e8f commit dcfad61
Show file tree
Hide file tree
Showing 10 changed files with 254 additions and 252 deletions.
164 changes: 0 additions & 164 deletions @commitlint/cli/cli.test.js

This file was deleted.

7 changes: 6 additions & 1 deletion @commitlint/cli/fixtures/husky/integration/package.json
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
{"scripts":{"commitmsg":"commitlint -e"}}
{
"scripts": {},
"devDependencies": {
"husky": "0.14.3"
}
}
6 changes: 6 additions & 0 deletions @commitlint/cli/fixtures/husky/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"scripts": {},
"devDependencies": {
"husky": "0.14.3"
}
}
3 changes: 3 additions & 0 deletions @commitlint/cli/fixtures/parser-preset/commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
parserOpts: {
parserPreset: './parser-preset'
},
rules: {
'type-enum': [2, 'always', ['type']],
'scope-enum': [2, 'always', ['scope']],
Expand Down
4 changes: 2 additions & 2 deletions @commitlint/cli/fixtures/parser-preset/parser-preset.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
parserOpts: {
headerPattern: /^(\w*)\((\w*)\)-(\w*)\s(.*)$/,
headerCorrespondence: ['type', 'scope', 'ticket', 'subject']
headerPattern: /^----(\w*)\((\w*)\):\s(.*)$/,
headerCorrespondence: ['type', 'scope', 'subject']
}
};
34 changes: 25 additions & 9 deletions @commitlint/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,29 @@
"version": "4.2.0",
"description": "Lint your commit messages",
"bin": {
"commitlint": "cli.js"
"commitlint": "./lib/cli.js"
},
"scripts": {
"build": "exit 0",
"clean": "exit 0",
"prepublish": "npm test",
"pretest": "dep-check",
"start": "ava --watch --verbose",
"test": "ava $AVA_VERBOSE"
"build": "cross-env NODE_ENV=production babel src --out-dir lib --source-maps",
"clean": "rimraf lib",
"prepublish": "npm run build",
"prestart": "dep-check && npm run build",
"pretest": "dep-check && npm run build",
"start": "concurrently \"ava -c 4 --verbose --watch\" \"npm run watch\"",
"test": "ava -c 4 $AVA_VERBOSE",
"watch": "babel src --out-dir lib --watch --source-maps"
},
"ava": {
"files": [
"cli.test.js"
"lib/**/*.test.js"
],
"source": [
"lib/**/*.js"
]
},
"babel": {
"presets": [
"babel-preset-commitlint"
]
},
"xo": false,
Expand All @@ -41,13 +51,19 @@
},
"license": "MIT",
"devDependencies": {
"@commitlint/test": "^4.2.0",
"@commitlint/utils": "^4.2.0",
"ava": "^0.18.2",
"babel-cli": "^6.26.0",
"babel-preset-commitlint": "^4.2.0",
"babel-register": "^6.26.0",
"concurrently": "^3.5.0",
"cross-env": "^5.0.5",
"dependency-check": "^2.9.1",
"execa": "^0.7.0",
"mkdirp": "^0.5.1",
"resolve-bin": "^0.4.0",
"rimraf": "^2.6.1",
"rimraf": "^2.6.2",
"sander": "^0.6.0",
"string-to-stream": "^1.1.0",
"tmp": "0.0.33",
Expand Down
Loading

0 comments on commit dcfad61

Please sign in to comment.