chore: move to clang-format 1.0.17.
clang-format 1.0.17 substantially improves formatting for fat arrow functions and array literal detection. It also fixes a number of minor formatting issues.
This commit is contained in:
@ -50,26 +50,24 @@ class DiffingTSCompiler implements DiffingBroccoliPlugin {
|
||||
let pathsToEmit = [];
|
||||
let pathsWithErrors = [];
|
||||
|
||||
treeDiff.changedPaths
|
||||
.forEach((tsFilePath) => {
|
||||
if (!this.fileRegistry[tsFilePath]) {
|
||||
this.fileRegistry[tsFilePath] = {version: 0};
|
||||
this.rootFilePaths.push(tsFilePath);
|
||||
} else {
|
||||
this.fileRegistry[tsFilePath].version++;
|
||||
}
|
||||
treeDiff.changedPaths.forEach((tsFilePath) => {
|
||||
if (!this.fileRegistry[tsFilePath]) {
|
||||
this.fileRegistry[tsFilePath] = {version: 0};
|
||||
this.rootFilePaths.push(tsFilePath);
|
||||
} else {
|
||||
this.fileRegistry[tsFilePath].version++;
|
||||
}
|
||||
|
||||
pathsToEmit.push(tsFilePath);
|
||||
});
|
||||
pathsToEmit.push(tsFilePath);
|
||||
});
|
||||
|
||||
treeDiff.removedPaths
|
||||
.forEach((tsFilePath) => {
|
||||
console.log('removing outputs for', tsFilePath);
|
||||
treeDiff.removedPaths.forEach((tsFilePath) => {
|
||||
console.log('removing outputs for', tsFilePath);
|
||||
|
||||
this.rootFilePaths.splice(this.rootFilePaths.indexOf(tsFilePath), 1);
|
||||
this.fileRegistry[tsFilePath] = null;
|
||||
this.removeOutputFor(tsFilePath);
|
||||
});
|
||||
this.rootFilePaths.splice(this.rootFilePaths.indexOf(tsFilePath), 1);
|
||||
this.fileRegistry[tsFilePath] = null;
|
||||
this.removeOutputFor(tsFilePath);
|
||||
});
|
||||
|
||||
if (this.firstRun) {
|
||||
this.firstRun = false;
|
||||
@ -136,9 +134,10 @@ class DiffingTSCompiler implements DiffingBroccoliPlugin {
|
||||
let errorMessages = [];
|
||||
|
||||
allDiagnostics.forEach(diagnostic => {
|
||||
var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
|
||||
var {line, character} = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
|
||||
var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
|
||||
errorMessages.push(` ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
|
||||
errorMessages.push(
|
||||
` ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
|
||||
});
|
||||
|
||||
if (errorMessages.length) {
|
||||
|
@ -34,7 +34,7 @@ export interface DiffingBroccoliPlugin {
|
||||
|
||||
|
||||
type DiffingPluginWrapperFactory = (inputTrees: (BroccoliTree | BroccoliTree[]), options?) =>
|
||||
BroccoliTree;
|
||||
BroccoliTree;
|
||||
|
||||
|
||||
class DiffingPluginWrapper implements BroccoliTree {
|
||||
|
@ -110,8 +110,7 @@ describe('TreeDiffer', () => {
|
||||
'file-1.txt': mockfs.file({content: 'file-1.txt content', mtime: new Date(1000)}),
|
||||
'file-2.txt': mockfs.file({content: 'file-2.txt content', mtime: new Date(1000)}),
|
||||
'subdir-1': {
|
||||
'file-1.1.txt':
|
||||
mockfs.file({content: 'file-1.1.txt content', mtime: new Date(1000)})
|
||||
'file-1.1.txt': mockfs.file({content: 'file-1.1.txt content', mtime: new Date(1000)})
|
||||
}
|
||||
},
|
||||
'symlinks': {
|
||||
|
@ -129,7 +129,7 @@ class DirtyCheckingDiffResult {
|
||||
public startTime: number = Date.now();
|
||||
public endTime: number = null;
|
||||
|
||||
constructor(public label:string, public directoryName: string) {}
|
||||
constructor(public label: string, public directoryName: string) {}
|
||||
|
||||
toString() {
|
||||
return `${pad(this.label, 30)}, ${pad(this.endTime - this.startTime, 5)}ms, ` +
|
||||
|
@ -84,11 +84,13 @@ module.exports = function makeNodeTree(destinationPath) {
|
||||
// TODO: remove this when we no longer use traceur
|
||||
var traceurCompatibleTsModulesTree = replace(modulesTree, {
|
||||
files: ['**/*.ts'],
|
||||
patterns: [{
|
||||
// Empty replacement needed so that replaceWithPath gets triggered...
|
||||
match: /$/g,
|
||||
replacement: ""
|
||||
}],
|
||||
patterns: [
|
||||
{
|
||||
// Empty replacement needed so that replaceWithPath gets triggered...
|
||||
match: /$/g,
|
||||
replacement: ""
|
||||
}
|
||||
],
|
||||
replaceWithPath: function(path, content) {
|
||||
if (!path.endsWith('.d.ts')) {
|
||||
content += '\r\nexport var __esModule = true;\n';
|
||||
@ -120,11 +122,13 @@ module.exports = function makeNodeTree(destinationPath) {
|
||||
return "var parse5Adapter = require('angular2/src/dom/parse5_adapter'); " +
|
||||
"parse5Adapter.Parse5DomAdapter.makeCurrent();" + content;
|
||||
},
|
||||
patterns: [{
|
||||
// Append main() to all tests since all of our tests are wrapped in exported main fn
|
||||
match: /$/g,
|
||||
replacement: "\r\n main();"
|
||||
}]
|
||||
patterns: [
|
||||
{
|
||||
// Append main() to all tests since all of our tests are wrapped in exported main fn
|
||||
match: /$/g,
|
||||
replacement: "\r\n main();"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
return destCopy(nodeTree, destinationPath);
|
||||
|
Reference in New Issue
Block a user