Code Monkey home page Code Monkey logo

commit-analyzer's Introduction

commit-analyzer

semantic-release plugin to analyze commits with conventional-changelog

Build Status npm latest version npm next version npm beta version

Step Description
analyzeCommits Determine the type of release by analyzing commits with conventional-changelog.

Install

$ npm install @semantic-release/commit-analyzer -D

Usage

The plugin can be configured in the semantic-release configuration file:

{
  "plugins": [
    [
      "@semantic-release/commit-analyzer",
      {
        "preset": "angular",
        "releaseRules": [
          { "type": "docs", "scope": "README", "release": "patch" },
          { "type": "refactor", "release": "patch" },
          { "type": "style", "release": "patch" }
        ],
        "parserOpts": {
          "noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
        }
      }
    ],
    "@semantic-release/release-notes-generator"
  ]
}

With this example:

  • the commits that contains BREAKING CHANGE or BREAKING CHANGES in their body will be considered breaking changes.
  • the commits with a 'docs' type, a 'README' scope will be associated with a patch release
  • the commits with a 'refactor' type will be associated with a patch release
  • the commits with a 'style' type will be associated with a patch release

Note: Your commits must be formatted exactly as specified by the chosen convention. For example the Angular Commit Message Conventions require the BREAKING CHANGE keyword to be followed by a colon (:) and to be in the footer of the commit message.

Configuration

Options

Option Description Default
preset conventional-changelog preset (possible values: angular, atom, codemirror, ember, eslint, express, jquery, jshint, conventionalcommits). angular
config npm package name of a custom conventional-changelog preset. -
parserOpts Additional conventional-commits-parser options that will extends the ones loaded by preset or config. This is convenient to use a conventional-changelog preset with some customizations without having to create a new module. -
releaseRules An external module, a path to a module or an Array of rules. See releaseRules. See releaseRules
presetConfig Additional configuration passed to the conventional-changelog preset. Used for example with conventional-changelog-conventionalcommits. -

Notes: in order to use a preset it must be installed (for example to use the eslint preset you must install it with npm install conventional-changelog-eslint -D)

Note: config will be overwritten by the values of preset. You should use either preset or config, but not both.

Note: Individual properties of parserOpts will override ones loaded with an explicitly set preset or config. If preset or config are not set, only the properties set in parserOpts will be used.

Note: For presets that expects a configuration object, such as conventionalcommits, the presetConfig option must be set.

releaseRules

Release rules are used when deciding if the commits since the last release warrant a new release. If you define custom release rules the default rules will be used if nothing matched. Those rules will be matched against the commit objects resulting of conventional-commits-parser parsing. Each rule property can be defined as a glob.

Rules definition

This is an Array of rule objects. A rule object has a release property and 1 or more criteria.

{
  "plugins": [
    [
      "@semantic-release/commit-analyzer",
      {
        "preset": "angular",
        "releaseRules": [
          { "type": "docs", "scope": "README", "release": "patch" },
          { "type": "refactor", "scope": "core-*", "release": "minor" },
          { "type": "refactor", "release": "patch" },
          { "scope": "no-release", "release": false }
        ]
      }
    ],
    "@semantic-release/release-notes-generator"
  ]
}
Rules matching

Each commit will be compared with each rule and when it matches, the commit will be associated with the release type in the rule's release property. If a commit match multiple rules, the highest release type (major > minor > patch) is associated with the commit.

See release types for the release types hierarchy.

With the previous example:

  • Commits with type 'docs' and scope 'README' will be associated with a patch release.
  • Commits with type 'refactor' and scope starting with 'core-' (i.e. 'core-ui', 'core-rules', ...) will be associated with a minor release.
  • Other commits with type 'refactor' (without scope or with a scope not matching the glob core-*) will be associated with a patch release.
  • Commits with scope no-release will not be associated with a release type.
Default rules matching

If a commit doesn't match any rule in releaseRules it will be evaluated against the default release rules.

With the previous example:

  • Commits with a breaking change will be associated with a major release.
  • Commits with type 'feat' will be associated with a minor release.
  • Commits with type 'fix' will be associated with a patch release.
  • Commits with type 'perf' will be associated with a patch release.
  • Commits with scope no-release will not be associated with a release type even if they have a breaking change or the type 'feat', 'fix' or 'perf'.
No rules matching

If a commit doesn't match any rules in releaseRules or in default release rules then no release type will be associated with the commit.

With the previous example:

  • Commits with type 'style' will not be associated with a release type.
  • Commits with type 'test' will not be associated with a release type.
  • Commits with type 'chore' will not be associated with a release type.
Multiple commits

If there is multiple commits that match one or more rules, the one with the highest release type will determine the global release type.

Considering the following commits:

  • docs(README): Add more details to the API docs
  • feat(API): Add a new method to the public API

With the previous example the release type determined by the plugin will be minor.

Specific commit properties

The properties to set in the rules will depends on the commit style chosen. For example conventional-changelog-angular use the commit properties type, scope and subject but conventional-changelog-eslint uses tag and message.

For example with eslint preset:

{
  "plugins": [
    [
      "@semantic-release/commit-analyzer",
      {
        "preset": "eslint",
        "releaseRules": [
          { "tag": "Docs", "message": "*README*", "release": "patch" },
          { "tag": "New", "release": "patch" }
        ]
      }
    ],
    "@semantic-release/release-notes-generator"
  ]
}

With this configuration:

  • Commits with tag 'Docs', that contains 'README' in their header message will be associated with a patch release.
  • Commits with tag 'New' will be associated with a patch release.
  • Commits with tag 'Breaking' will be associated with a major release (per default release rules).
  • Commits with tag 'Fix' will be associated with a patch release (per default release rules).
  • Commits with tag 'Update' will be associated with a minor release (per default release rules).
  • All other commits will not be associated with a release type.
External package / file

releaseRules can also reference a module, either by it's npm name or path:

{
  "plugins": [
    [
      "@semantic-release/commit-analyzer",
      {
        "preset": "angular",
        "releaseRules": "./config/release-rules.cjs"
      }
    ],
    "@semantic-release/release-notes-generator"
  ]
}
// File: config/release-rules.cjs
module.exports = [
  { type: "docs", scope: "README", release: "patch" },
  { type: "refactor", scope: "core-*", release: "minor" },
  { type: "refactor", release: "patch" },
];

commit-analyzer's People

Contributors

abel-mak avatar alexanderbabel avatar cumpsd avatar dependabot[bot] avatar gr2m avatar greenkeeper[bot] avatar greenkeeperio-bot avatar hershmire avatar inf3cti0n95 avatar jwalton avatar landau avatar limonte avatar matzkoh avatar mehrad-rafigh avatar oscard0m avatar pvdlg avatar reconbot avatar renovate[bot] avatar sheerlox avatar skeggse avatar travi avatar trescenzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

commit-analyzer's Issues

An in-range update of prettier is breaking the build 🚨

Version 1.7.1 of prettier just got published.

Branch Build failing 🚨
Dependency prettier
Current Version 1.7.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As prettier is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Analyze commits failing on a null

Semantic Release started failing on CircleCI, trying to figure out if its something due to running the beta versions of plugins or something wrong in my pipeline.

Version:

    "semantic-release": "16.0.0-beta.17",
    "@semantic-release/changelog": "3.0.2",
    "@semantic-release/commit-analyzer": "7.0.0-beta.1",
    "@semantic-release/github": "5.3.0-beta.7",
    "@semantic-release/npm": "5.2.0-beta.5",
    "@semantic-release/release-notes-generator": "7.1.4",

This is the error I am getting:

#!/bin/bash -eo pipefail
npm run semantic-release


> [email protected] semantic-release /home/circleci/project/status-board
> semantic-release

[04:34:41] [semantic-release] › ℹ  Running semantic-release version 16.0.0-beta.17
[04:34:41] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/npm"
[04:34:41] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
[04:34:41] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[04:34:41] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[04:34:41] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/npm"
[04:34:41] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/npm"
[04:34:41] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
[04:34:41] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/npm"
[04:34:41] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[04:34:41] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
[04:34:41] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[04:34:50] [semantic-release] › ✔  Run automated release from branch master
[04:34:55] [semantic-release] › ✔  Allowed to push to the Git repository
[04:34:55] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/npm"
[04:34:55] [semantic-release] [@semantic-release/npm] › ℹ  Verify authentication for registry https://registry.npmjs.org/
[04:34:55] [semantic-release] [@semantic-release/npm] › ℹ  Wrote NPM_TOKEN to /home/circleci/project/status-board/.npmrc
[04:34:56] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/npm"
[04:34:56] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/github"
[04:34:56] [semantic-release] [@semantic-release/github] › ℹ  Verify GitHub authentication
[04:34:56] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/github"
[04:34:56] [semantic-release] › ℹ  Found git tag v1.1.47 associated with version 1.1.47 on branch master
[04:34:56] [semantic-release] › ℹ  Found 19 commits since last release
[04:34:56] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[04:34:56] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: chore(package): Updated packages
[04:34:56] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[04:34:56] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: chore(package): Updated packages
[04:34:56] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[04:34:56] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Merge pull request #368 from jameswlane/renovate/master-jest-23.3.x

chore(deps): update dependency @types/jest to v23.3.13 (master)
[04:34:56] [semantic-release] › ✖  Failed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[04:34:56] [semantic-release] › ✖  An error occurred while running semantic-release: { TypeError: expected a string: "null"
    at Function.micromatch.isMatch (/home/circleci/project/status-board/node_modules/micromatch/index.js:156:11)
    at isMatchWith (/home/circleci/project/status-board/node_modules/@semantic-release/commit-analyzer/lib/analyze-commit.js:25:77)
    at baseIsMatch (/home/circleci/project/status-board/node_modules/lodash/lodash.js:3394:26)
    at isMatchWith (/home/circleci/project/status-board/node_modules/lodash/lodash.js:11862:14)
    at releaseRules.filter (/home/circleci/project/status-board/node_modules/@semantic-release/commit-analyzer/lib/analyze-commit.js:25:9)
    at Array.filter (<anonymous>)
    at module.exports (/home/circleci/project/status-board/node_modules/@semantic-release/commit-analyzer/lib/analyze-commit.js:18:6)
    at filter.every (/home/circleci/project/status-board/node_modules/@semantic-release/commit-analyzer/index.js:48:27)
    at Array.every (<anonymous>)
    at analyzeCommits (/home/circleci/project/status-board/node_modules/@semantic-release/commit-analyzer/index.js:33:5) pluginName: '@semantic-release/commit-analyzer' }
{ TypeError: expected a string: "null"
    at Function.micromatch.isMatch (/home/circleci/project/status-board/node_modules/micromatch/index.js:156:11)
    at isMatchWith (/home/circleci/project/status-board/node_modules/@semantic-release/commit-analyzer/lib/analyze-commit.js:25:77)
    at baseIsMatch (/home/circleci/project/status-board/node_modules/lodash/lodash.js:3394:26)
    at isMatchWith (/home/circleci/project/status-board/node_modules/lodash/lodash.js:11862:14)
    at releaseRules.filter (/home/circleci/project/status-board/node_modules/@semantic-release/commit-analyzer/lib/analyze-commit.js:25:9)
    at Array.filter (<anonymous>)
    at module.exports (/home/circleci/project/status-board/node_modules/@semantic-release/commit-analyzer/lib/analyze-commit.js:18:6)
    at filter.every (/home/circleci/project/status-board/node_modules/@semantic-release/commit-analyzer/index.js:48:27)
    at Array.every (<anonymous>)
    at analyzeCommits (/home/circleci/project/status-board/node_modules/@semantic-release/commit-analyzer/index.js:33:5) pluginName: '@semantic-release/commit-analyzer' }npm ERR! code ELIFECYCLE

Commit analyzer does not handle commits with empty messages

Current behavior

When commit-analyzer analyzes a commit that had been created using git commit --allow-empty-message --allow-empty, it encounters the following error:

[1:20:47 PM] [semantic-release] › ✖  An error occurred while running semantic-release: { TypeError: Expected a raw commit
    at parser (/usr/lib/node_modules/semantic-release/node_modules/conventional-commits-parser/lib/parser.js:79:11)
    at sync (/usr/lib/node_modules/semantic-release/node_modules/conventional-commits-parser/index.js:96:10)
    at commits.map (/usr/lib/node_modules/semantic-release/node_modules/@semantic-release/commit-analyzer/index.js:33:95)
    at Array.map (<anonymous>)
    at analyzeCommits (/usr/lib/node_modules/semantic-release/node_modules/@semantic-release/commit-analyzer/index.js:33:13)
    at process.internalTickCallback (internal/process/next_tick.js:77:7) pluginName: '@semantic-release/commit-analyzer' }
{ TypeError: Expected a raw commit
    at parser (/usr/lib/node_modules/semantic-release/node_modules/conventional-commits-parser/lib/parser.js:79:11)
    at sync (/usr/lib/node_modules/semantic-release/node_modules/conventional-commits-parser/index.js:96:10)
    at commits.map (/usr/lib/node_modules/semantic-release/node_modules/@semantic-release/commit-analyzer/index.js:33:95)
    at Array.map (<anonymous>)
    at analyzeCommits (/usr/lib/node_modules/semantic-release/node_modules/@semantic-release/commit-analyzer/index.js:33:13)
    at process.internalTickCallback (internal/process/next_tick.js:77:7) pluginName: '@semantic-release/commit-analyzer' }

Expected behavior

The tool should skip empty commits and handle commits created with empty messages. The use case for this is to make a dummy commit in order to kick off a CI/CD pipeline.

Environment

  • semantic-release version: 15.13.16
  • commit-analyzer version: 6.2.0 (also seen with 6.3.0)
  • CI environment: Running locally with --no-ci option

BREAKING CHANGE: Not Triggering Major Version Bump

I have Issue, I added BREAKING CHANGE: with more text, even then It did not trigger a major version bump. Here are logs to travis build

[3:14:37 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/github"
[3:14:38 PM] [semantic-release] › ℹ  Found git tag v1.1.0 associated with version 1.1.0
[3:14:38 PM] [semantic-release] › ℹ  Found 1 commits since last release
[3:14:38 PM] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[3:14:38 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: BREAKING CHANGE: Updated to RxJS 6, Bump Package Version
[3:14:38 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[3:14:38 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 1 commits complete: no release
[3:14:38 PM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[3:14:38 PM] [semantic-release] › ℹ  There are no relevant changes, so no new version is released.

Make patch release a default for each commit

Hi,

Thank you for such an excellent plugin. We have a dedicated prod branch where each commit should trigger a release. Currently, certain commit types (e.g. chore) do not trigger a release. Is it possible to configure commit analyzer to bump patch version by default for any type except "no-release"? I've tried something like this, but it's not working:

  [
      "@semantic-release/commit-analyzer",
      {
        "preset": "angular",
        "releaseRules": [
          {"scope": "no-release", "release": false},
          {"type": "*", "release": "patch"}
        ]
      }
    ],

Another option, is to list each type with release: "patch", but it's not as flexible as having a wildcard. Thank you very much!

Possible to ignore PR's title for analysis?

While using gitflow, it is common practice to merge changes to develop and once ready, create a single PR to merge to master.

Now, this PR's title is not relevant. What is relevant is the list of fixes that goes in this PR. So in this case, the PR's message actually contains the relevant commit types.

The current behavior simply looks at PR's title (which actually becomes the commit message once the PR is merged) and then ignores a release.

Is there a way to handle around this limitation?

How do people create bundled releases otherwise?

Can't find a release from commits

I'm having trouble convincing my configuration to see release-worthy commits. I have included a snippet from numerous attempts I've tried:

[2:41:56 AM] [semantic-release] › ℹ  No git tag version found
[2:41:56 AM] [semantic-release] › ℹ  No previous release found, retrieving all commits
[2:41:56 AM] [semantic-release] › ℹ  Found 21 commits since last release
[2:41:56 AM] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[2:41:56 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Merge pull request #6 from erodewald/base-features

feat: new feature (ci test)
[2:41:56 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[2:41:56 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: feat: new feature (ci test)

[2:41:56 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[2:41:56 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Merge pull request #5 from erodewald/base-features

feat: Remove emoji commit
[2:41:56 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[2:41:56 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: feat: Remove emoji commit
[2:41:56 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[2:41:56 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Merge pull request #4 from erodewald/base-features

:sparkles: feat: Add PR template
[2:41:56 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[2:41:56 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: :sparkles: feat: Add PR template
[2:41:56 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[2:41:56 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Merge pull request #3 from erodewald/base-features

At some point in the above, I abandoned emoji prefixes because I thought it might be messing up the analyzer. No dice.

package.json:

{
  "scripts": {
    "semantic-release": "semantic-release -e ./config/release.config.js"
  },
  "devDependencies": {
    "conventional-changelog-angular": "~5.0.3",
    "semantic-git-commit-cli": "3.1.1",
    "semantic-release": "^15.13.3",
    "sr-commit-analyzer": "^2.0.3",
    "sr-release-notes-generator": "^1.1.3",
  },
  "sgc": {
    "emoji": false,
    "lowercaseTypes": true,
    "rules": {
      "endWithDot": false
    }
  }
}

config/release.config.js:

module.exports = {
  preset: 'angular',
  analyzeCommits: {
    parserOpts: {
      // Optional, only you want to have emoji commit support
      headerPattern: /^(?::([\w-]*):)?\s*(\w*):\s*(.*)$/,
      headerCorrespondence: ['emoji', 'tag', 'message']
    }
  },
  generateNotes: {
    parserOpts: {
      // Optional, only you want to have emoji commit support
      headerPattern: /^(?::([\w-]*):)?\s*(\w*):\s*(.*)$/,
      headerCorrespondence: ['emoji', 'tag', 'message']
    }
  }
}

I'm sure I have misconfigured it, but I'm just not seeing what's tripping up the commit analyzer. Help would be great :)

"Breaking Change" not triggering major release

Current behavior

Using the following .releaserc.json file

{
  "analyzeCommits": {
    "preset": "angular",
    "releaseRules": [
      {"type": "feat", "release": "minor"},
      {"type": "fix", "release": "patch"},
      {"type": "perf", "release": "patch"},
      {"type": "docs", "release": "patch"},
      {"type": "chore", "release": false},
      {"type": "test", "release": false},
      {"type": "refactor", "release": false},
      {"type": "ci", "release": false},
      {"type": "amend", "release": false},
      {"scope": "no-release", "release": false}
    ],
    "parserOpts": {"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]}
  }
}

breaking changes seem to not trigger a major release. Not sure if this is a bug or a configuration issue, please advice.

Expected behavior

Expecting a major release

Environment

conventional-changelog-conventionalcommits support?

It seems that package isn't supported, but is available at https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits

When using conventionalcommits as the preset option, I run into the problem below, where it stops execution early at the last step below.

[1:26:48 PM] [semantic-release] › ℹ  Running semantic-release version 15.13.18
[1:26:48 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/changelog"
[1:26:48 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
[1:26:48 PM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[1:26:48 PM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[1:26:48 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/changelog"
[1:26:48 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
[1:26:48 PM] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
[1:26:48 PM] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[1:26:48 PM] [semantic-release] › ⚠  Run automated release from branch feature/semantic-release in dry-run mode
[1:26:50 PM] [semantic-release] › ✔  Allowed to push to the Git repository
[1:26:50 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/changelog"
[1:26:50 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/changelog"
[1:26:50 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/github"
[1:26:50 PM] [semantic-release] [@semantic-release/github] › ℹ  Verify GitHub authentication
[1:26:50 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/github"
[1:26:51 PM] [semantic-release] › ℹ  Found git tag v0.4.1 associated with version 0.4.1
[1:26:51 PM] [semantic-release] › ℹ  Found 10 commits since last release
[1:26:51 PM] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"

It seems that if loadedConfig in load-parser-config is a function, it attempts to promisify the function. However, it looks like the config being returned here is already a Promise: https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-conventionalcommits/index.js

Version confusion surrounding: expected a string: "null"

So after getting my Azure Pipeline up and running smoothly (sort of), I stumbled upon another problem with the commit-analyzer. I read #111 as the issue is identical. But for some reason I can't seem to get it working with either version: 7.0.0-beta.1 nor 7.0.0-beta-.2. For some weird reason using a fresh yarn init and running yarn add @semantic-release/commit-analyzer@beta it installs the correct version, but the content in the node_modules is not what I expect. Looking at the source assets from the GitHub release this line:

isString(src) && isString(obj) ? micromatch.isMatch(obj, src) : undefined
is not present in my fresh install. The isString(obj) is still missing which results in expected a string: "null" for commits containing type: null. I've tried to do a yarn cache clean` to see if that does anything, but no dice.

After a fresh install adding the beta-version of commit-analyzer the file analyze-commit.js:

const {isMatchWith, isString} = require('lodash');
const micromatch = require('micromatch');
const debug = require('debug')('semantic-release:commit-analyzer');
const RELEASE_TYPES = require('./default-release-types');
const compareReleaseTypes = require('./compare-release-types');

/**
 * Find all the rules matching and return the highest release type of the matching rules.
 *
 * @param {Array} releaseRules the rules to match the commit against.
 * @param {Commit} commit a parsed commit.
 * @return {string} the highest release type of the matching rules or `undefined` if no rule match the commit.
 */
module.exports = (releaseRules, commit) => {
  let releaseType;

  releaseRules
    .filter(
      ({breaking, revert, release, ...rule}) =>
        // If the rule is not `breaking` or the commit doesn't have a breaking change note
        (!breaking || (commit.notes && commit.notes.length > 0)) &&
        // If the rule is not `revert` or the commit is not a revert
        (!revert || commit.revert) &&
        // Otherwise match the regular rules
        isMatchWith(commit, rule, (obj, src) => (isString(src) ? micromatch.isMatch(obj, src) : undefined))
    )
    .every(match => {
      if (compareReleaseTypes(releaseType, match.release)) {
        releaseType = match.release;
        debug('The rule %o match commit with release type %o', match, releaseType);
        if (releaseType === RELEASE_TYPES[0]) {
          debug('Release type %o is the highest possible. Stop analysis.', releaseType);
          return false;
        }
      } else {
        debug(
          'The rule %o match commit with release type %o but the higher release type %o has already been found for this commit',
          match,
          match.release,
          releaseType
        );
      }
      return true;
    });

  return releaseType;
};

An in-range update of eslint-config-pretty is breaking the build 🚨

Version 2.1.0 of eslint-config-pretty just got published.

Branch Build failing 🚨
Dependency eslint-config-pretty
Current Version 2.0.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-config-pretty is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes v2.1.0

2.1.0 (2017-09-02)

✨ Features

  • base: Add function-paren-newline rule (a105db7), closes #25

🚨 Tests

  • Use nyc configuration from package.json (cd8e074)

⚙️ Continuous Integrations

  • travis: Retry npm install if it fails (28da4ad)

♻️ Chores

  • package: update eslint to version 4.6.0 (7131c2f)
Commits

The new version differs by 4 commits.

  • a105db7 feat(base): Add function-paren-newline rule
  • 7131c2f chore(package): update eslint to version 4.6.0
  • 28da4ad ci(travis): Retry npm install if it fails
  • cd8e074 test: Use nyc configuration from package.json

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of sinon is breaking the build 🚨

Version 4.1.6 of sinon was just published.

Branch Build failing 🚨
Dependency sinon
Current Version 4.1.5
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 10 commits.

  • 68c37ed Update docs/changelog.md and set new release id in docs/_config.yml
  • cd8ae51 Add release documentation for v4.1.6
  • 29e80be 4.1.6
  • a5c59a5 Update History.md and AUTHORS for new release
  • 0ae60b6 Merge pull request #1653 from mroderick/upgrade-dependencies
  • dcd4191 Upgrade browserify to latest
  • a316f02 Upgrade markdownlint-cli to latest
  • 78ebdb3 Upgrade lint-staged to latest
  • fcf967b Upgrade dependency supports-color
  • 7c3cb4f Enable StaleBot with default configuration (#1649)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

rules skipped if commit message contains '/'

The below release rules works well, until the commit message has a '/' in it.
For ex BUGFIX-RELEASE: wait to set up event emitter until calling /process
Here are the logs in this case:

[9:47:58 PM] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
328[9:47:58 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: BUGFIX-RELEASE: wait to set up event emitter until calling /process (#15)
329
330* wait to set up event emitter until calling /process
334* add tests
335
336* small fixes
3372020-05-21T21:47:58.969Z semantic-release:commit-analyzer Analyzing with custom rules
3382020-05-21T21:47:58.971Z semantic-release:commit-analyzer Analyzing with default rules
339[9:47:58 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release

My release rules looks like this:

 ["@semantic-release/commit-analyzer", {
        "preset": "eslint",
        "releaseRules": [
        {
          "subject": "*",
          "release": false
        },
        {
          "subject": "FEATURE-RELEASE:*",
          "release": "minor"
        },
        {
          "subject": "BUGFIX-RELEASE:*",
          "release": "patch"
        },
        {
          "subject": "BREAKING-RELEASE:*",
          "release": "major"
        }
        ]
      }]

Breaking Change not triggering when using custom releaseRules

Hello! first of all thank all the work that is behind commit-analuyzer, is helping us a lot with our processes of Builds and automatic deploys.

We are facing a "bug" or perhaps an misunderstood of the README. Having the following configuration:

image

A refactor type commit does not trigger a Breaking Change (major):

image

Could someone tell us what's happening?

Thanks a lot!

using custom commit types

is there a way to use custom commit types?

Ex:
dep-add(npm): :heavy_plus_sign: add cz-emoji npm package
config(semantic-release): :wrench: add @semantic-release/analyze-commits plugin

dep-add(npm): ➕ add cz-emoji npm package
config(semantic-release): 🔧 add @semantic-release/analyze-commits plugin

other commit types cz-emoji

Is there CLI alternative to commit-analyzer?

We have a custom script with some tricky steps which accepts the version number as an argument, something like this:

./custom-release-script.js 1.2.3

I would like to run that script from CI, and I need a tool which will do the same as commit-analyzer but standlalone, without semantic-release, something like

$ yarn what-is-the-next-release-version
1.2.3

Do you maybe know something like this?

PS. sorry for the kinda offtopic question, I'm not able to find the tool and I don't know the better place to ask :)

Ignore default rules

Good day -

I'm looking for support. The documentation states:

If you define custom release rules the default rules will be used if nothing matched.

Is it possible to disable/override that behavior? My goal is to set this plugin t to match for specific scope. In other words, the commit analyzer should only match commits that look something like fix(service/deps): Use [email protected]. The plugin should not match a commit that looks like fix(deps): Use [email protected] or anything without a scope of service*. I'm using specific scopes because my particular use case is within a monorepo and certain packages should not be published if the commit is unrelated.

"plugins": [
    [
      "@semantic-release/commit-analyzer",
      {
        "preset": "angular",
        "releaseRules": [
          { "breaking": true, "scope": "/service.*/", "release": "major" },
          { "revert": true, "scope": "/service.*/", "release": "patch" },
          { "type": "feat", "scope": "/service.*/", "release": "minor" },
          { "type": "fix", "scope": "/service.*/", "release": "patch" },
          { "type": "perf", "scope": "/service.*/", "release": "patch" }
        ]
      }
    ]
]

Thanks for your time.

An in-range update of semantic-release is breaking the build 🚨

Version 15.9.5 of semantic-release was just published.

Branch Build failing 🚨
Dependency semantic-release
Current Version 15.9.4
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes v15.9.5

15.9.5 (2018-08-05)

Bug Fixes

  • do not clone stdout/stderr passed to pugins (63d422e)
Commits

The new version differs by 1 commits.

  • 63d422e fix: do not clone stdout/stderr passed to pugins

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Strict mode: fail when commit does not match any rule

I couldn't find any obvious clues, so sorry, if this has been covered before... Or if I missed some existing functionality.

Docs say:

If a commit doesn't match any rules in releaseRules or in default release rules then no release type will be associated with the commit.

Would you accept a PR which adds a "strict" mode for this, i.e. makes this throw when there are commits that don't match any rules? There might also be a use case to throw if there are no commits that match a rule.

I would use that for semantic-release --verify at PR stage so that there's no need to install and duplicate existing functionality via e.g. semantic-commitlint.

"BREAKING CHANGE: " keyword does not trigger major version bump

Steps to reproduce:

git clone https://github.com/sweetalert2/sweetalert2.git
npm i -g [email protected] @semantic-release/changelog@3 @semantic-release/exec@3 @semantic-release/git@7;
semantic-release

Output:

[2:49:40 PM] [semantic-release] » i  Running semantic-release version 16.0.0-beta.16
[2:49:41 PM] [semantic-release] » √  Loaded plugin "verifyConditions" from "@semantic-release/changelog"
[2:49:41 PM] [semantic-release] » √  Loaded plugin "verifyConditions" from "@semantic-release/npm"
[2:49:41 PM] [semantic-release] » √  Loaded plugin "verifyConditions" from "@semantic-release/github"
[2:49:41 PM] [semantic-release] » √  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[2:49:41 PM] [semantic-release] » √  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[2:49:41 PM] [semantic-release] » √  Loaded plugin "prepare" from "@semantic-release/exec"
[2:49:41 PM] [semantic-release] » √  Loaded plugin "prepare" from "@semantic-release/changelog"
[2:49:41 PM] [semantic-release] » √  Loaded plugin "prepare" from "@semantic-release/npm"
[2:49:42 PM] [semantic-release] » √  Loaded plugin "prepare" from "@semantic-release/git"
[2:49:42 PM] [semantic-release] » √  Loaded plugin "publish" from "@semantic-release/npm"
[2:49:42 PM] [semantic-release] » √  Loaded plugin "publish" from "@semantic-release/github"
[2:49:42 PM] [semantic-release] » √  Loaded plugin "addChannel" from "@semantic-release/npm"
[2:49:42 PM] [semantic-release] » √  Loaded plugin "addChannel" from "@semantic-release/github"
[2:49:42 PM] [semantic-release] » √  Loaded plugin "success" from "@semantic-release/github"
[2:49:42 PM] [semantic-release] » √  Loaded plugin "success" from "@semantic-release/exec"
[2:49:42 PM] [semantic-release] » √  Loaded plugin "fail" from "@semantic-release/github"
[2:51:03 PM] [semantic-release] » ‼  Run automated release from branch master in dry-run mode
[2:51:11 PM] [semantic-release] » √  Allowed to push to the Git repository
[2:51:11 PM] [semantic-release] » i  Start step "verifyConditions" of plugin "@semantic-release/changelog"
[2:51:11 PM] [semantic-release] » √  Completed step "verifyConditions" of plugin "@semantic-release/changelog"
[2:51:11 PM] [semantic-release] » i  Start step "verifyConditions" of plugin "@semantic-release/npm"
[2:51:11 PM] [semantic-release] [@semantic-release/npm] » i  Verify authentication for registry https://registry.npmjs.org/
[2:51:13 PM] [semantic-release] » √  Completed step "verifyConditions" of plugin "@semantic-release/npm"
[2:51:13 PM] [semantic-release] » i  Start step "verifyConditions" of plugin "@semantic-release/github"
[2:51:13 PM] [semantic-release] [@semantic-release/github] » i  Verify GitHub authentication
[2:51:14 PM] [semantic-release] » √  Completed step "verifyConditions" of plugin "@semantic-release/github"
[2:51:14 PM] [semantic-release] » i  Found git tag v7.33.1 associated with version 7.33.1 on branch master
[2:51:14 PM] [semantic-release] » i  Found 26 commits since last release
[2:51:14 PM] [semantic-release] » i  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: BREAKING CHANGE: drop Bower support (#1377)

semantic-release from master branch, dist branch was needed to support Bower
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: chore(deps): drop detect-browser dependency (#1374)

We are detecting IE11 only, no need for
the additional dependency for that simple task.
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: chore: remove withGlobalDefaults enhancer
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: BREAKING CHANGE: remove withNoNewKeyword enhancer (#1372)

From now on the recommended way to use SweetAlert2 is:

Swal.fire({...options})
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: chore: import/export .js files explicitly

Needed for ES modules
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: BREAKING CHANGE: remove swal.noop()
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: chore: remove legacy adaptInputValidator (#1371)
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: BREAKING CHANGE: rename $swal2-validationerror -> $swal2-validation-message (#1370)
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: BREAKING CHANGE: remove getButtonsWrapper()
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: BREAKING CHANGE: remove setDefault and resetDefaults (#1365)
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: BREAKING CHANGE: remove extraParams (#1363)
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: BREAKING CHANGE: remove showValidationError and resetValidationError (#1367)
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: chore(travis): decrease max bundlesize 16KB -> 15KB
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: BREAKING CHANGE: remove useRejections and expectRejections (#1362)
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: BREAKING CHANGE: dismissReason: overlay -> backdrop (#1360)
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: BREAKING CHANGE: drop Android 4.4 support (#1359)
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: chore(package): update detect-browser to version 4.0.1 (#1358)
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: NEW MAJOR START: disable automated releasing
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: chore: add 'toast', 'popup', 'accessible' keywords
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: chore: add Jeff Keith to Supporters
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: chore: bump dev-deps
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: Update rollup to version 1.0.0 � (#1353)

* chore(package): update rollup to version 1.0.0

* chore(package): update lockfile yarn.lock
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: chore: custom classes default value: null -> empty string (#1352)
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: chore: optimize resumeTimer test
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: chore(saucelabs): use 'Android GoogleAPI Emulator'

The latest version for 'Android Emulator' is outdated ATM,
it's 6.0. For Android GoogleAPI Emulator it's 7.1
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analyzing commit: chore(release): 7.33.1 [skip ci]

## [7.33.1](https://github.com/sweetalert2/sweetalert2/compare/v7.33.0...v7.33.1) (2018-12-22)

### Bug Fixes

* **d.ts:** add customContainerClass definition ([#1351](https://github.com/sweetalert2/sweetalert2/issues/1351)) ([c5f11e7](https://github.com/sweetalert2/sweetalert2/commit/c5f11e7))
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  The commit should not trigger a release
[2:51:14 PM] [semantic-release] [@semantic-release/commit-analyzer] » i  Analysis of 26 commits complete: no release
[2:51:14 PM] [semantic-release] » √  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[2:51:14 PM] [semantic-release] » i  There are no relevant changes, so no new version is released.

Actual behavior:

There are no relevant changes, so no new version is released

Expected behavior:

The new major should be released, because there are multiple commits with BREAKING CHANGE: keyword in it

Allow limiting release type <= type

I have a package which is based upon a parent package. If parent is x.y.z and the child package is a.b.c, I would like to enforce x.y == a.b. I believe I can do this by overriding all of the default rules with:

{type: 'feat', release: 'patch'},
{type: 'fix', release: 'patch'},
...
{tag: 'Breaking', release: 'patch'},

However this is fragile and depends on overriding all default rules. I propose a maxReleaseType or similar configuration option.

(Question) Pre-release tag as reference

I'm trying to use semantic-release but I want my previous release to be a pre-release (v2.0.0-alpha.1). This tag already exists (no other tags exist). When running semantic-release, the next inferred version is v1.0.0-alpha.1. Any way I can get it to detect the previous tag and to bump to v2.0.0-alpha.2?

CommitAnalyze a prefix which shouldn't publish

Is there any way to don't publish when a certain prefix matches, such as docs? Instead of publishing a new patch for each version, it would be nice to publish when code actually changes, not the docs.

"analyzeCommits": {
      "preset": "angular",
      "releaseRules": [
        {
          "type": "docs",
          "release": "none"
        },
   }

An in-range update of semantic-release is breaking the build 🚨

Version 15.9.3 of semantic-release was just published.

Branch Build failing 🚨
Dependency semantic-release
Current Version 15.9.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes v15.9.3

15.9.3 (2018-07-31)

Bug Fixes

  • do not hide env variable value if shorter than 5 (b082a2e)
Commits

The new version differs by 1 commits.

  • b082a2e fix: do not hide env variable value if shorter than 5

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Feature request: filter by scope

Perhaps this is already possible but after reading through the source code and checking the various dependencies I can't quite see a way of doing it. I would like to be able to filter the commits by scope. My use case is in a mono repo where I'm using the scope to denote which package a commit refers to. If this seems like a reasonable feature, I can do a pull request to implement. Some guidance here would be great, thanks!

Commit analyzer doesn't detect breaking change

Hi,

I have tried all ways of including the right keywords in my commit message to trigger a major release, but it keeps failing to detect it:

screen shot 2018-11-30 at 1 35 03 pm

I don't have any specific configuration, just using the default. So far, everything has worked as expected, except for trying to trigger a major release.

Any thoughts?

Test in Node 8.3 and Node 12

We are currently testing in Node 8 and 10:

node_js:
- 10
- 8

We want to test in 8.3 explicitly as it is currently the minimal Node version supported by semantic-release. And we want to start testing in Node 12 as it is the latest stable version.

Option to scan tags in other branches

In our workflow, we want our releases to progress linearly. For example, develop -> alpha -> beta -> master.

Currently, unless we merge changes from master all the way back into alpha – commit-analyzer will not pick up the latest release which occurred on master. So, if we released 1.1.2 on master and then add another feature to alpha – it would create a 1.1.2-alpha.X pre-release rather than the correct 1.1.3-alpha.1.

I do know that such flow is not very standard, however it works quite well for mobile apps where each staging branch corresponds to a specific stage of testing. Also, given linear one-directional flow, I do not think it makes sense to worry about merging "changes" from master all the way back. After all, those changes are due to "merge commits" and tags, none of which make any difference for code integrity.

So, I feel like there should be an option to either scan tags in all branches declared in workflow OR to provide last released version manually.

Is this something that could be considered for a PR? I am aware that it is somewhat against the standard, but I feel like implementing such functionality through an option can only improve commit-analyzer.

Question: default to patch release

Hi, you have a great well written tool here. am trying it out to simplify my teams release process. CI is on CircleCI. Everything worked like a charm with the default plugins.
However our team is global and our modules will have 95% patch releases. So far difficult to convince my team to bind to a commit convention.
The custom configuration I am exploring is:
1] By default for all/any commit message should do a patch bump.
2] If commit message has type:feat (or an easier identifier for feature) then minor bump.
3] if commit message has "breaking" then major bump.

Based on other closed issues here( #143, #139 ), tried this config in package.json. But this config does not honor the default all commit to patch. CI logs below: Could use some pointers.

"semantic-release": {
    "plugins": [
      [
        "@semantic-release/commit-analyzer",
        {
          "preset": "angular",
          "releaseRules": [
            {
              "breaking": true,
              "release": "major"
            },
            {
              "scope": "no-release",
              "release": false
            },
            {
              "type": "feat",
              "release": "minor"
            },
            {
              "type": "/.*/",
              "release": "patch"
            }
          ],
          "parserOpts": {
            "noteKeywords": [
              "BREAKING CHANGE",
              "BREAKING CHANGES"
            ]
          }
        }
      ],
      "@semantic-release/github",
      "@semantic-release/npm",
      "@semantic-release/release-notes-generator"
    ]
  }
[1:25:34 AM] [semantic-release] › ℹ  Running semantic-release version 16.0.1
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/npm"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/npm"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/npm"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/npm"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[1:25:42 AM] [semantic-release] › ✔  Run automated release from branch master
[1:25:42 AM] [semantic-release] › ✔  Allowed to push to the Git repository
[1:25:42 AM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/npm"
[1:25:42 AM] [semantic-release] [@semantic-release/npm] › ℹ  Verify authentication for registry https://artifactory.corp.com:443/artifactory/api/npm/npm-release-local/
[1:25:42 AM] [semantic-release] [@semantic-release/npm] › ℹ  Reading npm config from /home/circleci/.npmrc
[1:25:42 AM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/npm"
[1:25:42 AM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/github"
[1:25:42 AM] [semantic-release] [@semantic-release/github] › ℹ  Verify GitHub authentication (https://git.corp.com/api/v3)
[1:25:43 AM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/github"
[1:25:43 AM] [semantic-release] › ℹ  Found git tag v2.1.0 associated with version 2.1.0 on branch master
[1:25:43 AM] [semantic-release] › ℹ  Found 2 commits since last release
[1:25:43 AM] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[1:25:43 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: adding doctor (#24)
[1:25:43 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[1:25:43 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: corrected spelling for avenger name (#23)
[1:25:43 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[1:25:43 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 2 commits complete: no release
[1:25:43 AM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[1:25:43 AM] [semantic-release] › ℹ  There are no relevant changes, so no new version is released.

Squash-merges

Current behavior

[Semantic release]: Analyzing commit: Squashed commit of the following:

commit 74e6b0087331e5947fd8ba388e75d4d1900dfd44
Author: Jason Walton <[email protected]>
Date:   Thu May 17 11:21:50 2018 -0400

    fix: More fixes

commit b894885ae467975226e81080a35625d247796960
Author: Jason Walton <[email protected]>
Date:   Thu May 17 11:13:25 2018 -0400

    fix: Fix
[Semantic release]: The commit should not trigger a release

Expected behavior

If a commit starts with "Squashed commit of the following:", semantic-release should parse out all the individual commit messages and analyze them individually. The above contains two "fix" commits, so it should trigger a patch release.

(Moved here from semantic-release/semantic-release#792)

An in-range update of codecov is breaking the build 🚨

Version 3.0.4 of codecov was just published.

Branch Build failing 🚨
Dependency codecov
Current Version 3.0.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

codecov is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes v3.0.4

Security fixes

Commits

The new version differs by 5 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of semantic-release is breaking the build 🚨

The devDependency semantic-release was updated from 15.10.8 to 15.11.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v15.11.0

15.11.0 (2018-11-12)

Bug Fixes

Features

  • support multiple plugins for the analyzeCommits step (5180001)
Commits

The new version differs by 6 commits.

  • 5180001 feat: support multiple plugins for the analyzeCommits step
  • 728ea34 fix: remove redundant log
  • 83af7ac docs: mention default analyzeCommits plugin
  • 8e564eb docs: update FAQ to reflect new plugins option
  • dff1f10 docs: mention postversion npm script hook to run build scripts
  • ae4995c style: fix prettier errors

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Printing next version number on pre-push

To increase developers confidence in their versioning, I'd like to setup a Husky "pre-push" hook which prints the next version number to the committer when they're pushing changes to their Git repository.

I'd like this to happen on all branches, but only run @semantic-release/commit-analyzer; not of my other plugins.

My initial idea was to override the plugins property of my default release.config.js Semantic Release configuration file so that it only includes the @semantic-release/commit-analyzer plugin; however, this has the issue of requiring me to specify the current branch name with each call.

Is there a better approach towards achieving this result?

Emoji support with a custom eslint preset

Hello,

I use the conventional-changelog preset eslint with sgc and I would to handle a custom thing introduced by sgc : emoji at the beginning of the commit title : How can I do that ?

Now, a build where I use that :

[Semantic release]: Call plugin analyze-commits
[Semantic release]: Analyzing commit: :hammer: Refactor: Update description inside package.json
[Semantic release]: The commit should not trigger a release

and a build without that :

[Semantic release]: Call plugin analyze-commits
[Semantic release]: Analyzing commit: Refactor: Remove emoji for sgcrc
[Semantic release]: The release type for the commit is patch 

My config :
package.json (and the rules )

"release": {
    "analyzeCommits": {
      "preset": "eslint",
      "releaseRules": "./config/release-rules.js"
    },
    "generateNotes": {
      "preset": "eslint"
    }
  }

Does commit-analyzer ignore merge commits?

Interested in adopting semantic-release for a project where all commits follow the angular commit message conventions aside from GitHub merge commits. Will this project be compatible with semantic-release as-is when generating release notes?

How do I lint commits in a PR?

I'm using GH actions.
I can get a list of messages different from master.

But how do I fail CI if a commit message isn't in the correct format?

An in-range update of prettier is breaking the build 🚨

Version 1.8.0 of prettier was just published.

Branch Build failing 🚨
Dependency prettier
Current Version 1.7.4
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes 1.8.0: Markdown Support

image

This release adds Markdown support, a new --insert-pragma flag, fixes a number of formatting issues, adds support for some new experimental operators, and improves our editor integration support.

Highlights

Markdown Support

Support markdown (#2943) by @ikatyang

You can now run Prettier on Markdown files! 🎉

The implementation is highly compliant with the CommonMark spec, and backed by the excellent remark-parse package.

Word Wrap

One of Prettier's core features is its ability to wrap code at a specified line length. This applies to Markdown too, which means you can maintain nice and clean 80-character-wide Markdown files without having to re-adjust line breaks manually when you add or delete words.

Input:

Voilà! In view, a humble vaudevillian veteran cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valourous visitation of a bygone vexation stands vivified and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition! The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honour to meet you and you may call me V.

Output:

Voilà! In view, a humble vaudevillian veteran cast vicariously as both victim
and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity,
is a vestige of the vox populi, now vacant, vanished. However, this valourous
visitation of a bygone vexation stands vivified and has vowed to vanquish these
venal and virulent vermin vanguarding vice and vouchsafing the violently vicious
and voracious violation of volition! The only verdict is vengeance; a vendetta
held as a votive, not in vain, for the value and veracity of such shall one day
vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage
veers most verbose, so let me simply add that it's my very good honour to meet
you and you may call me V.

Note for CJK users: If your markdown renderer does not support CJK line ending, you'll have to use plugin like markdown-it-perfect-newline-for-cjk, hexo-filter-fix-cjk-spacing, etc. to remove additional spaces.

// Source
一二三
四五六
七八九

// Rendered content with unsupported renderer
一二三 四五六 七八九

// Rendered content with supported renderer or via plugin
一二三四五六七八九

Code Formatting

Powered by Prettier's generic "multiparser", Prettier will format code blocks in Markdown! We use the language code provided with the code block to determine which language it is, and thus we can format any language that Prettier supports (including Markdown itself, if you're into that).

Input:

```js
reallyUgly    (
javascript
  )
```
.h1 {     color : red }
```</pre></div>
<p>Output:</p>
<div class="highlight highlight-source-lisp"><pre>```js
reallyUgly(javascript)<span class="pl-c"><span class="pl-c">;</span></span>
.h1 {
  color: red<span class="pl-c"><span class="pl-c">;</span></span>
}
```</pre></div>
<blockquote>
<p>Note: In some cases you may not want to format your code in Markdown, and just like in other languages, in Markdown you can use <code>&lt;!-- prettier-ignore --&gt;</code> before the code block to ignore it from formatting.</p>
</blockquote>
<p><strong>Lists</strong></p>
<p>When rearranging list items, after running Prettier all the numbers will be fixed!</p>
<p><a href="https://camo.githubusercontent.com/50f76500c503763c50019ad61ff531716ff7f3c9/687474703a2f2f672e7265636f726469742e636f2f4d4174616e5a4d5a526f2e676966" target="_blank"><img src="https://camo.githubusercontent.com/50f76500c503763c50019ad61ff531716ff7f3c9/687474703a2f2f672e7265636f726469742e636f2f4d4174616e5a4d5a526f2e676966" alt="Markdown Lists" style="max-width:100%;"></a></p>
<blockquote>
<p>Note: you can actually opt out of this by using <code>1.</code> for all list items if you want to optimize for cleaner diffs.</p>
</blockquote>
<p><strong>Tables</strong></p>
<p>Tables will also automatically be adjusted to fit their contents. This could be completely unmaintainable without an automated tool.</p>
<p><a href="https://camo.githubusercontent.com/7f33126347f155262873500e5068016d2e71a773/687474703a2f2f672e7265636f726469742e636f2f33356a61383836636b542e676966" target="_blank"><img src="https://camo.githubusercontent.com/7f33126347f155262873500e5068016d2e71a773/687474703a2f2f672e7265636f726469742e636f2f33356a61383836636b542e676966" alt="Markdown Tables" style="max-width:100%;"></a></p>
<p><strong>Markdown-in-JS</strong></p>
<p>By using either <code>md</code> or <code>markdown</code> tagged template literals, you can format markdown code inside JavaScript.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-c1">markdown</span> <span class="pl-k">=</span> md<span class="pl-s"><span class="pl-pds">`</span></span>
<span class="pl-s">  # heading</span>
<span class="pl-s"></span>
<span class="pl-s">  1. list item</span>
<span class="pl-s"><span class="pl-pds">`</span></span>;</pre></div>
<h2>CLI</h2>
<h3>Add option to insert <code>@format</code> to first docblock if absent (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2865" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="258974830" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2865">#2865</a>) by <a href="https://urls.greenkeeper.io/samouri" class="user-mention">@samouri</a></h3>
<p>In 1.7, we added an option called <code>--require-pragma</code> to require files contain an <code>/** @format */</code> pragma to be formatted. In order to add this pragma to a large set of files you can now use <a href="https://prettier.io/docs/en/cli.html#insert-pragma"><code>--insert-pragma</code></a> flag.</p>
<pre><code>prettier --write "folder/**/*.js" --insert-pragma
</code></pre>
<h3>Add <code>--loglevel</code> option (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2992" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="263707174" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2992">#2992</a>) by <a href="https://urls.greenkeeper.io/ikatyang" class="user-mention">@ikatyang</a></h3>
<p>This <a href="https://prettier.io/docs/en/cli.html#loglevel">nifty feature</a> allows you to opt in (or out) of Prettier's logging. We've also cleaned up the logging substantially since 1.7.</p>
<div class="highlight highlight-source-shell"><pre>$ prettier --loglevel=debug blarg
$ ./bin/prettier.js --loglevel=debug blarg
[debug] normalized argv: {<span class="pl-s"><span class="pl-pds">"</span>_<span class="pl-pds">"</span></span>:[<span class="pl-s"><span class="pl-pds">"</span>blarg<span class="pl-pds">"</span></span>],<span class="pl-s"><span class="pl-pds">"</span>bracket-spacing<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>color<span class="pl-pds">"</span></span>:true,<span class="pl-s"><span class="pl-pds">"</span>debug-check<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>debug-print-doc<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>flow-parser<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>insert-pragma<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>jsx-bracket-same-line<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>list-different<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>require-pragma<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>semi<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>single-quote<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>stdin<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>use-tabs<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>version<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>with-node-modules<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>write<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>loglevel<span class="pl-pds">"</span></span>:<span class="pl-s"><span class="pl-pds">"</span>debug<span class="pl-pds">"</span></span>,<span class="pl-s"><span class="pl-pds">"</span>ignore-path<span class="pl-pds">"</span></span>:<span class="pl-s"><span class="pl-pds">"</span>.prettierignore<span class="pl-pds">"</span></span>,<span class="pl-s"><span class="pl-pds">"</span>config-precedence<span class="pl-pds">"</span></span>:<span class="pl-s"><span class="pl-pds">"</span>cli-override<span class="pl-pds">"</span></span>}
[error] No matching files. Patterns tried: blarg <span class="pl-k">!</span><span class="pl-k">**</span>/node_modules/<span class="pl-k">**</span> <span class="pl-k">!</span>./node_modules/<span class="pl-k">**</span>
</pre></div>
<h2>JavaScript</h2>
<h3>Fix indentation for JSDoc comments (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2470" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="242554023" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2470">#2470</a>) by <a href="https://urls.greenkeeper.io/maxdeviant" class="user-mention">@maxdeviant</a></h3>
<p>This has been a long-time known issue with Prettier. When formatting code that results in a change of indentation level, the JSDoc comments would end up being out of alignment. We're happy to report this is now fixed!</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-k">function</span> <span class="pl-en">theFunction2</span>(<span class="pl-smi">action$</span>, <span class="pl-smi">store</span>) {
  <span class="pl-c"><span class="pl-c">/*</span></span>
<span class="pl-c">     * comments</span>
<span class="pl-c">     <span class="pl-c">*/</span></span>
  <span class="pl-k">return</span> <span class="pl-c1">true</span>;
}

<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-k">function</span> <span class="pl-en">theFunction2</span>(<span class="pl-smi">action$</span>, <span class="pl-smi">store</span>) {
  <span class="pl-c"><span class="pl-c">/*</span></span>
<span class="pl-c">   * comments</span>
<span class="pl-c">   <span class="pl-c">*/</span></span>
  <span class="pl-k">return</span> <span class="pl-c1">true</span>;
}</pre></div>
<h3>Print pipeline and nullish-coalescing operators (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3036" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="265544605" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3036">#3036</a>) by <a href="https://urls.greenkeeper.io/azz" class="user-mention">@azz</a></h3>
<p>We've added support for two new proposed operators to Prettier: the <em>pipeline operator</em> and the <em>nullish coalescing operator</em>.</p>
<p>The <a href="https://urls.greenkeeper.io/tc39/proposal-pipeline-operator/">pipeline operator</a> is currently a stage one proposal.</p>
<blockquote>
<p>This proposal introduces a new operator |&gt; similar to F#, OCaml, Elixir, Elm, Julia, Hack, and LiveScript, as well as UNIX pipes. It's a backwards-compatible way of streamlining chained function calls in a readable, functional manner, and provides a practical alternative to extending built-in prototypes.</p>
</blockquote>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-k">let</span> result <span class="pl-k">=</span> <span class="pl-en">exclaim</span>(<span class="pl-en">capitalize</span>(<span class="pl-en">doubleSay</span>(<span class="pl-s"><span class="pl-pds">"</span>hello<span class="pl-pds">"</span></span>)));

<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-k">let</span> result <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">"</span>hello<span class="pl-pds">"</span></span>
  <span class="pl-k">|</span><span class="pl-k">&gt;</span> doubleSay
  <span class="pl-k">|</span><span class="pl-k">&gt;</span> capitalize
  <span class="pl-k">|</span><span class="pl-k">&gt;</span> exclaim;</pre></div>
<p>The <a href="https://urls.greenkeeper.io/tc39-transfer/proposal-nullish-coalescing">nullish coalescing operator</a> is another stage one proposal.</p>
<blockquote>
<p>When performing optional property access in a nested structure in conjunction with the optional chaining operator, it is often desired to provide a default value if the result of that property access is null or undefined.</p>
</blockquote>
<p>This operator is similar to <code>||</code> except it only evaluates the right-hand-side if the left is <code>undefined</code> or <code>null</code>, not <code>""</code>, <code>0</code>, <code>NaN</code>, etc.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-c1">foo</span> <span class="pl-k">=</span> <span class="pl-smi">object</span>.<span class="pl-smi">foo</span> <span class="pl-k">??</span> <span class="pl-s"><span class="pl-pds">"</span>default<span class="pl-pds">"</span></span>;</pre></div>
<h3>Improved template literal expresions line breaks (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3124" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="269808048" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3124">#3124</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>This was another known issue with Prettier, when printing a template literal string with expressions inside that went over the print width, it would wrap the code in weird places inside the expressions. Now, if Prettier needs to insert a line break, it should happen right between <code>${</code> and <code>}</code>.</p>
<div class="highlight highlight-source-js-jsx"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-k">const</span> <span class="pl-smi">description</span><span class="pl-k"> =</span><span class="pl-s"> <span class="pl-s">`</span><span class="pl-s">The value of the <span class="pl-e">${<span class="pl-smi">cssName</span>}</span> css of the <span class="pl-e">${<span class="pl-c1">this</span></span></span></span>
<span class="pl-s"><span class="pl-s"><span class="pl-e">  <span class="pl-k">.</span><span class="pl-smi">_name</span>}</span> element</span><span class="pl-s">`</span></span>;

<span class="pl-k">const</span> <span class="pl-smi">foo</span><span class="pl-k"> =</span><span class="pl-s"> <span class="pl-s">`</span><span class="pl-s">mdl-textfield mdl-js-textfield <span class="pl-e">${<span class="pl-smi">className</span>}</span> <span class="pl-e">${<span class="pl-smi">content</span><span class="pl-k">.</span><span class="pl-smi">length</span><span class="pl-k"> &gt;</span> <span class="pl-c1">0</span></span></span></span>
<span class="pl-s"><span class="pl-s"><span class="pl-e">  <span class="pl-k">?</span> <span class="pl-s"><span class="pl-pds">"</span>is-dirty<span class="pl-pds">"</span></span></span></span></span>
<span class="pl-s"><span class="pl-s"><span class="pl-e">  <span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>}</span> combo-box__input</span><span class="pl-s">`</span></span>;

<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-k">const</span> <span class="pl-smi">description</span><span class="pl-k"> =</span><span class="pl-s"> <span class="pl-s">`</span><span class="pl-s">The value of the \${cssName} css of the \${</span></span>
<span class="pl-s"><span class="pl-s">  this._name</span></span>
<span class="pl-s"><span class="pl-s">} element</span><span class="pl-s">`</span></span>;

<span class="pl-k">const</span> <span class="pl-smi">foo</span><span class="pl-k"> =</span><span class="pl-s"> <span class="pl-s">`</span><span class="pl-s">mdl-textfield mdl-js-textfield <span class="pl-e">${<span class="pl-smi">className</span>}</span> <span class="pl-e">${</span></span></span>
<span class="pl-s"><span class="pl-s"><span class="pl-e"><span class="pl-smi">  content</span><span class="pl-k">.</span><span class="pl-smi">length</span><span class="pl-k"> &gt;</span> <span class="pl-c1">0</span> <span class="pl-k">?</span> <span class="pl-s"><span class="pl-pds">'</span>is-dirty<span class="pl-pds">'</span></span> <span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span></span></span></span>
<span class="pl-s"><span class="pl-s"><span class="pl-e">}</span> combo-box__input</span><span class="pl-s">`</span></span></pre></div>
<h2>JSX</h2>
<h3>Don't inline trailing <code>}</code> for arrow functions attributes (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3110" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="268739661" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3110">#3110</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>In order to align closer to the <a href="https://urls.greenkeeper.io/airbnb/javascript/">Airbnb style guide</a>, and since it was never intentionally printed this way, we've moved the <code>}</code> from to the next line in JSX. This is more diff friendly, and makes it easier to move code around by shifting lines in your editor.</p>
<div class="highlight highlight-source-js-jsx"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
&lt;<span class="pl-ent"><span class="pl-c1">BookingIntroPanel</span></span>
  <span class="pl-e">logClick</span><span class="pl-k">=</span><span class="pl-pse">{</span><span class="pl-s1"><span class="pl-smi">data</span> <span class="pl-k">=&gt;</span></span>
<span class="pl-s1">    <span class="pl-en">doLogClick</span>(<span class="pl-s"><span class="pl-pds">"</span>long_name_long_name_long_name<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>long_name_long_name_long_name<span class="pl-pds">"</span></span>,<span class="pl-smi"> data</span>)</span><span class="pl-pse">}</span>
/&gt;;

<span class="pl-c"><span class="pl-c">//</span> After</span>
&lt;<span class="pl-ent"><span class="pl-c1">BookingIntroPanel</span></span>
  <span class="pl-e">logClick</span><span class="pl-k">=</span><span class="pl-pse">{</span><span class="pl-s1"><span class="pl-smi">data</span> <span class="pl-k">=&gt;</span></span>
<span class="pl-s1">    <span class="pl-en">doLogClick</span>(<span class="pl-s"><span class="pl-pds">"</span>long_name_long_name_long_name<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>long_name_long_name_long_name<span class="pl-pds">"</span></span>,<span class="pl-smi"> data</span>)</span>
<span class="pl-s1">  </span><span class="pl-pse">}</span>
/&gt;;</pre></div>
<h1>Other Changes</h1>
<h2>JavaScript</h2>
<h3>Make the factory detection handle multiple elements (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3112" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="268967545" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3112">#3112</a>) by <a href="https://urls.greenkeeper.io/vjeux" class="user-mention">@vjeux</a></h3>
<p>There was a bug in the heuristic that Prettier uses to determine whether an expression is a factory or not. It now works correctly with longer member expressions.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-c1">window</span>.<span class="pl-smi">FooClient</span>
  .<span class="pl-en">setVars</span>({
    locale<span class="pl-k">:</span> <span class="pl-en">getFooLocale</span>({ page }),
    authorizationToken<span class="pl-k">:</span> <span class="pl-smi">data</span>.<span class="pl-smi">token</span>
  })
  .<span class="pl-en">initVerify</span>(<span class="pl-s"><span class="pl-pds">"</span>foo_container<span class="pl-pds">"</span></span>);

<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-c1">window</span>.<span class="pl-smi">FooClient</span>.<span class="pl-en">setVars</span>({
  locale<span class="pl-k">:</span> <span class="pl-en">getFooLocale</span>({ page }),
  authorizationToken<span class="pl-k">:</span> <span class="pl-smi">data</span>.<span class="pl-smi">token</span>
}).<span class="pl-en">initVerify</span>(<span class="pl-s"><span class="pl-pds">"</span>foo_container<span class="pl-pds">"</span></span>);</pre></div>
<h3>Handle comments between function name and open paren (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2979" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="263070152" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2979">#2979</a>) by <a href="https://urls.greenkeeper.io/azz" class="user-mention">@azz</a></h3>
<p>Printing comments in the right place is an endless challenge <g-emoji alias="wink" fallback-src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f609.png" ios-version="6.0">😉</g-emoji>. This fix ensures that comments next to function names are re-printed correctly.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-k">function</span> <span class="pl-en">f</span>(<span class="pl-c"><span class="pl-c">/*</span> comment<span class="pl-c">*/</span></span> <span class="pl-smi">promise</span>) {}

<span class="pl-c"><span class="pl-c">//</span> After </span>
<span class="pl-k">function</span> f <span class="pl-c"><span class="pl-c">/*</span> comment<span class="pl-c">*/</span></span>(<span class="pl-smi">promise</span>) {}</pre></div>
<h3>Support sequential CallExpressions in member chains (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2990" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="263677479" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2990">#2990</a>) by <a href="https://urls.greenkeeper.io/chrisvoll" class="user-mention">@chrisvoll</a></h3>
<p>Member chains are one of the most complex parts of Prettier. This PR fixes an issue where repeated calls lead to the next method not being pushed to the next line.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
wrapper
  .<span class="pl-c1">find</span>(<span class="pl-s"><span class="pl-pds">"</span>SomewhatLongNodeName<span class="pl-pds">"</span></span>)
  .<span class="pl-en">prop</span>(<span class="pl-s"><span class="pl-pds">"</span>longPropFunctionName<span class="pl-pds">"</span></span>)().<span class="pl-en">then</span>(<span class="pl-k">function</span>() {
  <span class="pl-en">doSomething</span>();
});

<span class="pl-c"><span class="pl-c">//</span> After</span>
wrapper
  .<span class="pl-c1">find</span>(<span class="pl-s"><span class="pl-pds">"</span>SomewhatLongNodeName<span class="pl-pds">"</span></span>)
  .<span class="pl-en">prop</span>(<span class="pl-s"><span class="pl-pds">"</span>longPropFunctionName<span class="pl-pds">"</span></span>)()
  .<span class="pl-en">then</span>(<span class="pl-k">function</span>() {
    <span class="pl-en">doSomething</span>();
  });</pre></div>
<h3>Account for empty lines in long member call chain (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3035" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="265515302" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3035">#3035</a>) by <a href="https://urls.greenkeeper.io/jackyho112" class="user-mention">@jackyho112</a></h3>
<p>Previously, Prettier would delete all newlines within a member chain. Now we keep up to one if it's in the source. This is nice for fluent APIs that you want to break up over multiple lines.</p>
<div class="highlight highlight-source-js"><pre>angular
  .<span class="pl-en">module</span>(<span class="pl-s"><span class="pl-pds">"</span>AngularAppModule<span class="pl-pds">"</span></span>)

  <span class="pl-c"><span class="pl-c">//</span> Constants.</span>
  .<span class="pl-en">constant</span>(<span class="pl-s"><span class="pl-pds">"</span>API_URL<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>http://localhost:8080/api<span class="pl-pds">"</span></span>)

  <span class="pl-c"><span class="pl-c">//</span> App configuration.</span>
  .<span class="pl-en">config</span>(appConfig)
  .<span class="pl-en">run</span>(appRun);</pre></div>
<h3>Fix issue where first argument is left behind when line breaks (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3079" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="267371127" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3079">#3079</a>) by <a href="https://urls.greenkeeper.io/mutdmour" class="user-mention">@mutdmour</a></h3>
<p>This addresses an issue where due to our special object inline behaviour, the indentation missing from the function call.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-smi">db</span>.<span class="pl-en">collection</span>(<span class="pl-s"><span class="pl-pds">"</span>indexOptionDefault<span class="pl-pds">"</span></span>).<span class="pl-en">createIndex</span>({ a<span class="pl-k">:</span> <span class="pl-c1">1</span> },
{
  indexOptionDefaults<span class="pl-k">:</span> <span class="pl-c1">true</span>
},
<span class="pl-k">function</span>(<span class="pl-smi">err</span>) {
  <span class="pl-c"><span class="pl-c">//</span> code</span>
});

<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-smi">db</span>.<span class="pl-en">collection</span>(<span class="pl-s"><span class="pl-pds">"</span>indexOptionDefault<span class="pl-pds">"</span></span>).<span class="pl-en">createIndex</span>(
  { a<span class="pl-k">:</span> <span class="pl-c1">1</span> },
  {
    indexOptionDefaults<span class="pl-k">:</span> <span class="pl-c1">true</span>
  },
  <span class="pl-k">function</span>(<span class="pl-smi">err</span>) {
    <span class="pl-c"><span class="pl-c">//</span> code</span>
  }
);</pre></div>
<h3>Break parens for binaries in member expression (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2958" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="262164203" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2958">#2958</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>Similarly, there was another edge case where indentation was missing from logical expressions. This is fixed, too.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-k">const</span> <span class="pl-c1">someLongVariable</span> <span class="pl-k">=</span> (<span class="pl-en">idx</span>(
  <span class="pl-c1">this</span>.<span class="pl-smi">props</span>,
  <span class="pl-smi">props</span> <span class="pl-k">=&gt;</span> <span class="pl-smi">props</span>.<span class="pl-smi">someLongPropertyName</span>
) <span class="pl-k">||</span> []
).<span class="pl-en">map</span>(<span class="pl-smi">edge</span> <span class="pl-k">=&gt;</span> <span class="pl-smi">edge</span>.<span class="pl-smi">node</span>);

<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-k">const</span> <span class="pl-c1">someLongVariable</span> <span class="pl-k">=</span> (
  <span class="pl-en">idx</span>(<span class="pl-c1">this</span>.<span class="pl-smi">props</span>, <span class="pl-smi">props</span> <span class="pl-k">=&gt;</span> <span class="pl-smi">props</span>.<span class="pl-smi">someLongPropertyName</span>) <span class="pl-k">||</span> []
).<span class="pl-en">map</span>(<span class="pl-smi">edge</span> <span class="pl-k">=&gt;</span> <span class="pl-smi">edge</span>.<span class="pl-smi">node</span>);</pre></div>
<h3>Prevent breaking MemberExpression inside NewExpression (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3075" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="267232001" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3075">#3075</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>There are so many ways to break a line. Some of them look much worse than others. Breaking between in this case looked really weird, so it has been fixed!</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-k">function</span> <span class="pl-en">functionName</span>() {
  <span class="pl-k">if</span> (<span class="pl-c1">true</span>) {
    <span class="pl-c1">this</span>.<span class="pl-smi">_aVeryLongVariableNameToForceLineBreak</span> <span class="pl-k">=</span> <span class="pl-k">new</span> <span class="pl-en">this</span>
      .<span class="pl-en">Promise</span>((<span class="pl-smi">resolve</span>, <span class="pl-smi">reject</span>) <span class="pl-k">=&gt;</span> {
        <span class="pl-c"><span class="pl-c">//</span> do something</span>
      });
  }
}

<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-k">function</span> <span class="pl-en">functionName</span>() {
  <span class="pl-k">if</span> (<span class="pl-c1">true</span>) {
    <span class="pl-c1">this</span>.<span class="pl-smi">_aVeryLongVariableNameToForceLineBreak</span> <span class="pl-k">=</span> <span class="pl-k">new</span> <span class="pl-en">this.Promise</span>(
      (<span class="pl-smi">resolve</span>, <span class="pl-smi">reject</span>) <span class="pl-k">=&gt;</span> {
        <span class="pl-c"><span class="pl-c">//</span> do something</span>
      }
    );
  }
}</pre></div>
<h3>Fix array acessors in method chains (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3137" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="270637812" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3137">#3137</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>In a method chain we split lines by grouping elements together and accessing an array should be printed in the end of a group instead of the beginning.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-en">find</span>(<span class="pl-s"><span class="pl-pds">'</span>.org-lclp-edit-copy-url-banner__link<span class="pl-pds">'</span></span>)
  [<span class="pl-c1">0</span>].<span class="pl-c1">getAttribute</span>(<span class="pl-s"><span class="pl-pds">'</span>href<span class="pl-pds">'</span></span>)
  .<span class="pl-c1">indexOf</span>(<span class="pl-c1">this</span>.<span class="pl-smi">landingPageLink</span>)

<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-en">find</span>(<span class="pl-s"><span class="pl-pds">'</span>.org-lclp-edit-copy-url-banner__link<span class="pl-pds">'</span></span>)[<span class="pl-c1">0</span>]
  .<span class="pl-c1">getAttribute</span>(<span class="pl-s"><span class="pl-pds">'</span>href<span class="pl-pds">'</span></span>)
  .<span class="pl-c1">indexOf</span>(<span class="pl-c1">this</span>.<span class="pl-smi">landingPageLink</span>)</pre></div>
<h2>Flow and TypeScript</h2>
<h3>Fix indentation of intersection object types (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3074" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="267225804" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3074">#3074</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>This was a minor alignment bug in intersection types, and has now been fixed.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
type intersectionTest <span class="pl-k">=</span> {
  propA<span class="pl-k">:</span> <span class="pl-c1">X</span>
} <span class="pl-k">&amp;</span> {
  propB<span class="pl-k">:</span> <span class="pl-c1">X</span>
} <span class="pl-k">&amp;</span> {
    propC<span class="pl-k">:</span> <span class="pl-c1">X</span>
  } <span class="pl-k">&amp;</span> {
    propD<span class="pl-k">:</span> <span class="pl-c1">X</span>
  };

<span class="pl-c"><span class="pl-c">//</span> After</span>
type Props <span class="pl-k">=</span> {
  propA<span class="pl-k">:</span> <span class="pl-c1">X</span>
} <span class="pl-k">&amp;</span> {
  propB<span class="pl-k">:</span> <span class="pl-c1">X</span>
} <span class="pl-k">&amp;</span> {
  propC<span class="pl-k">:</span> <span class="pl-c1">X</span>
} <span class="pl-k">&amp;</span> {
  propD<span class="pl-k">:</span> <span class="pl-c1">X</span>
};</pre></div>
<h3>Keep parens around TSAsExpression in ConditionalExpression (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3053" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="266402555" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3053">#3053</a>) by <a href="https://urls.greenkeeper.io/azz" class="user-mention">@azz</a></h3>
<p>We missed a case where we need to keep the parenthesis with TypeScript's <code>as</code> assertions. This is now fixed.</p>
<div class="highlight highlight-source-ts"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-c"></span><span class="pl-smi">aValue</span> <span class="pl-k">as</span> <span class="pl-c1">boolean</span> ? <span class="pl-c1">0</span> : <span class="pl-k">-</span><span class="pl-c1">1</span>;

<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-c"></span>(<span class="pl-smi">aValue</span> <span class="pl-k">as</span> <span class="pl-c1">boolean</span>) <span class="pl-k">?</span> <span class="pl-c1">0</span> <span class="pl-k">:</span> <span class="pl-k">-</span><span class="pl-c1">1</span>;</pre></div>
<h2>JSX</h2>
<h3>Collapse multiple JSX whitespaces (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2973" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="262564212" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2973">#2973</a>) by <a href="https://urls.greenkeeper.io/karl" class="user-mention">@karl</a></h3>
<p>This fixes up the issue where JSX formatting occasionally needed to be run twice to become stable. This occurred when you had multiple JSX whitespace elements or JSX whitespace followed by a space.</p>
<div class="highlight highlight-source-js-jsx"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
&lt;<span class="pl-ent">div</span>&gt;
    <span class="pl-pse">{</span><span class="pl-s1"><span class="pl-s"><span class="pl-pds">"</span> <span class="pl-pds">"</span></span></span><span class="pl-pse">}</span> &lt;<span class="pl-ent"><span class="pl-c1">Badge</span></span> <span class="pl-e">src</span><span class="pl-k">=</span><span class="pl-pse">{</span><span class="pl-s1"><span class="pl-smi">notificationIconPng</span></span><span class="pl-pse">}</span> /&gt;
&lt;/<span class="pl-ent">div</span>&gt;;

<span class="pl-c"><span class="pl-c">//</span> After</span>
&lt;<span class="pl-ent">div</span>&gt;
  <span class="pl-pse">{</span><span class="pl-s1"><span class="pl-s"><span class="pl-pds">"</span> <span class="pl-pds">"</span></span></span><span class="pl-pse">}</span>
  &lt;<span class="pl-ent"><span class="pl-c1">Badge</span></span> <span class="pl-e">src</span><span class="pl-k">=</span><span class="pl-pse">{</span><span class="pl-s1"><span class="pl-smi">notificationIconPng</span></span><span class="pl-pse">}</span> /&gt;
&lt;/<span class="pl-ent">div</span>&gt;</pre></div>
<h3>Don't print JSX bracket on same line when it has trailing comments (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3088" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="267549517" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3088">#3088</a>) by <a href="https://urls.greenkeeper.io/azz" class="user-mention">@azz</a></h3>
<p>This was an issue with the <code>--jsx-bracket-same-line</code> option. Turns out you can't <em>always</em> put the bracket on the same line...</p>
<div class="highlight highlight-source-js-jsx"><pre><span class="pl-c"><span class="pl-c">//</span> Input</span>
&lt;<span class="pl-ent">div</span>
<span class="pl-c">  <span class="pl-c">//</span> comment</span>
&gt;
  <span class="pl-pse">{</span><span class="pl-s1"><span class="pl-smi">foo</span></span><span class="pl-pse">}</span>
&lt;/<span class="pl-ent">div</span>&gt;

<span class="pl-c"><span class="pl-c">//</span> Before</span>
&lt;<span class="pl-ent">div</span>&gt;
// comment
  <span class="pl-pse">{</span><span class="pl-s1"><span class="pl-smi">foo</span></span><span class="pl-pse">}</span>
&lt;/<span class="pl-ent">div</span>&gt;;

<span class="pl-c"><span class="pl-c">//</span> After</span>
&lt;<span class="pl-ent">div</span>
<span class="pl-c"><span class="pl-c">//</span> comment</span>
&gt;
  <span class="pl-pse">{</span><span class="pl-s1"><span class="pl-smi">foo</span></span><span class="pl-pse">}</span>
&lt;/<span class="pl-ent">div</span>&gt;;</pre></div>
<h2>CSS</h2>
<h3>Preserve line breaks in grid declarations (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3133" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="270384528" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3133">#3133</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>Prettier will now preserve line breaks included in the source code when formatting the <code>grid</code> and <code>grid-template-*</code> rules, since those are important to keep in separate lines, but still applies the formatting like other rules (e.g., numbers and quotes).</p>
<div class="highlight highlight-source-css"><pre><span class="pl-c"><span class="pl-c">/*</span> Original Input <span class="pl-c">*/</span></span>
<span class="pl-ent">div</span> {
  <span class="pl-c1"><span class="pl-c1">grid</span></span>:
    [wide-start] <span class="pl-s"><span class="pl-pds">'</span>header header header<span class="pl-pds">'</span></span> <span class="pl-c1">200.000<span class="pl-k">px</span></span>
    [wide-end] <span class="pl-s"><span class="pl-pds">"</span>footer footer footer<span class="pl-pds">"</span></span> <span class="pl-c1">.50<span class="pl-k">fr</span></span>
    / <span class="pl-c1">auto</span> <span class="pl-c1">50.000<span class="pl-k">px</span></span> <span class="pl-c1">auto</span>;
}

<span class="pl-c"><span class="pl-c">/*</span> Before <span class="pl-c">*/</span></span>
<span class="pl-ent">div</span> {
  <span class="pl-c1"><span class="pl-c1">grid</span></span>: [wide-start] <span class="pl-s"><span class="pl-pds">"</span>header header header<span class="pl-pds">"</span></span> <span class="pl-c1">200<span class="pl-k">px</span></span> [wide-end]
    <span class="pl-s"><span class="pl-pds">"</span>footer footer footer<span class="pl-pds">"</span></span> <span class="pl-c1">0.5<span class="pl-k">fr</span></span> / <span class="pl-c1">auto</span> <span class="pl-c1">50<span class="pl-k">px</span></span> <span class="pl-c1">auto</span>;
}

<span class="pl-c"><span class="pl-c">/*</span> After <span class="pl-c">*/</span></span>
<span class="pl-ent">div</span> {
  <span class="pl-c1"><span class="pl-c1">grid</span></span>:
    [wide-start] <span class="pl-s"><span class="pl-pds">"</span>header header header<span class="pl-pds">"</span></span> <span class="pl-c1">200<span class="pl-k">px</span></span>
    [wide-end] <span class="pl-s"><span class="pl-pds">"</span>footer footer footer<span class="pl-pds">"</span></span> <span class="pl-c1">0.5<span class="pl-k">fr</span></span>
    / <span class="pl-c1">auto</span> <span class="pl-c1">50<span class="pl-k">px</span></span> <span class="pl-c1">auto</span>;
}</pre></div>
<h2>SCSS</h2>
<h3>Format SCSS maps like CSS rules (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3070" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="267054763" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3070">#3070</a>) by <a href="https://urls.greenkeeper.io/asmockler" class="user-mention">@asmockler</a></h3>
<p>Turns out SCSS maps are much prettier when printed over multiple lines.</p>
<div class="highlight highlight-source-scss"><pre><span class="pl-c">// Before</span>
<span class="pl-smi">$map</span>: (color: <span class="pl-c1">#111111</span>, <span class="pl-c1">text</span><span class="pl-c1">-</span>shadow:<span class="pl-c1"> 1</span><span class="pl-k">px</span><span class="pl-c1"> 1</span><span class="pl-k">px</span><span class="pl-c1"> 0</span> <span class="pl-bu">salmon</span>)

// After
<span class="pl-smi">$map</span>: (
  color: <span class="pl-c1">#111111</span>,
  <span class="pl-c1">text</span><span class="pl-c1">-</span>shadow:<span class="pl-c1"> 1</span><span class="pl-k">px</span><span class="pl-c1"> 1</span><span class="pl-k">px</span><span class="pl-c1"> 0</span> <span class="pl-bu">salmon</span>
);</pre></div>
<h2>CSS-in-JS</h2>
<h3>Fix formatting styled(Foo).attrs(...)`` (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3073" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="267192603" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3073">#3073</a>) by <a href="https://urls.greenkeeper.io/existentialism" class="user-mention">@existentialism</a></h3>
<p>Prettier will now format the CSS in styled-components code that looks like this:</p>
<div class="highlight highlight-source-js"><pre><span class="pl-en">styled</span>(Component).<span class="pl-en">attrs</span>({})<span class="pl-s"><span class="pl-pds">`</span></span>
<span class="pl-s">  color: red;</span>
<span class="pl-s"><span class="pl-pds">`</span></span>;</pre></div>
<h2>GraphQL</h2>
<h3>Prevent formatting GraphQL template literals with expressions (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2975" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="262809788" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2975">#2975</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>Prettier doesn't support formatting JavaScript expressions in GraphQL. See <a href="https://urls.greenkeeper.io/prettier/prettier/issues/2640" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="251412470" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2640">#2640</a> for tracking. There was a bug where formatting an expression lead to invalid code, so we've completely disabled formatting GraphQL when it contains JavaScript expressions until we fully support it.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
(invalid code)

<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-en">graphql</span>(schema, <span class="pl-s"><span class="pl-pds">`</span>{ query test { id }} <span class="pl-s1"><span class="pl-pse">${</span>fragment<span class="pl-pse">}</span></span><span class="pl-pds">`</span></span>)</pre></div>
<h2>CLI</h2>
<h3>Don't use ANSI codes if stdout isn't a TTY (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2903" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="260810621" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2903">#2903</a>) by <a href="https://urls.greenkeeper.io/narigo" class="user-mention">@Narigo</a></h3>
<p>Previously, piping the output of <code>--list-different</code> to other tools was troublesome due to the ANSI color codes we use to show whether a file was modified or not. This PR disables the use of color when Prettier is piped to a different process.</p>
<h2>Configuration</h2>
<h3>Use relative paths with CLI (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2969" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="262449905" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2969">#2969</a>) by <a href="https://urls.greenkeeper.io/ahmedelgabri" class="user-mention">@ahmedelgabri</a></h3>
<p>This fixes a bug where passing a path starting with <code>./</code> to the CLI wouldn't match patterns used in <code>.prettierignore</code>.</p>
<pre><code># .prettierignore
path/to/*.js
</code></pre>
<p>After this fix, no files will be written to when executing:</p>
<div class="highlight highlight-source-shell"><pre>$ prettier --write ./path/to/<span class="pl-k">*</span>.js</pre></div>
<h3>Resolve file paths relative to config file (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3037" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="265550594" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3037">#3037</a>) by <a href="https://urls.greenkeeper.io/azz" class="user-mention">@azz</a></h3>
<p>This fixes an issue where <code>.prettierrc</code> overrides, under certain conditions, were not being respected for absolute paths with the <code>resolveConfig</code> API.</p>
<h2>Core</h2>
<h3>Respect CJK width and Combined Characters (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3003" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="264227112" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3003">#3003</a>,  <a href="https://urls.greenkeeper.io/prettier/prettier/pull/3015" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="264803229" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3015">#3015</a>) by <a href="https://urls.greenkeeper.io/ikatyang" class="user-mention">@ikatyang</a></h3>
<p>Chinese, Japanese and Korean characters are now considered two characters wide.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before (exceeds print width when CJK characters are 2x monospace chars)</span>
<span class="pl-k">const</span> <span class="pl-c1">x</span> <span class="pl-k">=</span> [<span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>];

<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-k">const</span> <span class="pl-c1">x</span> <span class="pl-k">=</span> [
  <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>,
   <span class="pl-c"><span class="pl-c">//</span> ...</span>
  <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>
];</pre></div>
<p><a href="https://urls.greenkeeper.io/prettier/prettier/pull/3015" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="264803229" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3015">#3015</a> also ensures that combining characters (e.g. <code>Á</code>) are counted as one character.</p>
<h2>Editor Support</h2>
<h3>Implement getSupportInfo() and use it for inference (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3033" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="265494522" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3033">#3033</a>) by <a href="https://urls.greenkeeper.io/azz" class="user-mention">@azz</a></h3>
<p>We've added a new function to the API (<code>prettier.getSupportInfo([version])</code>), and the CLI <code>--support-info</code>. This can be used to interrogate Prettier to find out which languages the current version, or an older version, supports. It also provides useful information such as CodeMirror IDs, tmScopes, etc, which can be used to automate some of the work done with lookup tables in text editor integrations.</p>
<p>Internally, we use this information to drive which extensions trigger which parsers, and support some common files that don't have extensions, like <code>.prettierrc</code>, <code>Jakefile</code>, etc.</p>
<div class="highlight highlight-source-shell"><pre><span class="pl-c"><span class="pl-c">#</span> prettier knows that this file is JSON now.</span>
$ prettier --write .prettierrc</pre></div>
<h3>Split source elements relative to their language. (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3069" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="266872265" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3069">#3069</a>) by <a href="https://urls.greenkeeper.io/cigit" class="user-mention">@CiGit</a></h3>
<p>This fixes an issue in editors that support range formatting, where formatting an object would cause Prettier to crash.</p>
<hr>
<h1>Thanks! <g-emoji alias="heart" fallback-src="https://assets-cdn.github.com/images/icons/emoji/unicode/2764.png" ios-version="6.0">❤️</g-emoji></h1>
<p>Thanks to everyone who contributed to this release, as well as those who raised issues! Prettier has become a highly stable piece of software that a large amount of people trust with their code. We take that trust seriously, and fix rare issues that break code with the highest priority. We can't fix these issues if we don't know about them, so never be afraid to <a href="https://urls.greenkeeper.io/prettier/prettier/issues/new">create an issue</a>!</p>
</details>



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

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


---


Your [Greenkeeper](https://greenkeeper.io) Bot :palm_tree:

Missing support for releaseRules external module in semantic-release shareable configuration

I've got a shareable semantic-release config and want to add releaseRules. I figured it'd be neat to put it in a separate file because that's noted in the docs. Unfortunately, it looks like commit-analyzer isn't able to resolve the file relative to the shareable configuration - I suspect I'll either need to use require or just inline the releaseRules.

I imagine we don't really want to have to figure out how to resolve a relative path referenced by a file that we have no easy way to locate, so maybe we could note this limitation in the README.

Add remaining Angular commit types to default release rules

From the conventional commits spec:

types other than fix: and feat: are allowed, for example @commitlint/config-conventional (based on the the Angular convention) recommends build:, chore:, ci:, docs:, style:, refactor:, perf:, test:, and others.

Currently the release rules are based on a variety of conventions and a few examples from the Angular convention are used.

Would you be open to support the full range of Angular commit types, as it's also mentioned in the spec?

  • build
  • ci
  • docs
  • feat
  • fix
  • perf
  • refactor
  • style
  • test
  • revert

(from Angular contributing guidelines, plus the special "revert")

They are also mentioned in conventional-commit-types.

An in-range update of semantic-release is breaking the build 🚨

Version 15.9.7 of semantic-release was just published.

Branch Build failing 🚨
Dependency semantic-release
Current Version 15.9.6
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes v15.9.7

15.9.7 (2018-08-10)

Reverts

  • "fix: do not convert ssh repositoryUrl to https" (93377eb)
Commits

The new version differs by 1 commits.

  • 93377eb revert: "fix: do not convert ssh repositoryUrl to https"

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Commits not triggering release

Current behavior

Using the following .releaserc file

{
"branches": ["main"]
}

I have tried multiple commits including Breaking Change none of them are triggering. Not sure if this is a bug or a configuration issue, please advice.

Expected behavior

Expecting a release

Environment

semantic-release version: Running semantic-release version ^17.1.1
CI environment: Github action (see link above)
Plugins used: -
semantic-release configuration: https://github.com/contactvinoth89/HTMLReport4Jest/blob/main/.releaserc
CI logs: https://github.com/contactvinoth89/HTMLReport4Jest/runs/961783213?check_suite_focus=true

set parserOpts from external file

is it possible to set parserOpts from an external file, like releaseRules, cause you can't override the option headerPattern in the package.json since it's a regex expression ?

Handle commits of type "revert"

Given commits: A -> B -> C -> D -> HEAD

I did:

$ git revert --no-commit D
$ git revert --no-commit C
$ git revert --no-commit B
$ git commit -m "revert(something): restore some other thing"

semantic-release skipped a new release for this commit.

Is this expected behaviour? What is the correct way to revert commits and make a new release?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.