summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
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>
2017-11-27tools: update to ESLint 4.12.0cjihrig
PR-URL: https://github.com/nodejs/node/pull/16948 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-11-28test: Enable specifying flaky tests on fipsNikhil Komawar
Adds a way to mark a specified test as 'flaky' on fips compliant systems. Earlier, the ``tools/test.py`` script supported only 'mode', 'system' and 'arch' for test environment specification. This limits the ability to specify the behavior of tests and setting pre-determined behavior of the same on other types of systems. As an example, the feature request below indicates the need to specify certain tests as 'flaky' on fips compliant systems. It hints at future possibility of a shared library, which in turn may need a specifier for running tests. This commit introduces a new item in the ``env`` dict, called ``type`` which defaults to ``simple`` type. It also adds an optional command line argument ``--type``, which inputs strings. Current functionality extends to setting ``simple`` or ``fips`` for this ``type`` variable. However, extending it to further uses is rather simple by adding "if" conditions at appropriate places in the ``tools/test.py`` script. PR-URL: https://github.com/nodejs/node/pull/16329 Fixes: https://github.com/nodejs/node/issues/14746 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-11-28tools: add lint fixer for `require-buffer`Bamieh
Adds `require-buffer` lint fixer. If the buffer module is not required while `Buffer` is used, require the `buffer` module. If the file has a `'use strict';` line, add the require after it on a separate line. If the file does not have any (currently impossible with the `strict` rule) add it after the first comment (before the real code starts). Fixes: https://github.com/nodejs/node/issues/16636 PR-URL: https://github.com/nodejs/node/pull/17144 Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-11-24tools: fix gitignore for tools/doc/Richard Littauer
PR-URL: https://github.com/nodejs/node/pull/17224 Fixes: https://github.com/nodejs/node/issues/17216 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-11-23Revert "src, tools: add debug symbols for node internals"Ben Noordhuis
This reverts commit 446c1ecfdaf99de38082d048626f301109da49c6. Reverted for breaking `make test-v8`. The "find all relevant system headers" logic in `tools/gen-postmortem-metadata.py` needs more work. Also reverts commit e46c3f743dc78ef0a614289a874e1c60c7e96490. ("tools: fix typo in gen-postmortem-metadata.py".) PR-URL: https://github.com/nodejs/node/pull/17272 Refs: https://github.com/nodejs/node/pull/14901 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Matheus Marchini <matheusdot@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-11-23tools: fix typo in gen-postmortem-metadata.pyDaniel Bevenius
PR-URL: https://github.com/nodejs/node/pull/17268 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-11-21src, tools: add debug symbols for node internalsMatheus Marchini
Before these changes, only V8 added debug symbols to Node's binary, limiting the possibilities for debugger's developers to add some features that rely on investigating Node's internal structures. These changes are a first steps towards empowering debug tools to navigate Node's internals strucutres. One example of what can be achieved with this is shown at nodejs/llnode#122 (a command which prints information about handles and requests on the queue for a core dump file). Node debug symbols are prefixed with node_dbg_. Ref: https://github.com/nodejs/llnode/pull/122 PR-URL: https://github.com/nodejs/node/pull/14901 Refs: https://github.com/nodejs/post-mortem/issues/46 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-11-21tools: make doc tool a bit more readableTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/17125 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-11-21tools: remove useless function declarationTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/17125 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-11-21tools: avoid using process.cwd in tools/lint-jsTobias Nießen
The first occurrence of path.join() can easily be replaced with path.resolve(). The second occurrence should be unnecessary as ESLint will resolve the path internally, and the old check probably did not work as intended anyway. PR-URL: https://github.com/nodejs/node/pull/17121 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-11-21tools: use built-in padStart instead of padStringTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/17120 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-11-20tools: allow running test.py without configuringGibson Fahnestock
If config.gypi isn't defined, assume Node was build the default way, i.e. with the inspector. PR-URL: https://github.com/nodejs/node/pull/16621 Refs: https://github.com/nodejs/node/pull/16436#issuecomment-340115175 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>