Skip to content

Commit 501be72

Browse files
committed
Merge branch 'master' into greenkeeper-lodash-4.17.2
* master: fix(package): "main" property within "package.json" (#409) style: Add linting using eslint (#406) ci(appveyor): remove appveyor on finish script ci(appveyor): disable collection of artifacts ci(tests): on windows run tests as node4/npm3 ci(travis): update semantic-release to 6.3.5 and update travis config chore(package): update nyc to version 10.0.0 (#392) docs(install): Add documentation for installing and running locally (#300) fix(tests): fix tests when a global config is present (#405) test(adapter): add test for scoped npm modules fix(adapter): add support for scoped adapters docs: Add cz-emoji to tools list (#404) feat(commit): use OS-specific cache dir for commitizen.json instead of home-or-tmp (#400) fix(npmignore): ignore more unnecessary files (#393) docs: add vscode-commitizen to tools list (#397) Ci issues with commits (#402) chore(ci): add node versions and say git version in ci docs: replace sudo mention with link to how to fix EACCES error
2 parents 8e8c7ec + 2915827 commit 501be72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+389
-230
lines changed

.eslintrc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"extends": "standard",
3+
"rules": {
4+
"block-spacing": 0,
5+
"brace-style": 0,
6+
"comma-dangle": 0,
7+
"indent": 0,
8+
"key-spacing": 0,
9+
"keyword-spacing": 0,
10+
"no-duplicate-imports": 0,
11+
"no-multiple-empty-lines": 0,
12+
"no-path-concat": 0,
13+
"no-throw-literal": 0,
14+
"no-trailing-spaces": 0,
15+
"no-unused-vars": 0,
16+
"operator-linebreak": 0,
17+
"padded-blocks": 0,
18+
"quotes": 0,
19+
"semi-spacing": 0,
20+
"semi": 0,
21+
"space-before-blocks": 0,
22+
"space-before-function-paren": 0,
23+
"space-infix-ops": 0
24+
}
25+
}

.npmignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
/meta
22
/src
33
/test
4-
test/tools/trigger-appveyor-tests.sh
4+
test/tools/trigger-appveyor-tests.sh
5+
/coverage
6+
/.travis.yml
7+
/appveyor.yml
8+
jsconfig.json
9+
travis_after_all.py

.travis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,24 @@ branches:
99
notifications:
1010
email: false
1111
node_js:
12+
- '7'
13+
- '6'
14+
- '5'
1215
- '4'
1316
- '0.12'
1417
before_install:
1518
- git config --global user.name "TravisCI"
19+
- git config --global user.email "commitizen@gmail.com"
1620
- npm i -g npm@^2.0.0
1721
before_script:
1822
- npm prune
19-
- curl -Lo travis_after_all.py https://git.io/vLSON
23+
- git version
2024
script:
25+
# Only run linting on Node.js 4.x and up
26+
- if [ $(node -pe 'process.version.match(/v(\d+)\./)[1] >= 4') == 'true' ]; then npm run lint; fi
2127
- npm run test
2228
- npm run check-coverage
2329
after_success:
24-
- python travis_after_all.py
25-
- export $(cat .to_export_back)
2630
- npm run report-coverage
2731
- npm run test:windows
2832
- npm run semantic-release

CONTRIBUTING.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@ to release new versions automatically.
1717

1818
* Commits of type `fix` will trigger bugfix releases, think `0.0.1`
1919
* Commits of type `feat` will trigger feature releases, think `0.1.0`
20-
* Commits with `BREAKING CHANGE` in body or footer will trigger breakgin releases, think `1.0.0`
20+
* Commits with `BREAKING CHANGE` in body or footer will trigger breaking releases, think `1.0.0`
2121

