Skip to content

Commit

Permalink
tools: use lint-md.js
Browse files Browse the repository at this point in the history
* remove unused `tools/remark-cli`
* vcbuild tested with `vcbuild nobuild noprojgen lint-md-build lint-md`

PR-URL: #20109
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
refack authored and targos committed Sep 11, 2018
1 parent 22fefae commit d03ce9d
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 1,471 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ test/message/esm_display_syntax_error.mjs
tools/icu
tools/lint-md.js
tools/node-lint-md-cli-rollup/dist
tools/remark-*
benchmark/tmp
doc/**/*.js
!.eslintrc.js
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
!.gitkeep
!.mailmap
!.nycrc
!.remarkrc
!.travis.yml

core
Expand Down Expand Up @@ -114,8 +113,6 @@ tools/doc/node_modules
tools/clang-format/node_modules

# test artifacts
tools/remark-cli/node_modules
tools/remark-preset-lint-node/node_modules
icu_config.gypi
*.tap

Expand Down
5 changes: 0 additions & 5 deletions .remarkrc

This file was deleted.

26 changes: 0 additions & 26 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -1277,32 +1277,6 @@ The externally maintained libraries used by Node.js are:
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

- remark-cli, located at tools/remark-cli, is licensed as follows:
"""
(The MIT License)

Copyright (c) 2014-2016 Titus Wormer <tituswormer@gmail.com>
Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""

- node-inspect, located at deps/node-inspect, is licensed as follows:
"""
Copyright Node.js contributors. All rights reserved.
Expand Down
64 changes: 18 additions & 46 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,13 @@ apidocs_json = $(addprefix out/,$(apidoc_sources:.md=.json))

apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))

tools/doc/node_modules: tools/doc/package.json
ifeq ($(node_use_openssl),true)
cd tools/doc && $(call available-node,$(run-npm-ci))
else
@echo "Skipping tools/doc/node_modules (no crypto)"
endif

.PHONY: doc-only
doc-only: tools/doc/node_modules \
$(apidoc_dirs) $(apiassets) ## Builds the docs with the local or the global Node.js binary.
Expand Down Expand Up @@ -932,8 +939,6 @@ $(TARBALL): release-only $(NODE_EXE) doc
$(RM) -r $(TARNAME)/tools/osx-*
$(RM) -r $(TARNAME)/tools/osx-pkg.pmdoc
$(RM) -r $(TARNAME)/tools/pkgsrc
$(RM) -r $(TARNAME)/tools/remark-cli
$(RM) -r $(TARNAME)/tools/remark-preset-lint-node
find $(TARNAME)/ -name ".eslint*" -maxdepth 2 | xargs $(RM)
find $(TARNAME)/ -type l | xargs $(RM) # annoying on windows
tar -cf $(TARNAME).tar $(TARNAME)
Expand Down Expand Up @@ -1061,74 +1066,41 @@ lint-md-rollup:
cd tools/node-lint-md-cli-rollup && npm up
cd tools/node-lint-md-cli-rollup && npm run build-node



.PHONY: lint-md-clean
lint-md-clean:
$(RM) -r tools/remark-cli/node_modules
$(RM) -r tools/node-lint-md-cli-rollup/remark-preset-lint-node/node_modules
$(RM) -r tools/node-lint-md-cli-rollup/node_modules
$(RM) tools/.*mdlintstamp

tools/remark-cli/node_modules: tools/remark-cli/package.json
@echo "Markdown linter: installing remark-cli into tools/"
@cd tools/remark-cli && $(call available-node,$(run-npm-ci))

tools/node-lint-md-cli-rollup/remark-preset-lint-node/node_modules: \
tools/node-lint-md-cli-rollup/remark-preset-lint-node/package.json
@echo "Markdown linter: installing remark-preset-lint-node"
@cd tools/node-lint-md-cli-rollup/remark-preset-lint-node && $(call available-node,$(run-npm-ci))

.PHONY: lint-md-build
lint-md-build: tools/remark-cli/node_modules \
tools/doc/node_modules \
tools/node-lint-md-cli-rollup/remark-preset-lint-node/node_modules

tools/doc/node_modules: tools/doc/package.json
ifeq ($(node_use_openssl),true)
cd tools/doc && $(call available-node,$(run-npm-ci))
else
@echo "Skipping tools/doc/node_modules (no crypto)"
endif

.PHONY: lint-md
ifneq ("","$(wildcard tools/remark-cli/node_modules/)")
lint-md-build:
$(warning "Deprecated no-op target 'lint-md-build'")

LINT_MD_DOC_FILES = $(shell ls doc/*.md doc/**/*.md)
run-lint-doc-md = tools/remark-cli/cli.js -q -f $(LINT_MD_DOC_FILES)
run-lint-doc-md = tools/lint-md.js -q -f $(LINT_MD_DOC_FILES)
# Lint all changed markdown files under doc/
tools/.docmdlintstamp: $(LINT_MD_DOC_FILES)
ifeq ($(node_use_openssl),true)
@echo "Running Markdown linter on docs..."
@$(call available-node,$(run-lint-doc-md))
@touch $@
else
@echo "Skipping Markdown linter on docs (no crypto)"
endif
$(call available-node,$(run-lint-doc-md))
touch $@

LINT_MD_TARGETS = src lib benchmark test tools/doc tools/icu
LINT_MD_ROOT_DOCS := $(wildcard *.md)
LINT_MD_MISC_FILES := $(shell find $(LINT_MD_TARGETS) -type f \
-not -path '*node_modules*' -name '*.md') $(LINT_MD_ROOT_DOCS)
run-lint-misc-md = tools/remark-cli/cli.js -q -f $(LINT_MD_MISC_FILES)
run-lint-misc-md = tools/lint-md.js -q -f $(LINT_MD_MISC_FILES)
# Lint other changed markdown files maintained by us
tools/.miscmdlintstamp: $(LINT_MD_MISC_FILES)
ifeq ($(node_use_openssl),true)
@echo "Running Markdown linter on misc docs..."
@$(call available-node,$(run-lint-misc-md))
@touch $@
else
@echo "Skipping Markdown linter on misc docs (no crypto)"
endif
$(call available-node,$(run-lint-misc-md))
touch $@

tools/.mdlintstamp: tools/.miscmdlintstamp tools/.docmdlintstamp

.PHONY: lint-md
# Lints the markdown documents maintained by us in the codebase.
lint-md: | tools/.mdlintstamp
else
lint-md:
@echo "The markdown linter is not installed."
@echo "To install (requires internet access) run: $ make lint-md-build"
endif


LINT_JS_TARGETS = .eslintrc.js benchmark doc lib test tools

Expand Down
3 changes: 0 additions & 3 deletions tools/license-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ addlicense "gtest" "deps/gtest" "$(cat ${rootdir}/deps/gtest/LICENSE)"
# nghttp2
addlicense "nghttp2" "deps/nghttp2" "$(cat ${rootdir}/deps/nghttp2/COPYING)"

# remark
addlicense "remark-cli" "tools/remark-cli" "$(cat ${rootdir}/tools/remark-cli/LICENSE)"

# node-inspect
addlicense "node-inspect" "deps/node-inspect" "$(cat ${rootdir}/deps/node-inspect/LICENSE)"

Expand Down
22 changes: 0 additions & 22 deletions tools/remark-cli/LICENSE

This file was deleted.

34 changes: 0 additions & 34 deletions tools/remark-cli/cli.js

This file was deleted.

Loading

0 comments on commit d03ce9d

Please sign in to comment.