-
Notifications
You must be signed in to change notification settings - Fork 3.8k
chore(build): Only suppress expected warnings from closure-make-deps #6350
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ gulp.sourcemaps = require('gulp-sourcemaps'); | |
|
|
||
| var path = require('path'); | ||
| var fs = require('fs'); | ||
| var execSync = require('child_process').execSync; | ||
| const {exec, execSync} = require('child_process'); | ||
| var through2 = require('through2'); | ||
|
|
||
| const clangFormat = require('clang-format'); | ||
|
|
@@ -336,18 +336,47 @@ function buildDeps(done) { | |
| 'tests/mocha' | ||
| ]; | ||
|
|
||
| const args = roots.map(root => `--root '${root}' `).join(''); | ||
| execSync( | ||
| `closure-make-deps ${args} 2>/dev/null >'${DEPS_FILE}'`, | ||
| {stdio: 'inherit'}); | ||
| function filterErrors(text) { | ||
| return text.split('\n') | ||
| .filter( | ||
| (line) => !/^WARNING /.test(line) || | ||
| !(/Missing type declaration./.test(line) || | ||
| /illegal use of unknown JSDoc tag/.test(line))) | ||
| .join('\n'); | ||
| } | ||
|
|
||
| // Use grep to filter out the entries that are already in deps.js. | ||
| const testArgs = testRoots.map(root => `--root '${root}' `).join(''); | ||
| execSync( | ||
| `closure-make-deps ${testArgs} 2>/dev/null \ | ||
| | grep 'tests/mocha' > '${TEST_DEPS_FILE}'`, | ||
| {stdio: 'inherit'}); | ||
| done(); | ||
| new Promise((resolve, reject) => { | ||
| const args = roots.map(root => `--root '${root}' `).join(''); | ||
| exec( | ||
| `closure-make-deps ${args} >'${DEPS_FILE}'`, | ||
| {stdio: ['inherit', 'inherit', 'pipe']}, | ||
| (error, stdout, stderr) => { | ||
| console.warn(filterErrors(stderr)); | ||
| if (error) { | ||
| reject(error); | ||
| } else { | ||
| resolve(); | ||
| } | ||
| }); | ||
| }).then(() => new Promise((resolve, reject) => { | ||
| // Use grep to filter out the entries that are already in deps.js. | ||
| const testArgs = | ||
| testRoots.map(root => `--root '${root}' `).join(''); | ||
| exec( | ||
| `closure-make-deps ${testArgs} 2>/dev/null\ | ||
| | grep 'tests/mocha' > '${TEST_DEPS_FILE}'`, | ||
| {stdio: ['inherit', 'inherit', 'pipe']}, | ||
| (error, stdout, stderr) => { | ||
| console.warn(filterErrors(stderr)); | ||
| if (error) { | ||
| reject(error); | ||
| } else { | ||
| resolve(); | ||
| } | ||
| }); | ||
| })).then(() => { | ||
| done(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this fixing the
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not as far as I know! The switch to |
||
| }); | ||
| } | ||
|
|
||
| /** | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we'll be dealing with this long enough that it would be useful to separate these out into an array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I sincerely hope not. But when I find myself a fourth regexp to this conditional then it will be time to reevaluate…