summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2018-02-23doc: add new documentation lint ruleestrada9166
Add 80 characters limit to docs. Change docs to fit 80 characters per row. PR-URL: https://github.com/nodejs/node/pull/18726 Fixes: https://github.com/nodejs/node/issues/18703 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2018-02-22build, win: vcbuild improvementsBartosz Sosnowski
Removes extra erroor messages when Python is not installed. Removes "vswhere not found" message when no VS2017 installation is found. Adds support for DEBUG_HELPER to vcbuild.bat. Fixes: https://github.com/nodejs/node/issues/16864 PR-URL: https://github.com/nodejs/node/pull/17015 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2018-02-22tools: fix custom eslint rule errorsRuben Bridgewater
This fixes a few rules by making sure the input is actually ready to be checked. Otherwise those can throw TypeErrors or result in faulty error messages. PR-URL: https://github.com/nodejs/node/pull/18853 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-02-21doc: fix nits in tools/doc/README.mdVse Mozhet Byt
* Sync format schemes with the current doc state. * Lowercase primitive types. * Fix typos and unify the style. * Remove tautological info. PR-URL: https://github.com/nodejs/node/pull/18874 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2018-02-20lint: move eslint to new plugin systemGus Caplan
PR-URL: https://github.com/nodejs/node/pull/18566 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
2018-02-17tools: custom eslint autofix for inspector-check.jsShobhit Chittora
1. Adds fixer method 2. Extends test PR-URL: https://github.com/nodejs/node/pull/16646 Refs: https://github.com/nodejs/node/issues/16636 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-02-17tools: auto fix custom crypto-check eslint ruleShobhit Chittora
1. Fixer for crypto-check.js 2. Extends tests PR-URL: https://github.com/nodejs/node/pull/16647 Refs: https://github.com/nodejs/node/issues/16636 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-12tools: fix eslint isRequiredRuben Bridgewater
Currently the call can lead to a TypeError with the message: `Cannot read property 'value' of undefined`. This fixes it by first checking that the first argument is truthy. PR-URL: https://github.com/nodejs/node/pull/18729 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-02-09src: add "icu::" prefix before ICU symbolsSteven R. Loomis
In ICU 61.x, icu4c will no longer put its declarations in the global namespace. Everything will be in the "icu::" namespace (or icu_60:: in the linker). Prepare for this. https://ssl.icu-project.org/trac/ticket/13460
2018-02-07tools: add fixer for prefer-assert-iferror.jsShobhit Chittora
PR-URL: https://github.com/nodejs/node/pull/16648 Refs: https://github.com/nodejs/node/issues/16636 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-07tools: add FileHandle to doc/type-parser.jsVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/18601 Refs: https://github.com/nodejs/node/pull/18407 Refs: https://github.com/nodejs/node/pull/18444 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-02-04tools: non-Ascii linter for /lib onlySarat Addepalli
Non-ASCII characters in /lib get compiled into the node binary, and may bloat the binary size unnecessarily. A linter rule may help prevent this. PR-URL: https://github.com/nodejs/node/pull/18043 Fixes: https://github.com/nodejs/node/issues/11209 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
2018-02-01tools: auto fix custom eslint ruleShobhit Chittora
1. Extends tests 2. Refactors code 3. Adds fixer Refs: #16636 PR-URL: https://github.com/nodejs/node/pull/16652 Refs: https://github.com/nodejs/node/issues/16636 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-02-01doc: linkify missing typesVse Mozhet Byt
Also, alphabetize all types in type-parser.js and fix some nits in type formats. PR-URL: https://github.com/nodejs/node/pull/18444 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-29tools: fix icu readme lint errorAnatoli Papirovski
PR-URL: https://github.com/nodejs/node/pull/18445 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-01-29doc: Update tools/icu/README.mdSteven R. Loomis
- remove TODOs: the one about defaults has been addressed, and the one about testing is a work item that doesn't belong in a doc. - add some background information Fixes: https://github.com/nodejs/node/issues/7843 PR-URL: https://github.com/nodejs/node/pull/16939 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-01-28doc: unify type linkificationVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/18407 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-01-25Revert "tools: teach gyp to write an 'all deps' rule"Rod Vagg
This reverts commit 920c13203df434278eb7c34a485e89734a5fa62a. Reverted along with d9b59def7 as this breaks compilation from downloadable source tarballs. Ref: https://github.com/nodejs/node/pull/17407 PR-URL: https://github.com/nodejs/node/pull/18287 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-01-25Revert "tools: simplify tools/doc/addon-verify.js"Rod Vagg
This reverts commit c6682636be4955e2181c00e7d4868fbf6682a5c5. Reverted along with d9b59def7 as this breaks compilation from downloadable source tarballs. Ref: https://github.com/nodejs/node/pull/17407 PR-URL: https://github.com/nodejs/node/pull/18287 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-01-25Revert "build,test: make building addon tests less fragile"Rod Vagg
This reverts commit d9b59def72c718aaad3eefb6bf43f409ccefe4d2. Breaks downloadable source tarball builds as we remove some files prior to creating a tarball but those files are included in the comprehensive list of dependencies listed in .deps. Ref: https://github.com/nodejs/node/pull/17407 PR-URL: https://github.com/nodejs/node/pull/18287 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-01-25Revert "build,tools: check freshness of doc addons"Rod Vagg
This reverts commit 2cb9e2a6f7c570fe317d560de840046595c3f2ec. Reverted along with d9b59def7 as this introduces freshness checks that are too stringent without the comprehensive dependency checking of introduced in d9b59def7 so `make test` won't work with this. Ref: https://github.com/nodejs/node/pull/17407 PR-URL: https://github.com/nodejs/node/pull/18287 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-01-21build,tools: check freshness of doc addonsBen Noordhuis
Add a `--check` flag to `tools/doc/addon-verify.js` and use that in the `make test` target to determine if the generated files in `test/addons` are fresh or stale. PR-URL: https://github.com/nodejs/node/pull/17407 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-01-21build,test: make building addon tests less fragileBen Noordhuis
* Get rid of recursive `make` when building the node binary. An earlier commit makes GYP write out rules that we can use for proper dependency tracking. * Use module name 'binding' in addons.md and addons-napi/*/binding.gyp. This massively simplifies the logic for generating the build rules. * Check in auto-generated add-on tests from `doc/api/addons.md`. The files change rarely and generating them dynamically causes no end of race conditions and special-casing during the build. PR-URL: https://github.com/nodejs/node/pull/17407 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-01-21tools: simplify tools/doc/addon-verify.jsBen Noordhuis
Make the script synchronous and clean it up. This is preparatory work for follow-ups commits. PR-URL: https://github.com/nodejs/node/pull/17407 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-01-21tools: teach gyp to write an 'all deps' ruleBen Noordhuis
Make GYP write a .deps file in the top-level directory that we can use in the Makefile to get a proper dependency chain for the `node` target. Preparatory work for getting rid of recursive make invocations. PR-URL: https://github.com/nodejs/node/pull/17407 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-01-11tools: add babel-eslintMichaël Zasso
Create tools/update-babel-eslint.sh script and execute it to do the first installation of the package. Update tools/license-builder.sh and execute it to add babel-eslint's license to our LICENSE file. PR-URL: https://github.com/nodejs/node/pull/17820 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-01-11tools: update ESLint to 4.15.0Michaël Zasso
PR-URL: https://github.com/nodejs/node/pull/17820 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-01-11tools: move eslint from tools to tools/node_modulesMichaël Zasso
This is required because we need to add the babel-eslint dependency and it has to be able to resolve "eslint". babel-eslint is required to support future ES features such as async iterators and import.meta. Refs: https://github.com/nodejs/node/pull/17755 PR-URL: https://github.com/nodejs/node/pull/17820 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-01-05tools: host remark-preset-lint-node in-treeJon Moss
Moved from https://github.com/watilde/remark-preset-lint-node. PR-URL: https://github.com/nodejs/node/pull/17441 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-12-29tools: add check for using process.binding cryptoDaniel Bevenius
Currently, when configuring --without-ssl any tests that use process.binding('crypto') will not report a lint warning. This is because the eslint check only generates a warning when using require. This commit adds a check for using binding in addition to require. PR-URL: https://github.com/nodejs/node/pull/17867 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-12-27tools: fix AttributeError: __exit__ on Python 2.6Dmitriy Kasyanov
Error occurs while dealing with Tar archives PR-URL: https://github.com/nodejs/node/pull/17663 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-12-26tools: autofixer for lowercase-name-for-primitiveShobhit Chittora
PR-URL: https://github.com/nodejs/node/pull/17715 Refs: https://github.com/nodejs/node/issues/16636 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Weijia Wang <starkwang@126.com>
2017-12-22tools: fix man pages linking regexDiego Rodríguez Baquero
The change to word boundary was breaking many doc pages. This reverts the word boundary back to space. PR-URL: https://github.com/nodejs/node/pull/17724 Fixes: https://github.com/nodejs/node/issues/17694 Refs: https://github.com/nodejs/node/pull/17479 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-12-19tools: add number-isnan ruleJon Moss
PR-URL: https://github.com/nodejs/node/pull/17556 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-12-15tools: simplify lowercase-name-for-primitive rulecjihrig
PR-URL: https://github.com/nodejs/node/pull/17653 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-12-13tools: add lowercase-name-for-primitive eslint ruleWeijia Wang
Primitives should use lowercase in error message. Refs: https://github.com/nodejs/node/pull/16401 PR-URL: https://github.com/nodejs/node/pull/17568 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-12-12doc,test: mention Duplex support for TLSAnna Henningsen
Document and test the existing support for generic Duplex streams in the TLS module. PR-URL: https://github.com/nodejs/node/pull/17599 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-11tools,test: throw if common.PORT used in parallel testsRich Trott
common.PORT should not be used in parallelized tests. (There can be a port collision if another tests requests an arbitrary open port from the operating system and ends up getting common.PORT before a test that uses common.PORT uses the port.) In such a situation, throw an error. PR-URL: https://github.com/nodejs/node/pull/17559 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-12-11tools: simplify no-let-in-for-declaration rulecjihrig
PR-URL: https://github.com/nodejs/node/pull/17572 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-12-11tools: simplify buffer-constructor rulecjihrig
PR-URL: https://github.com/nodejs/node/pull/17572 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-12-11tools: simplify prefer-assert-methods rulecjihrig
PR-URL: https://github.com/nodejs/node/pull/17572 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-12-11tools: simplify prefer-common-mustnotcall rulecjihrig
PR-URL: https://github.com/nodejs/node/pull/17572 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-12-11tools: prefer common.expectsError in testsAnatoli Papirovski
Add lint rule to validate that common.expectsError(fn, err) is being used instead of assert.throws(fn, common.expectsError(err)); PR-URL: https://github.com/nodejs/node/pull/17557 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-12-09tools: replace space with \b in regexDiego Rodríguez Baquero
PR-URL: https://github.com/nodejs/node/pull/17479 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-12-08tools: lint for additional strings in docsRich Trott
Check for uses of `Github` (rather than `GitHub`) and `Node.JS` (rather than `Node.js`) in markdown files. PR-URL: https://github.com/nodejs/node/pull/17492 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-01tools: update markdown lint presetsRich Trott
Update remark-preset-lint-node to version at commit hash 859eab541e0f63839b33196f26e2bed4dfe2b194. This is the most recent version at this time (although not yet published to npm). It includes linting for "v8" where "V8" is intended and "Javascript" Where "JavaScript" is intended. By installing those lint rules now rather than waiting for a published version, we avoid the possibility that new markdown text with those prohibited strings will be introduced. PR-URL: https://github.com/nodejs/node/pull/17382 Reviewed-By: Jon Moss <me@jonathanmoss.me>
2017-12-01tools: add cpplint rule for NULL usageDaniel Bevenius
This commit is a suggestion for adding a rule for NULL usages in the code base. This will currently report a number of errors which could be ignored using // NOLINT (readability/null_usage) PR-URL: https://github.com/nodejs/node/pull/17373 Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-11-30tools: add docs for prefer-util-format-errors ruleJon Moss
I had a little trouble understanding what the rule was trying to say, so am documenting what would pass/fail. PR-URL: https://github.com/nodejs/node/pull/17376 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-11-30tools: add Boxstarter scriptBartosz Sosnowski
Adds a Boxstarter script for easy Node.js building prerequisites installation PR-URL: https://github.com/nodejs/node/pull/17046 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-11-29tools,test: use Execute instead of check_outputRefael Ackermann
subprocess.check_output is a python2.7 only feature. Using Execute allows keeping python2.6 compatibility PR-URL: https://github.com/nodejs/node/pull/17381 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>