diff --git a/README.md b/README.md index 6e0f947..ee24475 100644 --- a/README.md +++ b/README.md @@ -26,12 +26,10 @@ - [`validateLinks`](#validatelinks) - [`paddedTable`](#paddedtable) - [`toc`](#toc) - - [`contributors`](#contributors) - [`plugins`](#plugins) - [`fixers`](#fixers) - [Opt-in Features](#opt-in-features) - [Table of Contents](#table-of-contents-1) - - [Contributors Table](#contributors-table) - [Reporters](#reporters) - [Install](#install) - [License](#license) @@ -230,10 +228,6 @@ Boolean. Set to `false` to keep markdown tables compact. A temporary option unti 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)). -### `contributors` - -String or array. See [Contributors Table](#contributors-table) for details. Aliased as `community`. Set to `false` to disable this feature entirely. - ### `plugins` 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: Running `hallmark fix` will then create or update a table of contents. -### Contributors Table - -_Note: this feature might get removed in a next major version ([#38](https://github.com/vweevers/hallmark/issues/38))._ - -Add this heading to an otherwise empty `CONTRIBUTORS.md`: - -```markdown -# Contributors -``` - -Or this heading to a `README.md`: - -```markdown -## Contributors -``` - -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): - -```json -"hallmark": { - "contributors": [{ - "name": "Sara", - "email": "sara@example.com", - "github": "sara", - "twitter": "sara" - }] -} -``` - -Where `contributors` is either: - -- An array in the form of `[{ email, name, … }, … ]`; -- A module id or path to a file that exports `contributors` or `{ contributors }`. - -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). - ## Reporters Various reporters are available: diff --git a/index.js b/index.js index a99e272..33fb055 100644 --- a/index.js +++ b/index.js @@ -21,7 +21,7 @@ function hallmark (options, callback) { const ignore = concat('ignore', rc, options) deglob(files, { usePackageJson: false, cwd, ignore }, function (err, files) { - if (err) throw err + if (err) return callback(err) if (!files.length) { callback(null, { code: 0, files: [] }) @@ -45,11 +45,18 @@ function hallmark (options, callback) { const paddedTable = rc.paddedTable !== false const validateLinks = rc.validateLinks !== false const toc = rc.toc !== false - const contributors = 'contributors' in rc ? rc.contributors : rc.community const changelog = Object.assign({}, rc.changelog, options.changelog) const plugins = { plugins: concat('plugins', rc, options) } const fixers = { plugins: concat('fixers', rc, options) } + if ('contributors' in rc) { + return callback(new Error("The 'contributors' option has been removed")) + } + + if ('community' in rc) { + return callback(new Error("The 'community' option has been removed")) + } + engine({ processor, extensions: [ @@ -68,13 +75,6 @@ function hallmark (options, callback) { reporter, reporterOptions, plugins: [ - // Skip updating contributors table in lint mode - fix && contributors !== false && options.contributors !== false - ? [require('remark-git-contributors'), { - contributors: contributors || null - }] - : null, - [require('remark-common-changelog'), { cwd, fix, pkg, repository, ...changelog }], [require('remark-github'), { repository }], diff --git a/package.json b/package.json index 9beae27..7ceeb97 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "bin": "cli.js", "main": "index.js", "scripts": { - "test": "standard && depcheck --ignores level-community && node cli.js && tape test/*.js", + "test": "standard && depcheck && node cli.js && tape test/*.js", "hallmark": "node cli.js --fix", "check-licenses": "npm-consider install --test --production" }, @@ -27,7 +27,6 @@ "remark-autolink-references": "^1.0.0", "remark-collapse": "~0.1.2", "remark-common-changelog": "^0.0.1", - "remark-git-contributors": "^3.0.0", "remark-github": "^9.0.1", "remark-lint": "^7.0.1", "remark-lint-blockquote-indentation": "^2.0.1", @@ -59,7 +58,6 @@ "devDependencies": { "depcheck": "^1.2.0", "git-pull-or-clone": "^2.0.1", - "level-community": "^3.0.0", "npm-consider": "^1.7.0", "standard": "^15.0.0", "tape": "^5.0.1", @@ -88,9 +86,6 @@ "engines": { "node": ">=6" }, - "hallmark": { - "contributors": false - }, "config": { "allowedLicenseTypes": [ "publicDomain", diff --git a/test/dependents.js b/test/dependents.js index 806799e..db843b6 100644 --- a/test/dependents.js +++ b/test/dependents.js @@ -11,7 +11,7 @@ const dependents = [ // 'deltachat/deltachat-node', // Invalid 'Level/abstract-leveldown', 'Level/bench', - 'Level/codec', + 'Level/transcoder', 'Level/compose', 'Level/deferred-leveldown', 'Level/leveldown', @@ -45,10 +45,7 @@ for (const repo of dependents) { cp.fork(cli, { cwd, stdio }).on('exit', function (code) { t.is(code, 0, 'hallmark linter exited with code 0') - // Skip CONTRIBUTORS.md for now (many dependents need updating) - const args = ['--fix', '-i', 'CONTRIBUTORS.md'] - - cp.fork(cli, args, { cwd, stdio }).on('exit', function (code) { + cp.fork(cli, ['--fix'], { cwd, stdio }).on('exit', function (code) { t.is(code, 0, 'hallmark fixer exited with code 0') cp.execFile('git', ['diff', '--color'], { cwd }, function (err, stdout) {