Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Remove trailing period enforcement from PR titles #106

Merged
merged 1 commit into from
Jun 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/__snapshots__/markdown-renderer.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ Array [
`;

exports[`MarkdownRenderer renderContributionList renders a list of contributions 1`] = `
"* My cool PR. ([@hzoo](http://hzoo.com))
* [#42](http://github.com/42) My cool PR. ([@hzoo](http://hzoo.com))"
"* My cool PR ([@hzoo](http://hzoo.com))
* [#42](http://github.com/42) My cool PR ([@hzoo](http://hzoo.com))"
`;

exports[`MarkdownRenderer renderContributorList renders a list of GitHub users 1`] = `
Expand Down
42 changes: 21 additions & 21 deletions src/functional/__snapshots__/markdown-full.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`createMarkdown multiple tags outputs correct changelog 1`] = `

#### :rocket: New Feature
* \`a-new-hope\`
* [#1](https://github.com/lerna/lerna-changelog/pull/1) feat: May the force be with you. ([@luke](https://github.com/luke))
* [#1](https://github.com/lerna/lerna-changelog/pull/1) feat: May the force be with you ([@luke](https://github.com/luke))

#### Committers: 1
- Luke Skywalker ([@luke](https://github.com/luke))
Expand All @@ -16,7 +16,7 @@ exports[`createMarkdown multiple tags outputs correct changelog 1`] = `

#### :rocket: New Feature
* \`a-new-hope\`
* [#1](https://github.com/lerna/lerna-changelog/pull/1) feat: May the force be with you. ([@luke](https://github.com/luke))
* [#1](https://github.com/lerna/lerna-changelog/pull/1) feat: May the force be with you ([@luke](https://github.com/luke))

#### Committers: 1
- Luke Skywalker ([@luke](https://github.com/luke))
Expand All @@ -26,7 +26,7 @@ exports[`createMarkdown multiple tags outputs correct changelog 1`] = `

#### :rocket: New Feature
* \`a-new-hope\`
* [#1](https://github.com/lerna/lerna-changelog/pull/1) feat: May the force be with you. ([@luke](https://github.com/luke))
* [#1](https://github.com/lerna/lerna-changelog/pull/1) feat: May the force be with you ([@luke](https://github.com/luke))

#### Committers: 1
- Luke Skywalker ([@luke](https://github.com/luke))"
Expand All @@ -37,10 +37,10 @@ exports[`createMarkdown single project outputs correct changelog 1`] = `
## Unreleased (2099-01-01)

#### :rocket: New Feature
* [#7](https://github.com/lerna/lerna-changelog/pull/7) feat: that is not how the Force works!. ([@han-solo](https://github.com/han-solo))
* [#7](https://github.com/lerna/lerna-changelog/pull/7) feat: that is not how the Force works! ([@han-solo](https://github.com/han-solo))

#### :nail_care: Enhancement
* [#7](https://github.com/lerna/lerna-changelog/pull/7) feat: that is not how the Force works!. ([@han-solo](https://github.com/han-solo))
* [#7](https://github.com/lerna/lerna-changelog/pull/7) feat: that is not how the Force works! ([@han-solo](https://github.com/han-solo))

#### Committers: 1
- Han Solo ([@han-solo](https://github.com/han-solo))
Expand All @@ -49,16 +49,16 @@ exports[`createMarkdown single project outputs correct changelog 1`] = `
## v6.0.0 (1983-05-25)

#### :rocket: New Feature
* [#5](https://github.com/lerna/lerna-changelog/pull/5) feat: I am your father. ([@vader](https://github.com/vader))
* [#5](https://github.com/lerna/lerna-changelog/pull/5) feat: I am your father ([@vader](https://github.com/vader))

#### :bug: Bug Fix
* [#4](https://github.com/lerna/lerna-changelog/pull/4) fix: RRRAARRWHHGWWR. ([@chewbacca](https://github.com/chewbacca))
* [#4](https://github.com/lerna/lerna-changelog/pull/4) fix: RRRAARRWHHGWWR ([@chewbacca](https://github.com/chewbacca))

#### :nail_care: Enhancement
* [#6](https://github.com/lerna/lerna-changelog/pull/6) refactor: he is my brother. ([@princess-leia](https://github.com/princess-leia))
* [#6](https://github.com/lerna/lerna-changelog/pull/6) refactor: he is my brother ([@princess-leia](https://github.com/princess-leia))

#### :house: Maintenance
* [#4](https://github.com/lerna/lerna-changelog/pull/4) fix: RRRAARRWHHGWWR. ([@chewbacca](https://github.com/chewbacca))
* [#4](https://github.com/lerna/lerna-changelog/pull/4) fix: RRRAARRWHHGWWR ([@chewbacca](https://github.com/chewbacca))

#### Committers: 3
- Chwebacca ([@chewbacca](https://github.com/chewbacca))
Expand All @@ -69,10 +69,10 @@ exports[`createMarkdown single project outputs correct changelog 1`] = `
## v5.0.0 (1980-05-17)

#### :boom: Breaking Change
* [#2](https://github.com/lerna/lerna-changelog/pull/2) chore: Terminate her... immediately!. ([@gtarkin](https://github.com/gtarkin))
* [#2](https://github.com/lerna/lerna-changelog/pull/2) chore: Terminate her... immediately! ([@gtarkin](https://github.com/gtarkin))

#### :bug: Bug Fix
* [#3](https://github.com/lerna/lerna-changelog/pull/3) fix: Get me the rebels base!. ([@vader](https://github.com/vader))
* [#3](https://github.com/lerna/lerna-changelog/pull/3) fix: Get me the rebels base! ([@vader](https://github.com/vader))

#### Committers: 2
- Darth Vader ([@vader](https://github.com/vader))
Expand All @@ -82,7 +82,7 @@ exports[`createMarkdown single project outputs correct changelog 1`] = `
## v4.0.0 (1977-05-25)

#### :rocket: New Feature
* [#1](https://github.com/lerna/lerna-changelog/pull/1) feat: May the force be with you. ([@luke](https://github.com/luke))
* [#1](https://github.com/lerna/lerna-changelog/pull/1) feat: May the force be with you ([@luke](https://github.com/luke))

#### Committers: 1
- Luke Skywalker ([@luke](https://github.com/luke))"
Expand All @@ -94,11 +94,11 @@ exports[`createMarkdown single tags outputs correct changelog 1`] = `

#### :rocket: New Feature
* \`the-force-awakens\`, \`rogue-one\`
* [#7](https://github.com/lerna/lerna-changelog/pull/7) feat: that is not how the Force works!. ([@han-solo](https://github.com/han-solo))
* [#7](https://github.com/lerna/lerna-changelog/pull/7) feat: that is not how the Force works! ([@han-solo](https://github.com/han-solo))

#### :nail_care: Enhancement
* \`the-force-awakens\`, \`rogue-one\`
* [#7](https://github.com/lerna/lerna-changelog/pull/7) feat: that is not how the Force works!. ([@han-solo](https://github.com/han-solo))
* [#7](https://github.com/lerna/lerna-changelog/pull/7) feat: that is not how the Force works! ([@han-solo](https://github.com/han-solo))

#### Committers: 1
- Han Solo ([@han-solo](https://github.com/han-solo))
Expand All @@ -108,19 +108,19 @@ exports[`createMarkdown single tags outputs correct changelog 1`] = `

#### :rocket: New Feature
* \`return-of-the-jedi\`
* [#5](https://github.com/lerna/lerna-changelog/pull/5) feat: I am your father. ([@vader](https://github.com/vader))
* [#5](https://github.com/lerna/lerna-changelog/pull/5) feat: I am your father ([@vader](https://github.com/vader))

#### :bug: Bug Fix
* \`return-of-the-jedi\`
* [#4](https://github.com/lerna/lerna-changelog/pull/4) fix: RRRAARRWHHGWWR. ([@chewbacca](https://github.com/chewbacca))
* [#4](https://github.com/lerna/lerna-changelog/pull/4) fix: RRRAARRWHHGWWR ([@chewbacca](https://github.com/chewbacca))

#### :nail_care: Enhancement
* \`return-of-the-jedi\`
* [#6](https://github.com/lerna/lerna-changelog/pull/6) refactor: he is my brother. ([@princess-leia](https://github.com/princess-leia))
* [#6](https://github.com/lerna/lerna-changelog/pull/6) refactor: he is my brother ([@princess-leia](https://github.com/princess-leia))

#### :house: Maintenance
* \`return-of-the-jedi\`
* [#4](https://github.com/lerna/lerna-changelog/pull/4) fix: RRRAARRWHHGWWR. ([@chewbacca](https://github.com/chewbacca))
* [#4](https://github.com/lerna/lerna-changelog/pull/4) fix: RRRAARRWHHGWWR ([@chewbacca](https://github.com/chewbacca))

#### Committers: 3
- Chwebacca ([@chewbacca](https://github.com/chewbacca))
Expand All @@ -132,11 +132,11 @@ exports[`createMarkdown single tags outputs correct changelog 1`] = `

#### :boom: Breaking Change
* \`empire-strikes-back\`
* [#2](https://github.com/lerna/lerna-changelog/pull/2) chore: Terminate her... immediately!. ([@gtarkin](https://github.com/gtarkin))
* [#2](https://github.com/lerna/lerna-changelog/pull/2) chore: Terminate her... immediately! ([@gtarkin](https://github.com/gtarkin))

#### :bug: Bug Fix
* \`empire-strikes-back\`
* [#3](https://github.com/lerna/lerna-changelog/pull/3) fix: Get me the rebels base!. ([@vader](https://github.com/vader))
* [#3](https://github.com/lerna/lerna-changelog/pull/3) fix: Get me the rebels base! ([@vader](https://github.com/vader))

#### Committers: 2
- Darth Vader ([@vader](https://github.com/vader))
Expand All @@ -147,7 +147,7 @@ exports[`createMarkdown single tags outputs correct changelog 1`] = `

#### :rocket: New Feature
* \`a-new-hope\`
* [#1](https://github.com/lerna/lerna-changelog/pull/1) feat: May the force be with you. ([@luke](https://github.com/luke))
* [#1](https://github.com/lerna/lerna-changelog/pull/1) feat: May the force be with you ([@luke](https://github.com/luke))

#### Committers: 1
- Luke Skywalker ([@luke](https://github.com/luke))"
Expand Down
8 changes: 4 additions & 4 deletions src/markdown-renderer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,22 @@ describe("MarkdownRenderer", () => {

it(`renders basic GitHub PRs`, () => {
const result = renderer().renderContribution(BASIC_COMMIT);
expect(result).toEqual("My cool PR. ([@hzoo](http://hzoo.com))");
expect(result).toEqual("My cool PR ([@hzoo](http://hzoo.com))");
});

it(`renders GitHub PRs with numbers`, () => {
const result = renderer().renderContribution(COMMIT_WITH_NUMBER);
expect(result).toEqual("[#42](http://github.com/42) My cool PR. ([@hzoo](http://hzoo.com))");
expect(result).toEqual("[#42](http://github.com/42) My cool PR ([@hzoo](http://hzoo.com))");
});

it(`normalizes GitHub issue references`, () => {
const result = renderer().renderContribution(COMMIT_WITH_GH_ISSUE_REF);
expect(result).toEqual("My cool PR (Closes [#123](http://foo.bar/123)). ([@hzoo](http://hzoo.com))");
expect(result).toEqual("My cool PR (Closes [#123](http://foo.bar/123)) ([@hzoo](http://hzoo.com))");
});

it(`normalizes Phabricator issue references`, () => {
const result = renderer().renderContribution(COMMIT_WITH_PHAB_ISSUE_REF);
expect(result).toEqual("My cool PR (Closes [#42](http://foo.bar/42)). ([@hzoo](http://hzoo.com))");
expect(result).toEqual("My cool PR (Closes [#42](http://foo.bar/42)) ([@hzoo](http://hzoo.com))");
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/markdown-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default class MarkdownRenderer {
issue.title = issue.title.replace(COMMIT_FIX_REGEX, `Closes [#$3](${this.options.baseIssueUrl}$3)`);
}

markdown += `${issue.title}. ([@${issue.user.login}](${issue.user.html_url}))`;
markdown += `${issue.title} ([@${issue.user.login}](${issue.user.html_url}))`;

return markdown;
}
Expand Down