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

Introduce 'make doclint' command and tooling #8551

Closed
wants to merge 1 commit into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ test/fixtures
test/disabled
test/tmp*/
tools/eslint
tools/remark-cli
node_modules
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ test: all
$(MAKE) cctest
$(PYTHON) tools/test.py --mode=release -J \
addons doctool inspector known_issues message pseudo-tty parallel sequential
$(MAKE) doclint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename to mdlint? I assume we want to lint every md, including non-doc files.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is, there is a project named mdlint, and that's not the one we are using.

Copy link
Contributor

@silverwind silverwind Nov 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see that as an issue. There is a project called jslint and we happily use that name for js lint task 😉.

$(MAKE) lint

test-parallel: all
Expand Down Expand Up @@ -699,6 +700,9 @@ jslint-ci:
$(NODE) tools/jslint.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
benchmark lib test tools

doclint:
$(NODE) tools/remark-cli/cli.js -qf *.md doc src lib benchmark tools/doc/*.md tools/icu/*.md

CPPLINT_EXCLUDE ?=
CPPLINT_EXCLUDE += src/node_root_certs.h
CPPLINT_EXCLUDE += src/queue.h
Expand Down
34 changes: 34 additions & 0 deletions tools/remark-cli/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env node
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:cli
* @fileoverview CLI to process markdown.
*/

'use strict';

/* Dependencies. */
var start = require('unified-args');
var extensions = require('markdown-extensions');
var processor = require('remark');
var proc = require('remark/package.json');
var cli = require('./package.json');

/* Start. */
start({
processor: processor,
name: proc.name,
description: cli.description,
version: [
proc.name + ': ' + proc.version,
cli.name + ': ' + cli.version
].join(', '),
pluginPrefix: proc.name,
presetPrefix: proc.name + '-preset',
packageField: proc.name + 'Config',
rcName: '.' + proc.name + 'rc',
ignoreName: '.' + proc.name + 'ignore',
extensions: extensions
});
4 changes: 4 additions & 0 deletions tools/remark-cli/node_modules/ansi-regex/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions tools/remark-cli/node_modules/ansi-regex/license

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

122 changes: 122 additions & 0 deletions tools/remark-cli/node_modules/ansi-regex/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions tools/remark-cli/node_modules/ansi-regex/readme.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions tools/remark-cli/node_modules/ansi-styles/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions tools/remark-cli/node_modules/ansi-styles/license

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading