feat: Make markdownlint ignore generated contributors table (#194)

* add markdownlint-disable and scope prettier-ignore

* re-generate contributors

* set commitConvention to angular, sort .all-contributorsrc
This commit is contained in:
Jeppe Reinhold 2019-07-16 15:15:52 +02:00 committed by Maximilian Berkmann
parent 6932adb080
commit 42bc241ba1
7 changed files with 122 additions and 19 deletions

View file

@ -5,6 +5,11 @@
"repoType": "github",
"commit": false,
"contributorsPerLine": 6,
"files": [
"README.md"
],
"repoHost": "https://github.com",
"commitConvention": "angular",
"contributors": [
{
"login": "jfmengels",
@ -311,10 +316,15 @@
"contributions": [
"doc"
]
},
{
"login": "JReinhold",
"name": "Jeppe Reinhold",
"avatar_url": "https://avatars1.githubusercontent.com/u/5678122?v=4",
"profile": "https://reinhold.is",
"contributions": [
"code"
]
}
],
"files": [
"README.md"
],
"repoHost": "https://github.com"
]
}

File diff suppressed because one or more lines are too long

View file

@ -8,7 +8,8 @@ Description
## Contributors
These people contributed to the project:
<!-- ALL-CONTRIBUTORS-LIST:START -->
<!-- prettier-ignore -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align=\\"center\\">Kent C. Dodds is awesome!</td>
@ -17,6 +18,8 @@ These people contributed to the project:
</tr>
</table>
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
Thanks a lot everyone!"
@ -30,7 +33,8 @@ Description
## Contributors
These people contributed to the project:
<!-- ALL-CONTRIBUTORS-LIST:START -->
<!-- prettier-ignore -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align=\\"center\\">Kent C. Dodds is awesome!</td>
@ -45,6 +49,8 @@ These people contributed to the project:
</tr>
</table>
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
Thanks a lot everyone!"

View file

@ -119,7 +119,10 @@ test('inject nothing if there are no contributors', () => {
'## Contributors',
'These people contributed to the project:',
'<!-- ALL-CONTRIBUTORS-LIST:START -->',
'<!-- prettier-ignore -->',
'<!-- prettier-ignore-start -->',
'<!-- markdownlint-disable -->',
'<!-- markdownlint-enable -->',
'<!-- prettier-ignore-end -->',
'<!-- ALL-CONTRIBUTORS-LIST:END -->',
'',
'Thanks a lot everyone!',

View file

@ -28,8 +28,12 @@ function injectListBetweenTags(newContent) {
}
return [
previousContent.slice(0, endOfOpeningTagIndex + closingTag.length),
'\n<!-- prettier-ignore -->',
'\n<!-- prettier-ignore-start -->',
'\n<!-- markdownlint-disable -->',
newContent,
'<!-- markdownlint-enable -->',
'\n<!-- prettier-ignore-end -->',
'\n',
previousContent.slice(startOfClosingTagIndex),
].join('')
}

View file

@ -7,7 +7,10 @@ exports[`create contributors section if content is empty 1`] = `
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!"
@ -22,7 +25,10 @@ Description
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!"
@ -36,6 +42,9 @@ Description
## Contributors
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->"
`;

View file

@ -7,7 +7,10 @@ const headerContent =
'Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):'
const listContent = [
'<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->',
'<!-- prettier-ignore -->',
'<!-- prettier-ignore-start -->',
'<!-- markdownlint-disable -->',
'<!-- markdownlint-enable -->',
'<!-- prettier-ignore-end -->',
'<!-- ALL-CONTRIBUTORS-LIST:END -->',
].join('\n')
const footerContent =
@ -18,7 +21,11 @@ function addBadge(lines) {
}
function splitAndRejoin(fn) {
return _.flow(_.split('\n'), fn, _.join('\n'))
return _.flow(
_.split('\n'),
fn,
_.join('\n'),
)
}
const findContributorsSection = _.findIndex(function isContributorsSection(
@ -43,8 +50,8 @@ function addContributorsList(lines) {
return injectContentBetween(
lines,
listContent,
insertionLine + 2,
insertionLine + 2,
insertionLine + 3,
insertionLine + 3,
)
}