Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: third_party/WebKit/Source/devtools/scripts/format.js

Issue 2717833002: DevTools: use git cl format --js for PRESUBMIT check (Closed)
Patch Set: fix Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/scripts/clang_format/index.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var childProcess = require('child_process');
6 var fs = require('fs');
7 var path = require('path');
8
9 var args = process.argv.slice(2);
10
11 var CLANG_FORMAT_PATH = path.resolve(__dirname, 'clang_format', 'index.js');
12 var IGNORE_FILE_PATH = path.resolve(__dirname, '..', '.eslintignore');
13
14 var ignoreFile = fs.readFileSync(IGNORE_FILE_PATH, 'utf-8');
15 var ignores = ignoreFile.split('\n').filter(str => str.length);
16 var ignoreArg = '--ignore=' + ignores.join(',');
17
18 console.log('Running clang-format');
19 var clangArgs = ['-i', ignoreArg];
20 if (args.length)
21 clangArgs = clangArgs.concat(args);
22 else
23 clangArgs.push('--glob=+(scripts|front_end)/**/*.js');
24
25
26 var options = {cwd: path.resolve(__dirname, '..')};
27
28 childProcess.fork(CLANG_FORMAT_PATH, clangArgs, options);
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/scripts/clang_format/index.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698