Skip to content

Commit e8ec0c8

Browse files
committed
Breaking: remove remark-git-contributors plugin
If you had a CONTRIBUTORS.md it will no longer be updated. Ref #38
1 parent d0a7ce3 commit e8ec0c8

4 files changed

Lines changed: 12 additions & 62 deletions

File tree

README.md

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@
2626
- [`validateLinks`](#validatelinks)
2727
- [`paddedTable`](#paddedtable)
2828
- [`toc`](#toc)
29-
- [`contributors`](#contributors)
3029
- [`plugins`](#plugins)
3130
- [`fixers`](#fixers)
3231
- [Opt-in Features](#opt-in-features)
3332
- [Table of Contents](#table-of-contents-1)
34-
- [Contributors Table](#contributors-table)
3533
- [Reporters](#reporters)
3634
- [Install](#install)
3735
- [License](#license)
@@ -230,10 +228,6 @@ Boolean. Set to `false` to keep markdown tables compact. A temporary option unti
230228

231229
Boolean. Set to `false` to skip generating (or replacing) a Table of Contents. A temporary option until we write a more flexible plugin ([#36](https://github.com/vweevers/hallmark/issues/36)).
232230

233-
### `contributors`
234-
235-
String or array. See [Contributors Table](#contributors-table) for details. Aliased as `community`. Set to `false` to disable this feature entirely.
236-
237231
### `plugins`
238232

239233
An array of extra plugins, to be applied in both lint and fix mode.
@@ -256,42 +250,6 @@ Add this heading to a markdown file:
256250

257251
Running `hallmark fix` will then create or update a table of contents.
258252

259-
### Contributors Table
260-
261-
_Note: this feature might get removed in a next major version ([#38](https://github.com/vweevers/hallmark/issues/38))._
262-
263-
Add this heading to an otherwise empty `CONTRIBUTORS.md`:
264-
265-
```markdown
266-
# Contributors
267-
```
268-
269-
Or this heading to a `README.md`:
270-
271-
```markdown
272-
## Contributors
273-
```
274-
275-
Running `hallmark fix` will then render contributors from `git` history to a markdown table. To add links to GitHub and social profiles of contributors, add the `contributors` [Package Option](#package-options):
276-
277-
```json
278-
"hallmark": {
279-
"contributors": [{
280-
"name": "Sara",
281-
"email": "sara@example.com",
282-
"github": "sara",
283-
"twitter": "sara"
284-
}]
285-
}
286-
```
287-
288-
Where `contributors` is either:
289-
290-
- An array in the form of `[{ email, name, … }, … ]`;
291-
- A module id or path to a file that exports `contributors` or `{ contributors }`.
292-
293-
Alternatively, put the metadata in the [`author` or `contributors` fields](https://docs.npmjs.com/files/package.json#people-fields-author-contributors) in `package.json`. For details, please see [`remark-git-contributors`](https://github.com/remarkjs/remark-git-contributors#metadata).
294-
295253
## Reporters
296254

297255
Various reporters are available:

index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function hallmark (options, callback) {
2121
const ignore = concat('ignore', rc, options)
2222

2323
deglob(files, { usePackageJson: false, cwd, ignore }, function (err, files) {
24-
if (err) throw err
24+
if (err) return callback(err)
2525

2626
if (!files.length) {
2727
callback(null, { code: 0, files: [] })
@@ -45,11 +45,18 @@ function hallmark (options, callback) {
4545
const paddedTable = rc.paddedTable !== false
4646
const validateLinks = rc.validateLinks !== false
4747
const toc = rc.toc !== false
48-
const contributors = 'contributors' in rc ? rc.contributors : rc.community
4948
const changelog = Object.assign({}, rc.changelog, options.changelog)
5049
const plugins = { plugins: concat('plugins', rc, options) }
5150
const fixers = { plugins: concat('fixers', rc, options) }
5251

52+
if ('contributors' in rc) {
53+
return callback(new Error("The 'contributors' option has been removed"))
54+
}
55+
56+
if ('community' in rc) {
57+
return callback(new Error("The 'community' option has been removed"))
58+
}
59+
5360
engine({
5461
processor,
5562
extensions: [
@@ -68,13 +75,6 @@ function hallmark (options, callback) {
6875
reporter,
6976
reporterOptions,
7077
plugins: [
71-
// Skip updating contributors table in lint mode
72-
fix && contributors !== false && options.contributors !== false
73-
? [require('remark-git-contributors'), {
74-
contributors: contributors || null
75-
}]
76-
: null,
77-
7878
[require('remark-common-changelog'), { cwd, fix, pkg, repository, ...changelog }],
7979
[require('remark-github'), { repository }],
8080

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"bin": "cli.js",
88
"main": "index.js",
99
"scripts": {
10-
"test": "standard && depcheck --ignores level-community && node cli.js && tape test/*.js",
10+
"test": "standard && depcheck && node cli.js && tape test/*.js",
1111
"hallmark": "node cli.js --fix",
1212
"check-licenses": "npm-consider install --test --production"
1313
},
@@ -27,7 +27,6 @@
2727
"remark-autolink-references": "^1.0.0",
2828
"remark-collapse": "~0.1.2",
2929
"remark-common-changelog": "^0.0.2",
30-
"remark-git-contributors": "^3.0.0",
3130
"remark-github": "^9.0.1",
3231
"remark-lint": "^7.0.1",
3332
"remark-lint-blockquote-indentation": "^2.0.1",
@@ -59,7 +58,6 @@
5958
"devDependencies": {
6059
"depcheck": "^1.2.0",
6160
"git-pull-or-clone": "^2.0.1",
62-
"level-community": "^3.0.0",
6361
"npm-consider": "^1.7.0",
6462
"standard": "^15.0.0",
6563
"tape": "^5.0.1",
@@ -88,9 +86,6 @@
8886
"engines": {
8987
"node": ">=6"
9088
},
91-
"hallmark": {
92-
"contributors": false
93-
},
9489
"config": {
9590
"allowedLicenseTypes": [
9691
"publicDomain",

test/dependents.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const dependents = [
1111
// 'deltachat/deltachat-node', // Invalid
1212
'Level/abstract-leveldown',
1313
'Level/bench',
14-
'Level/codec',
14+
'Level/transcoder',
1515
'Level/compose',
1616
'Level/deferred-leveldown',
1717
'Level/leveldown',
@@ -45,10 +45,7 @@ for (const repo of dependents) {
4545
cp.fork(cli, { cwd, stdio }).on('exit', function (code) {
4646
t.is(code, 0, 'hallmark linter exited with code 0')
4747

48-
// Skip CONTRIBUTORS.md for now (many dependents need updating)
49-
const args = ['--fix', '-i', 'CONTRIBUTORS.md']
50-
51-
cp.fork(cli, args, { cwd, stdio }).on('exit', function (code) {
48+
cp.fork(cli, ['--fix'], { cwd, stdio }).on('exit', function (code) {
5249
t.is(code, 0, 'hallmark fixer exited with code 0')
5350

5451
cp.execFile('git', ['diff', '--color'], { cwd }, function (err, stdout) {

0 commit comments

Comments
 (0)