22-
All other commit types wil trigger no new release.
22+
All other commit types will trigger no new release.
23+
24+
## Gotchas
25+
26+
### Atom removes lines with just spaces, breaking tests
27+
28+
When using Atom, if you edit some of our tests, atom will remove the whitespace on some lines. Unfortunately we wanted this whitespace to
29+
able to test multiline commits and their difference across operating
30+
systems. Atom has decided to keep the stripping of whitespace as a
31+
default. Although we understand this decision, it has the unfortunate
32+
side effect of editing parts of the file that you might not have
33+
intended. We think this should be left up to more configurable tools
34+
like eslint.
35+
36+
For now, in order to work around this, you can take the steps outlined
37+
[here](https://github.com/atom/whitespace/issues/10#issuecomment-85183781) to temporarily disable automatic whitespace removal in Atom.

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ When you commit with Commitizen, you'll be prompted to fill out any required com
55
[![codecov.io](https://img.shields.io/codecov/c/github/commitizen/cz-cli.svg?style=flat-square)](https://codecov.io/github/commitizen/cz-cli?branch=master) [![npm monthly downloads](https://img.shields.io/npm/dm/commitizen.svg?style=flat-square)](https://www.npmjs.com/package/commitizen) [![current version](https://img.shields.io/npm/v/commitizen.svg?style=flat-square)](https://www.npmjs.com/package/commitizen) [![bitHound Score](https://www.bithound.io/github/commitizen/cz-cli/badges/score.svg)](https://www.bithound.io/github/commitizen/cz-cli) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)
66

77
#### Installing the command line tool
8-
Installation is as simple as running the following command (add sudo if on OSX/Linux):
8+
Installation is as simple as running the following command (if you see `EACCES` error, reading [fixing npm permissions](https://docs.npmjs.com/getting-started/fixing-npm-permissions) may help):
99

1010
```
1111
npm install -g commitizen
@@ -31,7 +31,7 @@ npm install -g commitizen
3131
Install your preferred `commitizen` adapter globally, for example [`cz-conventional-changelog`](https://www.npmjs.com/package/cz-conventional-changelog)
3232

3333
```
34-
npm i -g cz-conventional-changelog
34+
npm install -g cz-conventional-changelog
3535
```
3636

3737
Create a `.czrc` file in your `home` directory, with `path` referring to the preferred, globally installed, `commitizen` adapter
@@ -92,6 +92,27 @@ This just tells Commitizen which adapter we actually want our contributors to us
9292

9393
Please note that in previous version of Commitizen we used czConfig. **czConfig has been deprecated** and you should migrate to the new format before Commitizen 3.0.0.
9494

95+
#### Optional: Install and run Commitizen locally
96+
97+
Installing and running Commitizen locally allows you to make sure that developers are running the exact same version of Commitizen on every machine.
98+
99+
Install Commitizen with `npm install --save-dev commitizen`.
100+
101+
Once you have Commitizen installed as a local dev dependency you can execute `./node_modules/.bin/commitizen` or `./node_modules/.bin/git-cz` in order to actually use the commands.
102+
103+
You can then initialize the conventional changelog adapter using: `./node_modules/.bin/commitizen init cz-conventional-changelog --save-dev --save-exact`
104+
105+
And you can then add some nice npm run scripts in your package.json pointing to the local version of commitizen:
106+
107+
```json
108+
...
109+
"scripts": {
110+
"commit": "git-cz"
111+
}
112+
```
113+
114+
This will be more convenient for your users because then if they want to do a commit, all they need to do is run `npm run commit` and they will get the prompts needed to start a commit!
115+
95116
#### Congratulations your repo is Commitizen-friendly. Time to flaunt it!
96117

97118
Add the Commitizen-friendly badge to your README using the following markdown:
@@ -181,6 +202,8 @@ We know that every project and build process has different requirements so we've
181202
- [cz-mapbox-changelog](https://www.npmjs.com/package/cz-mapbox-changelog)
182203
- [cz-customizable](https://github.com/leonardoanalista/cz-customizable)
183204
- [cz-conventional-changelog-lint](https://github.com/marionebl/cz-conventional-changelog-lint)
205+
- [vscode-commitizen](https://github.com/KnisterPeter/vscode-commitizen)
206+
- [cz-emoji](https://github.com/ngryman/cz-emoji)
184207

185208
To create an adapter, just fork one of these great adapters and modify it to suit your needs. We pass you an instance of [Inquirer.js](https://github.com/SBoudrias/Inquirer.js/) but you can capture input using whatever means necessary. Just call the `commit` callback with a string and we'll be happy. Publish it to npm, and you'll be all set!
186209

appveyor.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Test against this version of Node.js
22
environment:
3-
nodejs_version: "0.12"
3+
nodejs_version: "4"
44

55
# Install scripts. (runs after repo cloning)
66
install:
@@ -18,12 +18,12 @@ test_script:
1818
# run tests
1919
- npm test
2020

21-
on_finish:
22-
- ps: $root = Resolve-Path .\test\artifacts; [IO.Directory]::GetFiles($root.Path, '*.*', 'AllDirectories') | % { Push-AppveyorArtifact $_ -FileName $_.Substring($root.Path.Length + 1) -DeploymentName to-publish }
21+
#on_finish:
22+
# - ps: $root = Resolve-Path .\test\artifacts; [IO.Directory]::GetFiles($root.Path, '*.*', 'AllDirectories') | % { Push-AppveyorArtifact $_ -FileName $_.Substring($root.Path.Length + 1) -DeploymentName to-publish }
2323

24-
artifacts:
25-
- path: test/artifacts/**/*
26-
name: test artifacts
24+
#artifacts:
25+
# - path: test/artifacts/**/*
26+
# name: test artifacts
2727

2828
# Don't actually build.
29-
build: off
29+
build: off

package.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22
"name": "commitizen",
33
"version": "0.0.0-semantically-released",
44
"description": "Git commit, but play nice with conventions.",
5-
"main": "src/index.js",
5+
"main": "dist/index.js",
66
"scripts": {
77
"check-coverage": "nyc check-coverage --statements 80 --branches 80 --functions 80 --lines 80 ",
88
"commit": "node bin/git-cz",
99
"build": "babel src --out-dir dist",
1010
"build:watch": "babel --watch src --out-dir dist",
1111
"prepublish": "not-in-install && npm run build || true",
1212
"report-coverage": "nyc report --reporter=lcov | codecov",
13+
"write-coverage": "nyc report --reporter=lcov",
1314
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
1415
"start": "npm run test:watch",
16+
"lint": "eslint --ignore-path .gitignore .",
1517
"test": "nyc --require babel-core/register _mocha -- test/tests/index.js",
1618
"test:watch": "nodemon -q --ignore test/.tmp/ --ignore test/artifacts/ --ignore coverage/ --exec \"npm run test\" --",
1719
"test:windows": "node ./test/tools/trigger-appveyor-tests.js"
@@ -21,7 +23,7 @@
2123
"path": "./node_modules/cz-conventional-changelog"
2224
},
2325
"ghooks": {
24-
"pre-commit": "npm run test && npm run check-coverage"
26+
"pre-commit": "npm run lint && npm run test && npm run check-coverage"
2527
}
2628
},
2729
"homepage": "https://github.com/commitizen/cz-cli",
@@ -53,27 +55,31 @@
5355
"babel-preset-stage-2": "6.17.0",
5456
"chai": "3.5.0",
5557
"codecov.io": "0.1.6",
58+
"eslint": "3.12.2",
59+
"eslint-config-standard": "6.2.1",
60+
"eslint-plugin-promise": "3.4.0",
61+
"eslint-plugin-standard": "2.0.1",
5662
"ghooks": "1.3.0",
5763
"in-publish": "^2.0.0",
5864
"mocha": "3.1.2",
5965
"node-uuid": "1.4.7",
6066
"nodemon": "1.11.0",
61-
"nyc": "6.6.1",
67+
"nyc": "10.0.0",
6268
"proxyquire": "1.7.10",
63-
"rimraf": "2.5.4",
64-
"semantic-release": "4.3.5",
69+
"semantic-release": "6.3.5",
6570
"semver": "5.3.0",
6671
"sinon": "1.17.6"
6772
},
6873
"dependencies": {
74+
"cachedir": "^1.1.0",
6975
"chalk": "1.1.3",
7076
"cz-conventional-changelog": "1.2.0",
7177
"dedent": "0.6.0",
7278
"detect-indent": "4.0.0",
7379
"find-node-modules": "1.0.3",
7480
"find-root": "1.0.0",
81+
"fs-extra": "^1.0.0",
7582
"glob": "7.1.1",
76-
"home-or-tmp": "2.0.0",
7783
"inquirer": "1.2.2",
7884
"lodash": "4.17.2",
7985
"minimist": "1.2.0",

src/cli/git-cz.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ function bootstrap(environment = {}) {
2525
// This tells commitizen that it is not needed, just use git
2626
useGitStrategy(rawGitArgs, environment);
2727
}
28-
}
28+
}

src/cli/parsers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import * as gitCz from './parsers/git-cz';
44
export {
55
commitizen,
66
gitCz
7-
};
7+
};

src/cli/parsers/commitizen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ function parse(rawGitArgs) {
1818
});
1919

2020
return args;
21-
}
21+
}

0 commit comments

Comments
 (0)