From f5880b7ff79cb51bc484fa6eed878d55ecb62a4f Mon Sep 17 00:00:00 2001 From: Jerome Fitzgerald Date: Sun, 28 Feb 2021 11:43:24 -0500 Subject: [PATCH] =?UTF-8?q?style:=20=F0=9F=92=84=20run=20`lint:fix`=20from?= =?UTF-8?q?=20prettier=20+=20eslint=20on=20codebase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Up next: 2 errors found in separate commit --- CHANGELOG.md | 114 +++++++++++++---------------------- README.md | 24 ++++---- build/readme.md | 19 ++---- lib/getConfig.js | 8 +-- lib/questions/scope.js | 4 +- lib/questions/subject.js | 3 +- lib/questions/type.js | 6 +- lib/runNonInteractiveMode.js | 5 +- lib/util/lerna.js | 25 ++++---- renovate.json | 4 +- test/testUtils.js | 5 +- 11 files changed, 89 insertions(+), 128 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7900a414..479f6f7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,198 +1,170 @@ ## [4.7.6](https://github.com/streamich/git-cz/compare/v4.7.5...v4.7.6) (2020-12-07) - ### Bug Fixes -* ๐Ÿ› move check for git folder to top ([cdf142c](https://github.com/streamich/git-cz/commit/cdf142cb8bbdc2186c04be31a443e79a377565d8)) +- ๐Ÿ› move check for git folder to top ([cdf142c](https://github.com/streamich/git-cz/commit/cdf142cb8bbdc2186c04be31a443e79a377565d8)) ## [4.7.5](https://github.com/streamich/git-cz/compare/v4.7.4...v4.7.5) (2020-11-30) - ### Bug Fixes -* ๐Ÿ› pad-right ([1891a62](https://github.com/streamich/git-cz/commit/1891a62641fd978c3f9b46dedfcc1123d5490fde)) -* ๐Ÿ› pad-right ([94b063c](https://github.com/streamich/git-cz/commit/94b063c69cef87b3f0a5dc688a6a0c18f1daaa96)) +- ๐Ÿ› pad-right ([1891a62](https://github.com/streamich/git-cz/commit/1891a62641fd978c3f9b46dedfcc1123d5490fde)) +- ๐Ÿ› pad-right ([94b063c](https://github.com/streamich/git-cz/commit/94b063c69cef87b3f0a5dc688a6a0c18f1daaa96)) ## [4.7.4](https://github.com/streamich/git-cz/compare/v4.7.3...v4.7.4) (2020-11-18) - ### Bug Fixes -* ๐Ÿ› add config option to change closed issue message ([#218](https://github.com/streamich/git-cz/issues/218)) ([dd88ce9](https://github.com/streamich/git-cz/commit/dd88ce967abed710c0fd3b784085567e5a2e0f4b)), closes [#215](https://github.com/streamich/git-cz/issues/215) +- ๐Ÿ› add config option to change closed issue message ([#218](https://github.com/streamich/git-cz/issues/218)) ([dd88ce9](https://github.com/streamich/git-cz/commit/dd88ce967abed710c0fd3b784085567e5a2e0f4b)), closes [#215](https://github.com/streamich/git-cz/issues/215) ## [4.7.3](https://github.com/streamich/git-cz/compare/v4.7.2...v4.7.3) (2020-11-11) - ### Bug Fixes -* ๐Ÿ› multiple lines on Windows ([#210](https://github.com/streamich/git-cz/issues/210)) ([838d47b](https://github.com/streamich/git-cz/commit/838d47b6c4fedf0d19d50ecf0e48a3afd22ba308)), closes [#188](https://github.com/streamich/git-cz/issues/188) [#197](https://github.com/streamich/git-cz/issues/197) +- ๐Ÿ› multiple lines on Windows ([#210](https://github.com/streamich/git-cz/issues/210)) ([838d47b](https://github.com/streamich/git-cz/commit/838d47b6c4fedf0d19d50ecf0e48a3afd22ba308)), closes [#188](https://github.com/streamich/git-cz/issues/188) [#197](https://github.com/streamich/git-cz/issues/197) ## [4.7.2](https://github.com/streamich/git-cz/compare/v4.7.1...v4.7.2) (2020-11-11) - ### Bug Fixes -* ๐Ÿ› disable-emoji config being overwritten by default ([#211](https://github.com/streamich/git-cz/issues/211)) ([eb9eb06](https://github.com/streamich/git-cz/commit/eb9eb06004579a0f73eaa7852c22e790414e3ddb)), closes [#207](https://github.com/streamich/git-cz/issues/207) +- ๐Ÿ› disable-emoji config being overwritten by default ([#211](https://github.com/streamich/git-cz/issues/211)) ([eb9eb06](https://github.com/streamich/git-cz/commit/eb9eb06004579a0f73eaa7852c22e790414e3ddb)), closes [#207](https://github.com/streamich/git-cz/issues/207) ## [4.7.1](https://github.com/streamich/git-cz/compare/v4.7.0...v4.7.1) (2020-08-26) - ### Bug Fixes -* ๐Ÿ› ignore "staged files check" when -a or --amend is passed ([206274f](https://github.com/streamich/git-cz/commit/206274ff1cfab9180fa3298f8cb9408e4971feca)), closes [#189](https://github.com/streamich/git-cz/issues/189) +- ๐Ÿ› ignore "staged files check" when -a or --amend is passed ([206274f](https://github.com/streamich/git-cz/commit/206274ff1cfab9180fa3298f8cb9408e4971feca)), closes [#189](https://github.com/streamich/git-cz/issues/189) # [4.7.0](https://github.com/streamich/git-cz/compare/v4.6.2...v4.7.0) (2020-06-18) - ### Features -* ๐ŸŽธ exit process when no files staged ([9fb4844](https://github.com/streamich/git-cz/commit/9fb4844758226798444ee74e16a0df1f3d9bc25b)) +- ๐ŸŽธ exit process when no files staged ([9fb4844](https://github.com/streamich/git-cz/commit/9fb4844758226798444ee74e16a0df1f3d9bc25b)) ## [4.6.2](https://github.com/streamich/git-cz/compare/v4.6.1...v4.6.2) (2020-05-28) - ### Bug Fixes -* ๐Ÿ› check for staged files ([78dec95](https://github.com/streamich/git-cz/commit/78dec9516b56cda86727534c76cf4f20f4f008c3)) -* ๐Ÿ› failing test (execSync not defined) ([b9b6969](https://github.com/streamich/git-cz/commit/b9b6969c05fe5d1dfc2687fa471190bde2a84c83)) +- ๐Ÿ› check for staged files ([78dec95](https://github.com/streamich/git-cz/commit/78dec9516b56cda86727534c76cf4f20f4f008c3)) +- ๐Ÿ› failing test (execSync not defined) ([b9b6969](https://github.com/streamich/git-cz/commit/b9b6969c05fe5d1dfc2687fa471190bde2a84c83)) ## [4.6.1](https://github.com/streamich/git-cz/compare/v4.6.0...v4.6.1) (2020-05-27) - ### Bug Fixes -* release revert of checking for staged files ([8a6ac6e](https://github.com/streamich/git-cz/commit/8a6ac6e3df1411bf910bb79360742aa34b1bc2a2)) +- release revert of checking for staged files ([8a6ac6e](https://github.com/streamich/git-cz/commit/8a6ac6e3df1411bf910bb79360742aa34b1bc2a2)) # [4.6.0](https://github.com/streamich/git-cz/compare/v4.5.0...v4.6.0) (2020-05-25) - ### Bug Fixes -* ๐Ÿ› test when in --dry-run mode ([1697c56](https://github.com/streamich/git-cz/commit/1697c561e8edc613d6087ab2ec84ab7617c0c1e5)) - +- ๐Ÿ› test when in --dry-run mode ([1697c56](https://github.com/streamich/git-cz/commit/1697c561e8edc613d6087ab2ec84ab7617c0c1e5)) ### Features -* ๐ŸŽธ check for staged files ([c283ad3](https://github.com/streamich/git-cz/commit/c283ad3fac13eaf00a899b49da474c7608a61708)) +- ๐ŸŽธ check for staged files ([c283ad3](https://github.com/streamich/git-cz/commit/c283ad3fac13eaf00a899b49da474c7608a61708)) # [4.5.0](https://github.com/streamich/git-cz/compare/v4.4.1...v4.5.0) (2020-05-16) - ### Features -* ๐ŸŽธ manually bump version ([fb05bfb](https://github.com/streamich/git-cz/commit/fb05bfb03ee428ef97b397873c9e88da2902212a)) -* ๐ŸŽธ recursively search parent folders for config file ([ce04676](https://github.com/streamich/git-cz/commit/ce0467639c56de19f0c9f227d86ef06b570f6790)), closes [#60](https://github.com/streamich/git-cz/issues/60) +- ๐ŸŽธ manually bump version ([fb05bfb](https://github.com/streamich/git-cz/commit/fb05bfb03ee428ef97b397873c9e88da2902212a)) +- ๐ŸŽธ recursively search parent folders for config file ([ce04676](https://github.com/streamich/git-cz/commit/ce0467639c56de19f0c9f227d86ef06b570f6790)), closes [#60](https://github.com/streamich/git-cz/issues/60) ## [4.4.1](https://github.com/streamich/git-cz/compare/v4.4.0...v4.4.1) (2020-05-16) - ### Bug Fixes -* manually update version ([811025c](https://github.com/streamich/git-cz/commit/811025c962eab12af792c1d071438f26785266fb)) +- manually update version ([811025c](https://github.com/streamich/git-cz/commit/811025c962eab12af792c1d071438f26785266fb)) # [4.4.0](https://github.com/streamich/git-cz/compare/v4.3.1...v4.4.0) (2020-05-16) - ### Features -* ๐ŸŽธ add --disable-emoji to --help and parse from CLI ([82dd0c9](https://github.com/streamich/git-cz/commit/82dd0c94ba13c9694d258a9c710f7c94409fa327)) -* ๐ŸŽธ add disable emoji flag ([52a43d9](https://github.com/streamich/git-cz/commit/52a43d95d66a5e0d4a1e1fd92993bf11de102a35)) +- ๐ŸŽธ add --disable-emoji to --help and parse from CLI ([82dd0c9](https://github.com/streamich/git-cz/commit/82dd0c94ba13c9694d258a9c710f7c94409fa327)) +- ๐ŸŽธ add disable emoji flag ([52a43d9](https://github.com/streamich/git-cz/commit/52a43d95d66a5e0d4a1e1fd92993bf11de102a35)) ## [4.3.1](https://github.com/streamich/git-cz/compare/v4.3.0...v4.3.1) (2020-02-03) - ### Bug Fixes -* ๐Ÿ› fix git commit error ([b116ba0](https://github.com/streamich/git-cz/commit/b116ba0ed4206a173dfb63206ddf7c058e2046ba)) +- ๐Ÿ› fix git commit error ([b116ba0](https://github.com/streamich/git-cz/commit/b116ba0ed4206a173dfb63206ddf7c058e2046ba)) # [4.3.0](https://github.com/streamich/git-cz/compare/v4.2.0...v4.3.0) (2020-02-02) - ### Features -* ๐ŸŽธ add help & version flags ([799fff2](https://github.com/streamich/git-cz/commit/799fff2d9da4ec04ad7ee85b01172a038020ae89)) -* ๐ŸŽธ improve help screen ([1838c1c](https://github.com/streamich/git-cz/commit/1838c1c5cb96d37b116234bb1ebe06721035ca46)) +- ๐ŸŽธ add help & version flags ([799fff2](https://github.com/streamich/git-cz/commit/799fff2d9da4ec04ad7ee85b01172a038020ae89)) +- ๐ŸŽธ improve help screen ([1838c1c](https://github.com/streamich/git-cz/commit/1838c1c5cb96d37b116234bb1ebe06721035ca46)) # [4.2.0](https://github.com/streamich/git-cz/compare/v4.1.0...v4.2.0) (2020-01-20) - ### Bug Fixes -* ๐Ÿ› do not format body as undefined ([28d6e77](https://github.com/streamich/git-cz/commit/28d6e77ce7592d03c411b3f3c9cc69d1ea7c0e53)) - +- ๐Ÿ› do not format body as undefined ([28d6e77](https://github.com/streamich/git-cz/commit/28d6e77ce7592d03c411b3f3c9cc69d1ea7c0e53)) ### Features -* ๐ŸŽธ Allow emojis in non-interactive and set defaults ([08cf19c](https://github.com/streamich/git-cz/commit/08cf19c36de6c34b4502435d9b12097474db5829)) -* ๐ŸŽธ can set answers through CLI in default mode ([99238c2](https://github.com/streamich/git-cz/commit/99238c2c1d2c6ed2f5ee209261c297ef4feed712)) -* ๐ŸŽธ non-interactive mode ([61b40db](https://github.com/streamich/git-cz/commit/61b40db85d668d1a7aa62588f18ba2ec15ba4667)) +- ๐ŸŽธ Allow emojis in non-interactive and set defaults ([08cf19c](https://github.com/streamich/git-cz/commit/08cf19c36de6c34b4502435d9b12097474db5829)) +- ๐ŸŽธ can set answers through CLI in default mode ([99238c2](https://github.com/streamich/git-cz/commit/99238c2c1d2c6ed2f5ee209261c297ef4feed712)) +- ๐ŸŽธ non-interactive mode ([61b40db](https://github.com/streamich/git-cz/commit/61b40db85d668d1a7aa62588f18ba2ec15ba4667)) # [4.1.0](https://github.com/streamich/git-cz/compare/v4.0.0...v4.1.0) (2020-01-18) - ### Features -* use fuzzy search for scopes and types ([e6d615f](https://github.com/streamich/git-cz/commit/e6d615f6d1c3934c3b94a0126e32b777c5d4ae8f)) +- use fuzzy search for scopes and types ([e6d615f](https://github.com/streamich/git-cz/commit/e6d615f6d1c3934c3b94a0126e32b777c5d4ae8f)) # [4.0.0](https://github.com/streamich/git-cz/compare/v3.2.1...v4.0.0) (2020-01-16) - ### Bug Fixes -* ๐Ÿ› Adhere to lerna settings for workspaces directory ([4151235](https://github.com/streamich/git-cz/commit/415123502b5f00e3988fc49b4643c945f91185e3)), closes [#85](https://github.com/streamich/git-cz/issues/85) -* ๐Ÿ› fixes autocomplete prompt import ([91226ba](https://github.com/streamich/git-cz/commit/91226ba829723ebd15afec52eaf53bb8cc64e210)) -* ๐Ÿ› fixes scope's empty string answer issue ([53dd466](https://github.com/streamich/git-cz/commit/53dd4667be95b1f28e13a8aeb203b1a2c8762ccb)) -* ๐Ÿ› make semantic-release publish to NPM ([6f5c836](https://github.com/streamich/git-cz/commit/6f5c836256bc893b3e2a7e3b141842e03a790c4e)) -* ๐Ÿ› simplify semantic-release config ([3872978](https://github.com/streamich/git-cz/commit/387297890a597fd1ad2456e8948ac12fabc4bcb9)) -* remove emojis when disableEmoji is true ([62915be](https://github.com/streamich/git-cz/commit/62915be714fc9628c4dba06e37c59f4212e5a532)) - +- ๐Ÿ› Adhere to lerna settings for workspaces directory ([4151235](https://github.com/streamich/git-cz/commit/415123502b5f00e3988fc49b4643c945f91185e3)), closes [#85](https://github.com/streamich/git-cz/issues/85) +- ๐Ÿ› fixes autocomplete prompt import ([91226ba](https://github.com/streamich/git-cz/commit/91226ba829723ebd15afec52eaf53bb8cc64e210)) +- ๐Ÿ› fixes scope's empty string answer issue ([53dd466](https://github.com/streamich/git-cz/commit/53dd4667be95b1f28e13a8aeb203b1a2c8762ccb)) +- ๐Ÿ› make semantic-release publish to NPM ([6f5c836](https://github.com/streamich/git-cz/commit/6f5c836256bc893b3e2a7e3b141842e03a790c4e)) +- ๐Ÿ› simplify semantic-release config ([3872978](https://github.com/streamich/git-cz/commit/387297890a597fd1ad2456e8948ac12fabc4bcb9)) +- remove emojis when disableEmoji is true ([62915be](https://github.com/streamich/git-cz/commit/62915be714fc9628c4dba06e37c59f4212e5a532)) ### Continuous Integration -* ๐ŸŽก remove NPM semantic-release plugin for on release ([a9f23eb](https://github.com/streamich/git-cz/commit/a9f23eb96e45f8dba124a674bdf1c742fe51385e)) - +- ๐ŸŽก remove NPM semantic-release plugin for on release ([a9f23eb](https://github.com/streamich/git-cz/commit/a9f23eb96e45f8dba124a674bdf1c742fe51385e)) ### Features -* ๐ŸŽธ adds a feature to search for types ([f8c3452](https://github.com/streamich/git-cz/commit/f8c34521228460ffa72912012585acdbb6e40286)) -* ๐ŸŽธ adds git hooks support ([80176cd](https://github.com/streamich/git-cz/commit/80176cd3735c6a8988335964cfb6dbbaccce4703)), closes [#79](https://github.com/streamich/git-cz/issues/79) -* ๐ŸŽธ adds scope search in scopes question ([70bf18b](https://github.com/streamich/git-cz/commit/70bf18bb02881e2c566cfa8a1cb1af20d59b2af2)) - +- ๐ŸŽธ adds a feature to search for types ([f8c3452](https://github.com/streamich/git-cz/commit/f8c34521228460ffa72912012585acdbb6e40286)) +- ๐ŸŽธ adds git hooks support ([80176cd](https://github.com/streamich/git-cz/commit/80176cd3735c6a8988335964cfb6dbbaccce4703)), closes [#79](https://github.com/streamich/git-cz/issues/79) +- ๐ŸŽธ adds scope search in scopes question ([70bf18b](https://github.com/streamich/git-cz/commit/70bf18bb02881e2c566cfa8a1cb1af20d59b2af2)) ### BREAKING CHANGES -* ๐Ÿงจ Release new major +- ๐Ÿงจ Release new major ## [3.2.1](https://github.com/streamich/git-cz/compare/v3.2.0...v3.2.1) (2019-07-01) - ### Bug Fixes -* trigger again ([ee4cf18](https://github.com/streamich/git-cz/commit/ee4cf18)) -* trigger new release ([5457be9](https://github.com/streamich/git-cz/commit/5457be9)) +- trigger again ([ee4cf18](https://github.com/streamich/git-cz/commit/ee4cf18)) +- trigger new release ([5457be9](https://github.com/streamich/git-cz/commit/5457be9)) # [3.2.0](https://github.com/streamich/git-cz/compare/v3.1.1...v3.2.0) (2019-07-01) - ### Bug Fixes -* ๐Ÿ› don't add emoji to head only when "disableEmoji" is true ([45489c8](https://github.com/streamich/git-cz/commit/45489c8)) - +- ๐Ÿ› don't add emoji to head only when "disableEmoji" is true ([45489c8](https://github.com/streamich/git-cz/commit/45489c8)) ### Features -* ๐ŸŽธ added disableEmojis on config ([448873e](https://github.com/streamich/git-cz/commit/448873e)) +- ๐ŸŽธ added disableEmojis on config ([448873e](https://github.com/streamich/git-cz/commit/448873e)) ## [3.1.1](https://github.com/streamich/git-cz/compare/v3.1.0...v3.1.1) (2019-04-26) - ### Bug Fixes -* build binaries on Travis ([10194a8](https://github.com/streamich/git-cz/commit/10194a8)) +- build binaries on Travis ([10194a8](https://github.com/streamich/git-cz/commit/10194a8)) # [3.1.0](https://github.com/streamich/git-cz/compare/v3.0.1...v3.1.0) (2019-04-26) - ### Features -* ๐ŸŽธ build binaries ([0a64804](https://github.com/streamich/git-cz/commit/0a64804)) +- ๐ŸŽธ build binaries ([0a64804](https://github.com/streamich/git-cz/commit/0a64804)) diff --git a/README.md b/README.md index f235905c..fef0d5d3 100644 --- a/README.md +++ b/README.md @@ -78,54 +78,54 @@ module.exports = { chore: { description: 'Build process or auxiliary tool changes', emoji: '๐Ÿค–', - value: 'chore' + value: 'chore', }, ci: { description: 'CI related changes', emoji: '๐ŸŽก', - value: 'ci' + value: 'ci', }, docs: { description: 'Documentation only changes', emoji: 'โœ๏ธ', - value: 'docs' + value: 'docs', }, feat: { description: 'A new feature', emoji: '๐ŸŽธ', - value: 'feat' + value: 'feat', }, fix: { description: 'A bug fix', emoji: '๐Ÿ›', - value: 'fix' + value: 'fix', }, perf: { description: 'A code change that improves performance', emoji: 'โšก๏ธ', - value: 'perf' + value: 'perf', }, refactor: { description: 'A code change that neither fixes a bug or adds a feature', emoji: '๐Ÿ’ก', - value: 'refactor' + value: 'refactor', }, release: { description: 'Create a release commit', emoji: '๐Ÿน', - value: 'release' + value: 'release', }, style: { description: 'Markup, white-space, formatting, missing semi-colons...', emoji: '๐Ÿ’„', - value: 'style' + value: 'style', }, test: { description: 'Adding missing tests', emoji: '๐Ÿ’', - value: 'test' - } - } + value: 'test', + }, + }, }; ``` diff --git a/build/readme.md b/build/readme.md index f18bfc03..74307f14 100644 --- a/build/readme.md +++ b/build/readme.md @@ -2,14 +2,12 @@ # git-cz - ### Without installation ```shell npx git-cz ``` - ### Install globally standalone ```shell @@ -17,7 +15,6 @@ npm install -g git-cz git-cz ``` - ### Install locally with Commitizen ```shell @@ -33,7 +30,7 @@ npm install --save-dev git-cz "commitizen": { "path": "git-cz" } - }, + } } ``` @@ -43,7 +40,6 @@ run: git cz ``` - ### Install globally with Commitizen ```shell @@ -57,12 +53,10 @@ run: git cz ``` - ## Example ![](./docs/example.png) - ## Custom config You can provide custom configuration in `changelog.congfig.js` file @@ -72,11 +66,10 @@ in your repo. Below is default config: return scripts.config(); ``` - ## Commit Message Format -* A commit message consists of a **header**, **body** and **footer**. -* The header has a **type** and a **subject**: +- A commit message consists of a **header**, **body** and **footer**. +- The header has a **type** and a **subject**: ``` [()]: @@ -108,8 +101,8 @@ return scripts.types(); The subject contains succinct description of the change: -* Use the imperative, present tense: "change" not "changed" nor "changes" -* No dot (.) at the end. +- Use the imperative, present tense: "change" not "changed" nor "changes" +- No dot (.) at the end. ### Body @@ -128,8 +121,6 @@ Select the packages the commit affected. The footer is the place to reference any tasks related to this commit. - - ## Why this Fork? ``` diff --git a/lib/getConfig.js b/lib/getConfig.js index cb753e81..8816dcd2 100644 --- a/lib/getConfig.js +++ b/lib/getConfig.js @@ -4,11 +4,7 @@ const fs = require('fs'); const signale = require('signale'); const defaults = require('./defaults'); -const configFiles = [ - '.git-cz.json', - 'changelog.config.js', - 'changelog.config.json' -]; +const configFiles = ['.git-cz.json', 'changelog.config.js', 'changelog.config.json']; const findOverrides = (root) => { const dir = root || process.cwd(); @@ -36,7 +32,7 @@ const findOverrides = (root) => { if (changelog) { return changelog; } - // eslint-disable-next-line no-empty + // eslint-disable-next-line no-empty } catch (error) {} } diff --git a/lib/questions/scope.js b/lib/questions/scope.js index d0b9a46e..7523fb44 100644 --- a/lib/questions/scope.js +++ b/lib/questions/scope.js @@ -7,7 +7,9 @@ const fuzzy = require('fuzzy'); * @param {string[]} scopes Scopes list. */ const findScope = function (substring, scopes) { - return Promise.resolve(fuzzy.filter(substring || '', scopes).map(({original: scope}) => scope)); + return Promise.resolve( + fuzzy.filter(substring || '', scopes).map(({original: scope}) => scope) + ); }; exports.createQuestion = (state) => { diff --git a/lib/questions/subject.js b/lib/questions/subject.js index 26de39b4..c53a8398 100644 --- a/lib/questions/subject.js +++ b/lib/questions/subject.js @@ -27,7 +27,8 @@ exports.createQuestion = (state) => { message: 'Write a short, imperative mood description of the change:', name: 'subject', type: 'limitedInput', - validate: (input) => input.length >= config.minMessageLength || minTitleLengthErrorMessage + validate: (input) => + input.length >= config.minMessageLength || minTitleLengthErrorMessage }; return question; diff --git a/lib/questions/type.js b/lib/questions/type.js index 2f8daab0..e432f895 100644 --- a/lib/questions/type.js +++ b/lib/questions/type.js @@ -19,7 +19,11 @@ const typeToListItem = ({types, disableEmoji}, type) => { const findType = function (substring, config) { const types = config.list; - return Promise.resolve(fuzzy.filter(substring || '', types).map(({original: type}) => typeToListItem(config, type))); + return Promise.resolve( + fuzzy + .filter(substring || '', types) + .map(({original: type}) => typeToListItem(config, type)) + ); }; exports.createQuestion = (state) => { diff --git a/lib/runNonInteractiveMode.js b/lib/runNonInteractiveMode.js index f3de073e..4577b85a 100644 --- a/lib/runNonInteractiveMode.js +++ b/lib/runNonInteractiveMode.js @@ -1,4 +1,7 @@ -const runNonInteractiveMode = (state, {type = 'chore', subject = 'automated commit', ...restAnswers}) => { +const runNonInteractiveMode = ( + state, + {type = 'chore', subject = 'automated commit', ...restAnswers} +) => { const answers = { subject, type, diff --git a/lib/util/lerna.js b/lib/util/lerna.js index 51f8f1e7..e33ef57d 100755 --- a/lib/util/lerna.js +++ b/lib/util/lerna.js @@ -2,8 +2,7 @@ const {execSync} = require('child_process'); const path = require('path'); const fs = require('fs'); -const isLerna = (state) => - fs.existsSync(path.join(state.root, 'lerna.json')); +const isLerna = (state) => fs.existsSync(path.join(state.root, 'lerna.json')); const isDir = (root) => (name) => { const filepath = path.join(root, name); @@ -17,9 +16,7 @@ const isDir = (root) => (name) => { } }; -const removeLastDirectoryPartOf = (url) => { - return url.substring(0, url.lastIndexOf('/')); -} +const removeLastDirectoryPartOf = (url) => url.substring(0, url.lastIndexOf('/')); const getPackageDirectory = (state) => { const pkgFilename = path.join(state.root, 'package.json'); @@ -30,15 +27,14 @@ const getPackageDirectory = (state) => { if (packagesDirectory) { // Remove the /* on the tail - return removeLastDirectoryPartOf("" + packagesDirectory); + return removeLastDirectoryPartOf(String(packagesDirectory)); } - // eslint-disable-next-line no-empty - } catch (error) { - } + // eslint-disable-next-line no-empty + } catch (error) {} } - return "packages"; -} + return 'packages'; +}; const getAllPackages = (state) => { try { @@ -51,17 +47,18 @@ const getAllPackages = (state) => { }; const getChangedFiles = () => { - const devNull = process.platform === 'win32' ? ' nul' : '/dev/null' + const devNull = process.platform === 'win32' ? ' nul' : '/dev/null'; + return execSync('git diff --cached --name-only 2>' + devNull) .toString() .trim() .split('\n'); -} +}; const getChangedPackages = (state) => { const unique = {}; const changedFiles = getChangedFiles(); - const regex = new RegExp("^"+ getPackageDirectory(state) +"\/([^/]+)\/", "is"); + const regex = new RegExp('^' + getPackageDirectory(state) + '/([^/]+)/', 'is'); for (const filename of changedFiles) { const matches = filename.match(regex); diff --git a/renovate.json b/renovate.json index 3d1bae41..65819cbf 100644 --- a/renovate.json +++ b/renovate.json @@ -1,7 +1,5 @@ { - "extends": [ - "config:base" - ], + "extends": ["config:base"], "automerge": true, "pinVersions": false, "major": { diff --git a/test/testUtils.js b/test/testUtils.js index d1253b72..36969ad2 100644 --- a/test/testUtils.js +++ b/test/testUtils.js @@ -10,10 +10,7 @@ exports.keys = { exports.runCLI = (args = []) => { const CLI_PATH = path.join(__dirname, '/../lib/cli'); - const {promise, stdin} = spawn('node', [ - CLI_PATH, - ...args - ]); + const {promise, stdin} = spawn('node', [CLI_PATH, ...args]); const getResult = async () => { const {stdout} = await promise;