Skip to content

Commit 366af6d

Browse files
rvaggMayaLekova
authored andcommittedMay 8, 2018
Revert "build,tools: check freshness of doc addons"
This reverts commit 2cb9e2a. Reverted along with d9b59de as this introduces freshness checks that are too stringent without the comprehensive dependency checking of introduced in d9b59de so `make test` won't work with this. Ref: nodejs#17407 PR-URL: nodejs#18287 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 8e7a200 commit 366af6d

File tree

2 files changed

+10
-27
lines changed

2 files changed

+10
-27
lines changed
 

‎Makefile

+1-5
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ v8:
225225

226226
.PHONY: test
227227
# This does not run tests of third-party libraries inside deps.
228-
test: all check-doc-addons build-addons ## Runs default tests, linters, and builds docs.
228+
test: all build-addons ## Runs default tests, linters, and builds docs.
229229
$(MAKE) -s doc-only
230230
$(MAKE) -s lint
231231
$(MAKE) -s cctest
@@ -234,10 +234,6 @@ test: all check-doc-addons build-addons ## Runs default tests, linters, and buil
234234
$(CI_NATIVE_SUITES) \
235235
$(CI_DOC)
236236

237-
.PHONY: check-doc-addons
238-
check-doc-addons: $(NODE)
239-
$(NODE) tools/doc/addon-verify.js --check
240-
241237
.PHONY: test-only
242238
test-only: all build-addons ## For a quick test, does not run linter or build docs.
243239
$(MAKE) cctest

‎tools/doc/addon-verify.js

+9-22
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ const rootDir = path.resolve(__dirname, '..', '..');
1010
const doc = path.resolve(rootDir, 'doc', 'api', 'addons.md');
1111
const verifyDir = path.resolve(rootDir, 'test', 'addons');
1212

13-
const changed = [];
14-
const checkOnly = process.argv.includes('--check');
15-
1613
let id = 0;
1714
let currentHeader;
1815

@@ -79,6 +76,12 @@ for (const header in addons) {
7976
})
8077
});
8178

79+
try {
80+
fs.mkdirSync(dir);
81+
} catch (e) {
82+
strictEqual(e.code, 'EEXIST');
83+
}
84+
8285
for (const file of files) {
8386
let content;
8487
try {
@@ -88,29 +91,13 @@ for (const header in addons) {
8891
}
8992

9093
// Only update when file content has changed to prevent unneeded rebuilds.
91-
if (content === file.content) continue;
92-
changed.push(file);
93-
94-
if (checkOnly) continue;
95-
96-
try {
97-
fs.mkdirSync(dir);
98-
} catch (e) {
99-
strictEqual(e.code, 'EEXIST');
94+
if (content !== file.content) {
95+
fs.writeFileSync(file.path, file.content);
96+
console.log('wrote', file.path);
10097
}
101-
102-
fs.writeFileSync(file.path, file.content);
103-
console.log('wrote', file.path);
10498
}
10599
}
106100

107-
if (checkOnly && changed.length > 0) {
108-
console.error('The following files are out of date:');
109-
for (const { path } of changed) console.error(' ', path);
110-
console.error('Run `node tools/doc/addon-verify.js` to update.');
111-
process.exit(1);
112-
}
113-
114101
function boilerplate(name, content) {
115102
return `'use strict';
116103
const common = require('../../common');

0 commit comments

Comments
 (0)
Please sign in to comment.