From 42bc241ba16685f71738a6dc5142874798e9b363 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 16 Jul 2019 15:15:52 +0200 Subject: [PATCH] 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 --- .all-contributorsrc | 20 ++++-- README.md | 70 ++++++++++++++++++- .../__tests__/__snapshots__/index.js.snap | 10 ++- src/generate/__tests__/index.js | 5 +- src/generate/index.js | 6 +- .../add-contributors-list.js.snap | 15 +++- src/init/init-content.js | 15 ++-- 7 files changed, 122 insertions(+), 19 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index ed7d456..707f6c9 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -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" + ] } diff --git a/README.md b/README.md index eca1488..c51e930 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ + + + +- [ + all-contributors-cli + ](#all-contributors-cli) + - [The problem](#the-problem) + - [This solution](#this-solution) + - [Using the all-contributors-cli](#using-the-all-contributors-cli) + - [Contributors](#contributors) + - [LICENSE](#license) + + + > [There is now a GitHub Bot](https://github.com/all-contributors/all-contributors-bot) for automating the maintenance of your contributors table ✨
Say goodbye to command line tool dependencies and hello to the [@all-contributors bot πŸ€–](https://github.com/all-contributors/all-contributors-bot)

@@ -32,7 +46,7 @@ [![Code Coverage](https://img.shields.io/codecov/c/github/all-contributors/all-contributors-cli.svg)](https://codecov.io/github/all-contributors/all-contributors-cli) [![Version](https://img.shields.io/npm/v/all-contributors-cli.svg)](https://www.npmjs.com/package/all-contributors-cli) [![Downloads](https://img.shields.io/npm/dm/all-contributors-cli.svg)](http://www.npmtrends.com/all-contributors-cli) -[![All Contributors](https://img.shields.io/badge/all_contributors-32-orange.svg?style=flat-square)](#contributors) +[![All Contributors](https://img.shields.io/badge/all_contributors-33-orange.svg?style=flat-square)](#contributors) [![Star on Github](https://img.shields.io/github/stars/all-contributors/all-contributors-cli.svg?style=social)](https://github.com/all-contributors/all-contributors-cli/stargazers) ## The problem @@ -56,8 +70,58 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): - -
Jeroen Engels
Jeroen Engels

πŸ’» πŸ“– ⚠️
Kent C. Dodds
Kent C. Dodds

πŸ“– πŸ’»
JoΓ£o GuimarΓ£es
JoΓ£o GuimarΓ£es

πŸ’»
Ben Briggs
Ben Briggs

πŸ’»
Itai Steinherz
Itai Steinherz

πŸ“– πŸ’»
Alex Jover
Alex Jover

πŸ’» πŸ“–
Jerod Santo
Jerod Santo

πŸ’»
Kevin Jalbert
Kevin Jalbert

πŸ’»
tunnckoCore
tunnckoCore

πŸ”§
Mehdi Achour
Mehdi Achour

πŸ’»
Roy Revelt
Roy Revelt

πŸ›
Chris Vickery
Chris Vickery

πŸ’»
Bryce Reynolds
Bryce Reynolds

πŸ’»
James, please
James, please

πŸ€” πŸ’»
Spyros Ioakeimidis
Spyros Ioakeimidis

πŸ’»
Fernando Costa
Fernando Costa

πŸ’»
snipe
snipe

πŸ“–
Gant Laborde
Gant Laborde

πŸ’»
Md Zubair Ahmed
Md Zubair Ahmed

πŸ“– πŸ› πŸ’» ⚠️
Divjot Singh
Divjot Singh

πŸ“–
JoΓ£o Marques
JoΓ£o Marques

πŸ’» πŸ“– πŸ€”
Andrew Lisowski
Andrew Lisowski

πŸ’» πŸ“– ⚠️
Xianming Zhong
Xianming Zhong

πŸ“–
C.Y.Xu
C.Y.Xu

πŸ’»
Dura
Dura

πŸ“–
Jake Bolam
Jake Bolam

πŸš‡ πŸ’» πŸ“– ⚠️
Maximilian Berkmann
Maximilian Berkmann

πŸ’» ⚠️ πŸ“–
tbenning
tbenning

🎨
ehmicky
ehmicky

πŸ’»
James George
James George

πŸ’»
Nick Schonning
Nick Schonning

πŸ’»
Cezar Augusto
Cezar Augusto

πŸ“–
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Jeroen Engels
Jeroen Engels

πŸ’» πŸ“– ⚠️
Kent C. Dodds
Kent C. Dodds

πŸ“– πŸ’»
JoΓ£o GuimarΓ£es
JoΓ£o GuimarΓ£es

πŸ’»
Ben Briggs
Ben Briggs

πŸ’»
Itai Steinherz
Itai Steinherz

πŸ“– πŸ’»
Alex Jover
Alex Jover

πŸ’» πŸ“–
Jerod Santo
Jerod Santo

πŸ’»
Kevin Jalbert
Kevin Jalbert

πŸ’»
tunnckoCore
tunnckoCore

πŸ”§
Mehdi Achour
Mehdi Achour

πŸ’»
Roy Revelt
Roy Revelt

πŸ›
Chris Vickery
Chris Vickery

πŸ’»
Bryce Reynolds
Bryce Reynolds

πŸ’»
James, please
James, please

πŸ€” πŸ’»
Spyros Ioakeimidis
Spyros Ioakeimidis

πŸ’»
Fernando Costa
Fernando Costa

πŸ’»
snipe
snipe

πŸ“–
Gant Laborde
Gant Laborde

πŸ’»
Md Zubair Ahmed
Md Zubair Ahmed

πŸ“– πŸ› πŸ’» ⚠️
Divjot Singh
Divjot Singh

πŸ“–
JoΓ£o Marques
JoΓ£o Marques

πŸ’» πŸ“– πŸ€”
Andrew Lisowski
Andrew Lisowski

πŸ’» πŸ“– ⚠️
Xianming Zhong
Xianming Zhong

πŸ“–
C.Y.Xu
C.Y.Xu

πŸ’»
Dura
Dura

πŸ“–
Jake Bolam
Jake Bolam

πŸš‡ πŸ’» πŸ“– ⚠️
Maximilian Berkmann
Maximilian Berkmann

πŸ’» ⚠️ πŸ“–
tbenning
tbenning

🎨
ehmicky
ehmicky

πŸ’»
James George
James George

πŸ’»
Nick Schonning
Nick Schonning

πŸ’»
Cezar Augusto
Cezar Augusto

πŸ“–
Jeppe Reinhold
Jeppe Reinhold

πŸ’»
+ + + diff --git a/src/generate/__tests__/__snapshots__/index.js.snap b/src/generate/__tests__/__snapshots__/index.js.snap index 74d677a..ba2c6e0 100644 --- a/src/generate/__tests__/__snapshots__/index.js.snap +++ b/src/generate/__tests__/__snapshots__/index.js.snap @@ -8,7 +8,8 @@ Description ## Contributors These people contributed to the project: - + + @@ -17,6 +18,8 @@ These people contributed to the project:
Kent C. Dodds is awesome!
+ + Thanks a lot everyone!" @@ -30,7 +33,8 @@ Description ## Contributors These people contributed to the project: - + + @@ -45,6 +49,8 @@ These people contributed to the project:
Kent C. Dodds is awesome!
+ + Thanks a lot everyone!" diff --git a/src/generate/__tests__/index.js b/src/generate/__tests__/index.js index abe5f04..c82f5bf 100644 --- a/src/generate/__tests__/index.js +++ b/src/generate/__tests__/index.js @@ -119,7 +119,10 @@ test('inject nothing if there are no contributors', () => { '## Contributors', 'These people contributed to the project:', '', - '', + '', + '', + '', + '', '', '', 'Thanks a lot everyone!', diff --git a/src/generate/index.js b/src/generate/index.js index 5fd0b9a..9141e21 100644 --- a/src/generate/index.js +++ b/src/generate/index.js @@ -28,8 +28,12 @@ function injectListBetweenTags(newContent) { } return [ previousContent.slice(0, endOfOpeningTagIndex + closingTag.length), - '\n', + '\n', + '\n', newContent, + '', + '\n', + '\n', previousContent.slice(startOfClosingTagIndex), ].join('') } diff --git a/src/init/__tests__/__snapshots__/add-contributors-list.js.snap b/src/init/__tests__/__snapshots__/add-contributors-list.js.snap index 3877768..5500e59 100644 --- a/src/init/__tests__/__snapshots__/add-contributors-list.js.snap +++ b/src/init/__tests__/__snapshots__/add-contributors-list.js.snap @@ -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)): - + + + + 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)): - + + + + 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 - + + + + " `; diff --git a/src/init/init-content.js b/src/init/init-content.js index 20f08eb..9d433a5 100644 --- a/src/init/init-content.js +++ b/src/init/init-content.js @@ -7,7 +7,10 @@ const headerContent = 'Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):' const listContent = [ '', - '', + '', + '', + '', + '', '', ].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, ) }