Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement subject feedback, scope filtering, subject filtering … #75

Merged
merged 9 commits into from
Apr 18, 2019

Conversation

yinzara
Copy link
Contributor

@yinzara yinzara commented Jan 10, 2019

…and config through package.json

cz-conventional-changelog can now have its values (specifically all the defaults and maxLineWidth)
through the config.commitizen key in the package.json file. The scope now automatically becomes
lowercase (as is required for conventional changelogs) and is prompted on the same line (as it is
always short and doesn't need an additional line). The subject question now indicates the total
number of characters that are allowed based upon the maxLineWidth configuration (or 100 as it is now
by default), the length of the type, and scope. Validation prevents entering more than the allowed
number of characters with feedback of the number of characters entered. Subject will always have a
lowercase first letter and strip any trailing dots (as is required by the conventional changelog
standard). 'commitizen' and 'semantic-release' have been updated to the most recent versions
(because of current vunderabilites) and the .travisci file has been updated to reflect newer node
versions.

…and config through package.json

cz-conventional-changelog can now have its values (specifically all the defaults and maxLineWidth)
through the config.commitizen key in the package.json file.  The scope now automatically becomes
lowercase (as is required for conventional changelogs) and is prompted on the same line (as it is
always short and doesn't need an additional line). The subject question now indicates the total
number of characters that are allowed based upon the maxLineWidth configuration (or 100 as it is now
by default), the length of the type, and scope. Validation prevents entering more than the allowed
number of characters with feedback of the number of characters entered.  Subject will always have a
lowercase first letter and strip any trailing dots (as is required by the conventional changelog
standard).  'commitizen' and 'semantic-release' have been updated to the most recent versions
(because of current vunderabilites) and the .travisci file has been updated to reflect newer node
versions.
@yinzara
Copy link
Contributor Author

yinzara commented Jan 11, 2019

I understand this is a little rough and there are a lot of things covered in this pull request. I'm in the process of writing a full test suite right now. Do you want me to undo any of what I've done? Any requests? Feedback?

jest unit tests are implemented in engine.test.js and have achieve 100% code coverage and all tests
are passing. also add prettier and .editorconfig and reformatted files
@yinzara
Copy link
Contributor Author

yinzara commented Jan 11, 2019

ok there are all the tests. I also implemented prettier as the project was nearly already formatted and it kept the test cases looking very nice. also added an .editorconfig file

@yinzara
Copy link
Contributor Author

yinzara commented Jan 11, 2019

Since originally Travis was only supporting Node 4, I swapped out jest for mocha/chai as jest doesn't work for Node 4 and updated the test cases and package.json

@yinzara yinzara force-pushed the master branch 2 times, most recently from 5108924 to b4c2f89 Compare January 11, 2019 21:13
@travi
Copy link
Contributor

travi commented Feb 8, 2019

what's the best way to test this before integration? i thought it would be as simple as npm i yinzara/cz-conventional-changelog -D, but running git cz, as normal, results in Cannot find module 'commitizen'

@yinzara
Copy link
Contributor Author

yinzara commented Feb 8, 2019

I would just clone my repository then run:
npm install --global .

That should make it available globally.

Add commitlint related docs.
@travi
Copy link
Contributor

travi commented Feb 8, 2019

sure, that could be worth a try. i normally install commitizen globally and this package locally, which works because of the config in package.json:

"config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  }

file structure was the same, so i figured that it should have worked


### Commitlint

If using the [commitlint](https://github.com/conventional-changelog/commitlint) js library, the "maxHeaderWidth" configuration property will default to the configuration of the "header-max-length" rule instead of the hard coded value of 100. This can be ovewritten by setting the 'maxHeaderWidth' configuration in package.json or the CZ_MAX_HEADER_WIDTH environment variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/overwritten/overridden

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmm just installing it locally should have worked. Maybe it was cached? Not sure. I don't think mine was released so maybe:
npm install -D git://github.com/yinzara/cz-conventional-changelog

@travi
Copy link
Contributor

travi commented Feb 9, 2019

Hmmmm just installing it locally should have worked.

agreed

I don't think mine was released so maybe:
npm install -D git://github.com/yinzara/cz-conventional-changelog

that should be equivalent to npm i yinzara/cz-conventional-changelog -D, which correctly results in the following in the package.json and the files matching the normal installation, from what i can tell:

"cz-conventional-changelog": "github:yinzara/cz-conventional-changelog",

either way, i dont think this has anything to do with your PR, its surly something wrong on my end or me not understanding the way the pieces of commitizen should fit together, but i though i had a pretty good idea. i'm just excited to try this out, but would also like the chance to provide feedback if i could give it a shot. since im having trouble tho, i dont want anyone to wait on merging if its good to go otherwise.

@yinzara
Copy link
Contributor Author

yinzara commented Mar 8, 2019

Anyone have any comments on this?

@yinzara
Copy link
Contributor Author

yinzara commented Mar 8, 2019

Btw as the project author, once this PR is merged, you can turn on the "Checks" feature to require tests to pass before a PR can be merged. If you're feeling REALLY spicy, you could enable automated PR merging with Greenkeeper after tests have passed.

@PierreBrisorgueil
Copy link

PierreBrisorgueil commented Apr 3, 2019

hello @yinzara thx for your work, needed that for one of my projects, since there has been no return since January I allowed myself the released here, if it interests you. I integrated your PR, added emojis and switched to es6. As soon as I have a moment I would like to devise the code to allow evolutions more easily, and possibly switch on jest and coveralls. (added Greenkeeper, travis, snyk, code climate, and semantic-release to keep this up to date easily)

if this repo resumes I would do my PR here, waiting for those wishing to participate are welcome!

@yinzara
Copy link
Contributor Author

yinzara commented Apr 4, 2019

Thanks man! Hopefully Matt gives us some love soon and we can get all of this merged back here. I know how busy it can get though.

I had originally written the tests in Jest (as you probably see in the history of this PR) but moved them to Mocha/Chai because of support for Node 4 (which Jest does not support).

If we're ok with dropping Node 4, I believe we can move back to the Jest test suite I originally wrote. But that's again up to Matt :)

@travi
Copy link
Contributor

travi commented Apr 5, 2019

@yinzara if i'm the Matt you;re referring to, i am not a project maintainer. i'm very excited about this contribution, but i have no power to move the integration forward

@yinzara
Copy link
Contributor Author

yinzara commented Apr 5, 2019

LOL I completely misunderstood. Looks like it's Jim that we're actually waiting on. @jimthedev Any chance we could get some movement on this?

@jimthedev jimthedev merged commit 3398c02 into commitizen:master Apr 18, 2019
@travi
Copy link
Contributor

travi commented Apr 19, 2019

@jimthedev thanks for merging. i'm excited for the new features.

i was trying to look to see if i could figure out when you would publish a new version when i noticed that the last couple commits failed to publish from travis. thought i'd at least let you know in case you expected it to publish automatically and hadn't noticed that it didn't.

@jackson-jiang
Copy link

great feature and can't wait to see the new release, is there a plan?

@commitizen-bot
Copy link

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@travi
Copy link
Contributor

travi commented Jul 21, 2019

it looks like i should have dug deeper into the Cannot find module 'commitizen' issues I was seeing that i thought were just local config issues preventing me from testing this before it was released. i'm seeing the same message with the latest release, unfortunately.

i'll open a new issue referencing this in hopes that we can track down the issue and get it resolved

update: #89

@yinzara
Copy link
Contributor Author

yinzara commented Jul 21, 2019

Hmm that's very odd. Since "cz-conventional-changelog" is dependent on "commitizen", I'm surprised it could have that error.

@travi
Copy link
Contributor

travi commented Jul 21, 2019

That was the issue. It wasn't dependant on it before. It was only marked as a dev dependency before my PR got merged. Was a pretty simple fix and was merged quickly, so it's all good now.

bors bot added a commit to Third-Culture-Software/bhima that referenced this pull request Jul 22, 2019
3813: Update cz-conventional-changelog to the latest version 🚀 r=jniles a=greenkeeper[bot]


## The devDependency [cz-conventional-changelog](https://github.com/commitizen/cz-conventional-changelog) was updated from `2.1.0` to `3.0.0`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

---

**Publisher:** [commitizen-bot](https://www.npmjs.com/~commitizen-bot)
**License:** MIT

<details>
<summary>Release Notes for v3.0.0</summary>

<h1><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/compare/v2.1.0...v3.0.0">3.0.0</a> (2019-07-19)</h1>
<h3>Bug Fixes</h3>
<ul>
<li>remove pre-node 10 support (<a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/issues/86" data-hovercard-type="pull_request" data-hovercard-url="/commitizen/cz-conventional-changelog/pull/86/hovercard">#86</a>) (<a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/76588ad">76588ad</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li>add default values to options (<a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/issues/69" data-hovercard-type="pull_request" data-hovercard-url="/commitizen/cz-conventional-changelog/pull/69/hovercard">#69</a>) (<a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/65d6a9f">65d6a9f</a>)</li>
<li>implement configuration through package.json (<a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/issues/75" data-hovercard-type="pull_request" data-hovercard-url="/commitizen/cz-conventional-changelog/pull/75/hovercard">#75</a>) (<a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/3398c02">3398c02</a>)</li>
</ul>
<h3>BREAKING CHANGES</h3>
<ul>
<li>Node 10 is LTS so please upgrade to it.</li>
</ul>
</details>

<details>
<summary>Commits</summary>
<p>The new version differs by 7 commits.</p>
<ul>
<li><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/76588adc6eb0c09f684dd9f7359c12492ee69d81"><code>76588ad</code></a> <code>fix: remove pre-node 10 support (#86)</code></li>
<li><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/6ed57bdd7c7220c947ddbafff4f74fa6e5597a80"><code>6ed57bd</code></a> <code>ci(publish): fixed the npm command to run semantic-release (#81)</code></li>
<li><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/3398c02207b42133691dac8be21257ee28a0ac4c"><code>3398c02</code></a> <code>feat: implement configuration through package.json (#75)</code></li>
<li><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/65d6a9f935318398ea120da406d76b78498ca632"><code>65d6a9f</code></a> <code>feat: add default values to options (#69)</code></li>
<li><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/f2ca75525f5788342ccdf6efd9391f742f0509b7"><code>f2ca755</code></a> <code>chore(license): adds missing MIT license file (#67)</code></li>
<li><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/d4bf98e59b0d24e18876945546181ada5e2f7448"><code>d4bf98e</code></a> <code>Merge pull request #64 from jacobq/patch-1</code></li>
<li><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/ff370a323c571a7080d2f9073c0fae2111a1760e"><code>ff370a3</code></a> <code>doc(README): Update link (again)</code></li>
</ul>
<p>See the <a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/compare/d40ac2c5a0021a2c6faa7b8471a3003213a2c7ef...76588adc6eb0c09f684dd9f7359c12492ee69d81">full diff</a></p>
</details>

---

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

---


Your [Greenkeeper](https://greenkeeper.io) bot 🌴



Co-authored-by: greenkeeper[bot] <23040076+greenkeeper[bot]@users.noreply.github.com>
bors bot added a commit to Third-Culture-Software/bhima that referenced this pull request Jul 23, 2019
3813: Update cz-conventional-changelog to the latest version 🚀 r=jniles a=greenkeeper[bot]


## The devDependency [cz-conventional-changelog](https://github.com/commitizen/cz-conventional-changelog) was updated from `2.1.0` to `3.0.0`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

---

**Publisher:** [commitizen-bot](https://www.npmjs.com/~commitizen-bot)
**License:** MIT

<details>
<summary>Release Notes for v3.0.0</summary>

<h1><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/compare/v2.1.0...v3.0.0">3.0.0</a> (2019-07-19)</h1>
<h3>Bug Fixes</h3>
<ul>
<li>remove pre-node 10 support (<a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/issues/86" data-hovercard-type="pull_request" data-hovercard-url="/commitizen/cz-conventional-changelog/pull/86/hovercard">#86</a>) (<a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/76588ad">76588ad</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li>add default values to options (<a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/issues/69" data-hovercard-type="pull_request" data-hovercard-url="/commitizen/cz-conventional-changelog/pull/69/hovercard">#69</a>) (<a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/65d6a9f">65d6a9f</a>)</li>
<li>implement configuration through package.json (<a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/issues/75" data-hovercard-type="pull_request" data-hovercard-url="/commitizen/cz-conventional-changelog/pull/75/hovercard">#75</a>) (<a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/3398c02">3398c02</a>)</li>
</ul>
<h3>BREAKING CHANGES</h3>
<ul>
<li>Node 10 is LTS so please upgrade to it.</li>
</ul>
</details>

<details>
<summary>Commits</summary>
<p>The new version differs by 7 commits.</p>
<ul>
<li><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/76588adc6eb0c09f684dd9f7359c12492ee69d81"><code>76588ad</code></a> <code>fix: remove pre-node 10 support (#86)</code></li>
<li><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/6ed57bdd7c7220c947ddbafff4f74fa6e5597a80"><code>6ed57bd</code></a> <code>ci(publish): fixed the npm command to run semantic-release (#81)</code></li>
<li><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/3398c02207b42133691dac8be21257ee28a0ac4c"><code>3398c02</code></a> <code>feat: implement configuration through package.json (#75)</code></li>
<li><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/65d6a9f935318398ea120da406d76b78498ca632"><code>65d6a9f</code></a> <code>feat: add default values to options (#69)</code></li>
<li><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/f2ca75525f5788342ccdf6efd9391f742f0509b7"><code>f2ca755</code></a> <code>chore(license): adds missing MIT license file (#67)</code></li>
<li><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/d4bf98e59b0d24e18876945546181ada5e2f7448"><code>d4bf98e</code></a> <code>Merge pull request #64 from jacobq/patch-1</code></li>
<li><a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/commit/ff370a323c571a7080d2f9073c0fae2111a1760e"><code>ff370a3</code></a> <code>doc(README): Update link (again)</code></li>
</ul>
<p>See the <a href="https://urls.greenkeeper.io/commitizen/cz-conventional-changelog/compare/d40ac2c5a0021a2c6faa7b8471a3003213a2c7ef...76588adc6eb0c09f684dd9f7359c12492ee69d81">full diff</a></p>
</details>

---

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

---


Your [Greenkeeper](https://greenkeeper.io) bot 🌴



Co-authored-by: greenkeeper[bot] <23040076+greenkeeper[bot]@users.noreply.github.com>
github-actions bot pushed a commit to DawChihLiou/cz-conventional-changelog-with-jiraid-detection that referenced this pull request Sep 16, 2020
# 1.0.0 (2020-09-16)

### Bug Fixes

* **adapter:** Fix typo in etc. ([39182b8](39182b8))
* **build:** Add proper deps, force republish to make sure things are working ([922097b](922097b))
* **build:** Automatic releases!!! ✨ ([114f967](114f967))
* update longest to ^2 ([commitizen#88](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/88)) ([7234529](7234529))
* **commit:** Remove es6 string syntax (backticks) ([7f922f2](7f922f2))
* **commit:** remove parentheses when there is no scope present ([55f72b9](55f72b9))
* **config-loader:** captured the direct dependency on commitizen for the use of the config loader ([commitizen#90](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/90)) ([4b23bbc](4b23bbc)), closes [commitizen#89](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/89)
* **defaultValues:** Added fallback for optional default values ([commitizen#99](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/99)) ([2aae317](2aae317))
* **package.json:** install missing dependency ([4287211](4287211))
* **package.json:** update package name ([2985968](2985968))
* **prompter:** resolve issue with new inquirer api ([commitizen#18](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/18)) ([807b4e5](807b4e5))
* Correct typo in JSON ([58df4d1](58df4d1))
* **release:** attempt to fix release ([c167fd8](c167fd8))
* **release.config.js:** attempt to fix semantic release ([e362f9a](e362f9a))
* **require:** get rid of relative path to the word-wrap ([e98818a](e98818a)), closes [commitizen#4](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/4)
* **wrapping:** Fix fields to wrap instead of truncate at 100 characters ([c7b7e11](c7b7e11)), closes [commitizen/cz-cli#4](commitizen/cz-cli#4)
* remove pre-node 10 support ([commitizen#86](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/86)) ([76588ad](76588ad))
* Update conventional-commit-types to the latest version 🚀 ([commitizen#105](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/105)) ([5a371c1](5a371c1))
* Wrap updateTypes in packageRules ([0f6dfbf](0f6dfbf))

### Features

* **adapter:** Create initial commit. ([4e8da01](4e8da01))
* **adapter:** refactor to engine, default to conventional commit types ([c8452d1](c8452d1)), closes [commitizen#29](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/29)
* **adapter:** Split breaking changes into separate question ([commitizen#44](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/44)) ([2d78e1d](2d78e1d)), closes [commitizen#17](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/17)
* add default values to options ([commitizen#69](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/69)) ([65d6a9f](65d6a9f))
* implement configuration through package.json ([commitizen#75](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/75)) ([3398c02](3398c02))
* **engine:** add support for disableScopeLowerCase ([commitizen#96](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/96)) ([e7bd546](e7bd546))
* **engine:** add support for disableSubjectLowerCase ([df66875](df66875))
* **engine.js:** add jira step ([b6c6bfb](b6c6bfb))
* **prompt:** add confirmation fields + edit for clarity ([commitizen#58](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/58)) ([d40ac2c](d40ac2c)), closes [commitizen#52](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/52)
* **types:** add suport for custom types ([commitizen#104](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/104)) ([aae2548](aae2548))

### BREAKING CHANGES

* Node 10 is LTS so please upgrade to it.
* **adapter:** Breaking changes now automatically include the "BREAKING CHANGE: " prefix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants