GithubHelp home page GithubHelp logo

pr-log's Introduction

NPM Version GitHub Actions status Coverage Status


pr-log

Changelog generator based on GitHub Pull Requests

The main features:

  • Writes in a CHANGELOG.md from merged GitHub pull requests since the last tag. This works by
    • first getting a list of all tags
    • than removing all tags that are not compatible to semver versioning
    • sort the tags
    • getting the git log from the last tag until now
    • If no CHANGELOG.md existed, it will create the file else it will write prepending to it
  • Friendly CLI
    • Get usage by running pr-log --help
    • Error messages that help correcting usage mistakes. E.g.
      • Missing first command line argument: Error: version-number not specified
      • Local branch is outdated compared to the remote branch: Error: Local git master branch is 0 commits ahead and 2 commits behind of origin/master
      • The current working directory is not clean (e.g. contains files that are modified): Error: Local copy is not clean
  • Well tested

Install

Simply run this to install pr-log:

npm install pr-log

Setup and configuration

You have to follow these steps to use pr-log without problems.

GitHub

The following categories are defined by default:

GitHub label Human friendly name Description
breaking Breaking Changes Backwards-incompatible changes
bug Bug Fixes Changes that only fix a bug
feature Features New features
enhancement Enhancements Non-breaking improvements of existing features
documentation Documentation Changes to documentation and/or README
upgrade Dependency Upgrades Any kind of dependency updates
refactor Code Refactoring Changes that don’t affect the behavior but improve the code quality
build Build-Related Changes related to the build process and/or CI/CD pipeline

However, you can also create a custom mapping by adding a pr-log.validLabels section to your package.json. validLabels must be specified as an array of key, value pairs. The same order will be used to format the changelog sections. For example:

{
    "pr-log": {
        "validLabels": [
            ["core", "Core features"],
            ["addon", "Addons"]
        ]
    }
}

To use pr-log your GitHub project needs some small configuration:

  • Create the labels mentioned above (you can create GitHub labels from Issues -> Labels -> New Label)
  • Set the correct label on your pull requests - you need to set exactly one label, multiple labels or one that is not recognized will throw an error
  • Use correct semver versioning for your tags (e.g. 2.4.7)

Project

As pr-log reads repository information from your project you have to add the repository information in your package.json

{
    "repository": {
        "type": "git",
        "url": "https://github.com/<your username>/<your repository name>.git"
    }
}

Changelog formatting

Custom date format

If you want to use a custom date format you can configure pr-log.dateFormat in your package.json. For example:

{
    "pr-log": { "dateFormat": "dd.MM.yyyy" }
}

Please refer to the dates-fn documentation for details about the format expressions.

Usage

To create or update your changelog run

pr-log [options] <version-number> where version-number is the name of this release

Example:

Given the following setup:

  • In GitHub a tag named 2.0.0 exists that is behind master
  • A pull request (#13) was created since the last tag that has the label breaking
  • A pull request (#22) was created since the last tag that has the label documentation

pr-log 2.0.0 creates a changelog with the following example content:

## 2.0.0 (January 20, 2015)

### Breaking Changes

-   Use new (backwards incompatible) version of module XYZ (#13)

### Documentation

-   Fix some spelling mistakes in documentation. (#22)

Options

--sloppy

The --sloppy option defaults to false. When set, it allows pr-log to generate a changelog even when you are not on the master branch. This should not be used in production!

--trace

When enabled this option outputs the stacktrace of an error additionally to the error message to stderr.

Correct usage makes a clean and complete changelog

If you want your changelog to be complete and clean you have to follow these rules:

  1. Don't commit directly to master - if you do, your changes will not be covered in the changelog (this might be ok but you should know this implication)
  2. Use pull requests for your features that you want to be in your changelog
  3. Use the correct categories for your pull request: If you introduce a new feature that will be a breaking change, give it the according label breaking (which will later result in this feature being listed under the Breaking Changes point in your changelog)

Github Authentication

If you need to authenticate pr-log, e.g. to access a private repo, you can set the GH_TOKEN environment variable. Generate a token value in your Github settings.

GH_TOKEN=xxxxxxxxx pr-log [options] <version-number>

Reason for this project

Many projects have problems with their changelogs. Most of them try one of the following ways

  • manually write change logs: This is error-prone and the log will not be consistent
  • generating it from commit messages: As there are often far more commits than useful messages for the changelog, this will hide important features because there are too many to read everything

Other challenges for good changelogs:

  • Different categories (e.g. breaking changes)
  • Only include changes starting from a certain tag

More complete example CHANGELOG.md

After working for some time with the tool and having e.g. two releases, the file content could look like this:

## 2.0.0 (January 20, 2015)

### Breaking Changes

-   Use new (backwards incompatible) version of module XYZ (#13)

### Features

-   Add fancy feature (#2)
-

### Documentation

-   Fix some spelling mistakes in documentation. (#22)

## 1.1.0 (November 3, 2014)

pr-log's People

Contributors

greenkeeper[bot] avatar greenkeeperio-bot avatar lo1tuma avatar renovate-bot avatar renovate[bot] avatar shilman 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

Watchers

 avatar  avatar

pr-log's Issues

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


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 🌴

Remove dependency to proxyquire

This project relies heavily proxyquire in the test suite. This shows that the amount of entanglement is too high and the software is not designed for testability to a good extent.

I'd propose to redesign all parts of the software that have to be tested with proxyquire to allow e.g. dependency injection.

Add documentation

Currently a README.md is missing that clarifies how the tool can be

  • installed
  • executed
  • used in general for managing your changelogs of a project

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • ⬆️ Update dependency date-fns to v2.30.0
  • ⬆️ Update dependency eslint-plugin-import to v2.28.1
  • ⬆️ Update dependency ramda to v0.29.0
  • ⬆️ Update dependency @octokit/rest to v20
  • ⬆️ Update dependency commander to v11
  • ⬆️ Update dependency eslint-config-joyn to v2
  • ⬆️ Update dependency eslint-plugin-ava to v14
  • ⬆️ Update dependency eslint-plugin-prettier to v5
  • ⬆️ Update dependency eslint-plugin-unicorn to v48
  • ⬆️ Update dependency prettier to v3
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/setup-node v3
npm
package.json
  • @octokit/rest 19.0.5
  • commander 9.4.1
  • date-fns 2.29.3
  • git-promise 1.0.0
  • git-url-parse 13.1.0
  • parse-github-repo-url 1.4.1
  • prepend 1.0.2
  • ramda 0.28.0
  • semver 7.3.8
  • @babel/cli 7.19.3
  • @babel/preset-env 7.19.4
  • @babel/register 7.18.9
  • ava 5.0.1
  • babel-plugin-istanbul 6.1.1
  • eslint 8.26.0
  • eslint-config-joyn 0.39.0
  • eslint-plugin-array-func 3.1.7
  • eslint-plugin-ava 13.2.0
  • eslint-plugin-eslint-comments 3.2.0
  • eslint-plugin-import 2.26.0
  • eslint-plugin-no-secrets 0.8.9
  • eslint-plugin-node 11.1.0
  • eslint-plugin-optimize-regex 1.2.1
  • eslint-plugin-prettier 4.2.1
  • eslint-plugin-promise 6.1.1
  • eslint-plugin-unicorn 44.0.2
  • nyc 15.1.0
  • prettier 2.7.1
  • sinon 14.0.1
  • node ^18

  • Check this box to trigger a request for Renovate to run again on this repository

Rewrite to use ES2015

ES2015 offers a wide variety off advantages over ES5 that we could make use of to make our code better readable, more concise and just modern (which might help in attracting contributors as well as keep existing ones).

Some steps that would have to be handled for this:

  • Add a transpiling step that takes care of converting ES2015 code to ES5
  • Rewriting the code to use ES2015
  • Publishing the tool as ES5 code

I'm not 100% sure but I'd not see this as a major update as it does not have an impact on the usage of the tool or a breaking change.

An in-range update of @octokit/rest is breaking the build 🚨

Version 15.9.4 of @octokit/rest was just published.

Branch Build failing 🚨
Dependency @octokit/rest
Current Version 15.9.3
Type dependency

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

@octokit/rest is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • coverage/coveralls Coverage pending from Coveralls.io Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes v15.9.4

15.9.4 (2018-06-30)

Bug Fixes

Commits

The new version differs by 2 commits.

  • ef2b493 fix: lambda compatibility (#939)
  • 7bcaa4e build(package): update @octokit/routes to version 11.1.1 (#938)

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 🌴

Error: Local copy is not clean

after running GH_TOKEN=xxx pr-log v1.3.400 --trace got this error

{ Deprecation: [@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.
...
Error: Local copy is not clean
...

dependencies

"pr-log": "^4.0.0"

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

Version 5.5.0 of semver was just published.

Branch Build failing 🚨
Dependency semver
Current Version 5.4.1
Type dependency

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

semver is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

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 7 commits.

  • 44cbc84 v5.5.0
  • 1d37529 Cleaned up coerce behavior
  • e7092b4 Improved coerce regex and added coerce to README.
  • 68cef2d Added version coercion to the module and CLI.
  • ec6f97a range.bnf: Fix invalid bracket expression
  • 906b664 travis: don't cache node_modules
  • 7184ff4 range.bnf: Remove unnecessary empty entry

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 eslint is breaking the build 🚨

Version 4.14.0 of eslint was just published.

Branch Build failing 🚨
Dependency eslint
Current Version 4.13.1
Type devDependency

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

eslint 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 v4.14.0
  • be2f57e Update: support separate requires in one-var. (fixes #6175) (#9441) (薛定谔的猫)
  • 370d614 Docs: Fix typos (#9751) (Jed Fox)
  • 8196c45 Chore: Reorganize CLI options and associated docs (#9758) (Kevin Partington)
  • 75c7419 Update: Logical-and is counted in complexity rule (fixes #8535) (#9754) (Kevin Partington)
  • eb4b1e0 Docs: reintroduce misspelling in valid-typeof example (#9753) (Teddy Katz)
  • ae51eb2 New: Add allowImplicit option to array-callback-return (fixes #8539) (#9344) (James C. Davis)
  • e9d5dfd Docs: improve no-extra-parens formatting (#9747) (Rich Trott)
  • 37d066c Chore: Add unit tests for overrides glob matching. (#9744) (Robert Jackson)
  • 805a94e Chore: Fix typo in CLIEngine test name (#9741) (@scriptdaemon)
  • 1c2aafd Update: Improve parser integrations (fixes #8392) (#8755) (Toru Nagashima)
  • 4ddc131 Upgrade: debug@^3.1.0 (#9731) (Kevin Partington)
  • f252c19 Docs: Make the lint message source property a little more subtle (#9735) (Jed Fox)
  • 5a5c23c Docs: fix the link to contributing page (#9727) (Victor Hom)
  • f44ce11 Docs: change beginner to good first issue label text (#9726) (Victor Hom)
  • 14baa2e Chore: improve arrow-body-style error message (refs #5498) (#9718) (Teddy Katz)
  • f819920 Docs: fix typos (#9723) (Thomas Broadley)
  • 43d4ba8 Fix: false positive on rulelines-between-class-members (fixes #9665) (#9680) (sakabar)
Commits

The new version differs by 19 commits.

  • 8d166b4 4.14.0
  • 5a29612 Build: changelog update for 4.14.0
  • be2f57e Update: support separate requires in one-var. (fixes #6175) (#9441)
  • 370d614 Docs: Fix typos (#9751)
  • 8196c45 Chore: Reorganize CLI options and associated docs (#9758)
  • 75c7419 Update: Logical-and is counted in complexity rule (fixes #8535) (#9754)
  • eb4b1e0 Docs: reintroduce misspelling in valid-typeof example (#9753)
  • ae51eb2 New: Add allowImplicit option to array-callback-return (fixes #8539) (#9344)
  • e9d5dfd Docs: improve no-extra-parens formatting (#9747)
  • 37d066c Chore: Add unit tests for overrides glob matching. (#9744)
  • 805a94e Chore: Fix typo in CLIEngine test name (#9741)
  • 1c2aafd Update: Improve parser integrations (fixes #8392) (#8755)
  • 4ddc131 Upgrade: debug@^3.1.0 (#9731)
  • f252c19 Docs: Make the lint message source property a little more subtle (#9735)
  • 5a5c23c Docs: fix the link to contributing page (#9727)

There are 19 commits in total.

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 @octokit/rest is breaking the build 🚨

☝️ Greenkeeper’s updated Terms of Service will come into effect on April 6th, 2018.

Version 15.1.8 of @octokit/rest was just published.

Branch Build failing 🚨
Dependency @octokit/rest
Current Version 15.1.7
Type dependency

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

@octokit/rest is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

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

Release Notes v15.1.8

15.1.8 (2018-03-08)

Bug Fixes

  • remove obsolete github.search.email() API (#795) (bf2f550)
Commits

The new version differs by 4 commits.

  • bf2f550 fix: remove obsolete github.search.email() API (#795)
  • 505ed1f chore(package): update semantic-release to version 15.0.0
  • 60bdd7a docs(README): remove @next npm badge
  • 44d6161 build(package): publish to @latest by default

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 eslint is breaking the build 🚨

Version 4.6.0 of eslint just got published.

Branch Build failing 🚨
Dependency eslint
Current Version 4.5.0
Type devDependency

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

As eslint 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 v4.6.0
  • 56dd769 Docs: fix link format in prefer-arrow-callback.md (#9198) (Vse Mozhet Byt)
  • 6becf91 Update: add eslint version to error output. (fixes #9037) (#9071) (薛定谔的猫)
  • 0e09973 New: function-paren-newline rule (fixes #6074) (#8102) (Teddy Katz)
  • 88a64cc Chore: Make parseJsonConfig() a pure function in Linter (#9186) (Teddy Katz)
  • 1bbac51 Fix: avoid breaking eslint-plugin-eslint-comments (fixes #9193) (#9196) (Teddy Katz)
  • 3e8b70a Fix: off-by-one error in eslint-disable comment checking (#9195) (Teddy Katz)
  • 73815f6 Docs: rewrite prefer-arrow-callback documentation (fixes #8950) (#9077) (Charles E. Morgan)
  • 0d3a854 Chore: avoid mutating report descriptors in report-translator (#9189) (Teddy Katz)
  • 2db356b Update: no-unused-vars Improve message to include the allowed patterns (#9176) (Eli White)
  • 8fbaf0a Update: Add configurability to generator-star-spacing (#8985) (Ethan Rutherford)
  • 8ed779c Chore: remove currentScopes property from Linter instances (refs #9161) (#9187) (Teddy Katz)
  • af4ad60 Fix: Handle error when running init without npm (#9169) (Gabriel Aumala)
  • 4b94c6c Chore: make parse() a pure function in Linter (refs #9161) (#9183) (Teddy Katz)
  • 1be5634 Chore: don't make Linter a subclass of EventEmitter (refs #9161) (#9177) (Teddy Katz)
  • e95af9b Chore: don't include internal test helpers in npm package (#9160) (Teddy Katz)
  • 6fb32e1 Chore: avoid using private Linter APIs in astUtils tests (refs #9161) (#9173) (Teddy Katz)
  • de6dccd Docs: add documentation for Linter methods (refs #6525) (#9151) (Teddy Katz)
  • 2d90030 Chore: remove unused assignment. (#9182) (薛定谔的猫)
  • d672aef Chore: refactor reporting logic (refs #9161) (#9168) (Teddy Katz)
  • 5ab0434 Fix: indent crash on sparse arrays with "off" option (fixes #9157) (#9166) (Teddy Katz)
  • c147b97 Chore: Make SourceCodeFixer accept text instead of a SourceCode instance (#9178) (Teddy Katz)
  • f127423 Chore: avoid using private Linter APIs in Linter tests (refs #9161) (#9175) (Teddy Katz)
  • 2334335 Chore: avoid using private Linter APIs in SourceCode tests (refs #9161) (#9174) (Teddy Katz)
  • 2dc243a Chore: avoid using internal Linter APIs in RuleTester (refs #9161) (#9172) (Teddy Katz)
  • d6e436f Fix: no-extra-parens reported some parenthesized IIFEs (fixes #9140) (#9158) (Teddy Katz)
  • e6b115c Build: Add an edit link to the rule docs’ metadata (#9049) (Jed Fox)
  • fcb7bb4 Chore: avoid unnecessarily complex forEach calls in no-extra-parens (#9159) (Teddy Katz)
  • ffa021e Docs: quotes rule - when does \n require backticks (#9135) (avimar)
  • 60c5148 Chore: improve coverage in lib/*.js (#9130) (Teddy Katz)
Commits

The new version differs by 31 commits.

  • 8f01a99 4.6.0
  • c0acbf2 Build: changelog update for 4.6.0
  • 56dd769 Docs: fix link format in prefer-arrow-callback.md (#9198)
  • 6becf91 Update: add eslint version to error output. (fixes #9037) (#9071)
  • 0e09973 New: function-paren-newline rule (fixes #6074) (#8102)
  • 88a64cc Chore: Make parseJsonConfig() a pure function in Linter (#9186)
  • 1bbac51 Fix: avoid breaking eslint-plugin-eslint-comments (fixes #9193) (#9196)
  • 3e8b70a Fix: off-by-one error in eslint-disable comment checking (#9195)
  • 73815f6 Docs: rewrite prefer-arrow-callback documentation (fixes #8950) (#9077)
  • 0d3a854 Chore: avoid mutating report descriptors in report-translator (#9189)
  • 2db356b Update: no-unused-vars Improve message to include the allowed patterns (#9176)
  • 8fbaf0a Update: Add configurability to generator-star-spacing (#8985)
  • 8ed779c Chore: remove currentScopes property from Linter instances (refs #9161) (#9187)
  • af4ad60 Fix: Handle error when running init without npm (#9169)
  • 4b94c6c Chore: make parse() a pure function in Linter (refs #9161) (#9183)

There are 31 commits in total.

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 🌴

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.