Skip to content

Commit 11da69f

Browse files
committed
Also rename some local variables
1 parent 29ce1b7 commit 11da69f

2 files changed

Lines changed: 23 additions & 23 deletions

File tree

apps/api-extractor/src/api/Extractor.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -209,40 +209,40 @@ export class Extractor {
209209

210210
if (extractorConfig.apiReportEnabled) {
211211
const actualApiReportPath: string = extractorConfig.reportTempFilePath;
212-
const actualApiReviewShortPath: string = extractorConfig._getShortFilePath(extractorConfig.reportTempFilePath);
212+
const actualApiReportShortPath: string = extractorConfig._getShortFilePath(extractorConfig.reportTempFilePath);
213213

214-
const expectedApiReviewPath: string = extractorConfig.reportFilePath;
215-
const expectedApiReviewShortPath: string = extractorConfig._getShortFilePath(extractorConfig.reportFilePath);
214+
const expectedApiReportPath: string = extractorConfig.reportFilePath;
215+
const expectedApiReportShortPath: string = extractorConfig._getShortFilePath(extractorConfig.reportFilePath);
216216

217-
const actualApiReviewContent: string = ReviewFileGenerator.generateReviewFileContent(collector);
217+
const actualApiReportContent: string = ReviewFileGenerator.generateReviewFileContent(collector);
218218

219219
// Write the actual file
220-
FileSystem.writeFile(actualApiReportPath, actualApiReviewContent, {
220+
FileSystem.writeFile(actualApiReportPath, actualApiReportContent, {
221221
ensureFolderExists: true,
222222
convertLineEndings: NewlineKind.CrLf
223223
});
224224

225225
// Compare it against the expected file
226-
if (FileSystem.exists(expectedApiReviewPath)) {
227-
const expectedApiReviewContent: string = FileSystem.readFile(expectedApiReviewPath);
226+
if (FileSystem.exists(expectedApiReportPath)) {
227+
const expectedApiReportContent: string = FileSystem.readFile(expectedApiReportPath);
228228

229-
if (!ReviewFileGenerator.areEquivalentApiFileContents(actualApiReviewContent, expectedApiReviewContent)) {
229+
if (!ReviewFileGenerator.areEquivalentApiFileContents(actualApiReportContent, expectedApiReportContent)) {
230230
if (!localBuild) {
231231
// For production, issue a warning that will break the CI build.
232232
messageRouter.logWarning(ConsoleMessageId.ApiReportNotCopied,
233233
'You have changed the public API signature for this project.'
234234
// @microsoft/gulp-core-build seems to run JSON.stringify() on the error messages for some reason,
235235
// so try to avoid escaped characters:
236-
+ ` Please overwrite ${expectedApiReviewShortPath} with a`
237-
+ ` copy of ${actualApiReviewShortPath}`
236+
+ ` Please overwrite ${expectedApiReportShortPath} with a`
237+
+ ` copy of ${actualApiReportShortPath}`
238238
+ ' and then request an API review. See the Git repository README.md for more info.');
239239
} else {
240240
// For a local build, just copy the file automatically.
241241
messageRouter.logWarning(ConsoleMessageId.ApiReportCopied,
242242
'You have changed the public API signature for this project.'
243-
+ ` Updating ${expectedApiReviewShortPath}`);
243+
+ ` Updating ${expectedApiReportShortPath}`);
244244

245-
FileSystem.writeFile(expectedApiReviewPath, actualApiReviewContent, {
245+
FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {
246246
ensureFolderExists: true,
247247
convertLineEndings: NewlineKind.CrLf
248248
});
@@ -251,15 +251,15 @@ export class Extractor {
251251
apiReportChanged = true;
252252
} else {
253253
messageRouter.logVerbose(ConsoleMessageId.ApiReportUnchanged,
254-
`The API signature is up to date: ${actualApiReviewShortPath}`);
254+
`The API signature is up to date: ${actualApiReportShortPath}`);
255255
}
256256
} else {
257257
// NOTE: This warning seems like a nuisance, but it has caught genuine mistakes.
258258
// For example, when projects were moved into category folders, the relative path for
259259
// the API review files ended up in the wrong place.
260260
messageRouter.logError(ConsoleMessageId.ApiReportMissing, `The API review file has not been set up.`
261-
+ ` Do this by copying ${actualApiReviewShortPath}`
262-
+ ` to ${expectedApiReviewShortPath} and committing it.`);
261+
+ ` Do this by copying ${actualApiReportShortPath}`
262+
+ ` to ${expectedApiReportShortPath} and committing it.`);
263263
}
264264
}
265265

apps/api-extractor/src/collector/MessageRouter.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export class MessageRouter {
270270
* being shown on the console.
271271
*/
272272
public fetchAssociatedMessagesForReviewFile(astDeclaration: AstDeclaration): ExtractorMessage[] {
273-
const messagesForApiReviewFile: ExtractorMessage[] = [];
273+
const messagesForApiReportFile: ExtractorMessage[] = [];
274274

275275
const associatedMessages: ExtractorMessage[] = this._associatedMessagesForAstDeclaration.get(astDeclaration) || [];
276276
for (const associatedMessage of associatedMessages) {
@@ -283,23 +283,23 @@ export class MessageRouter {
283283
if (reportingRule.addToApiReportFile) {
284284

285285
// Include it in the result, and record that it went to the API review file
286-
messagesForApiReviewFile.push(associatedMessage);
286+
messagesForApiReportFile.push(associatedMessage);
287287
associatedMessage.handled = true;
288288
}
289289
}
290290

291291
}
292292

293-
this._sortMessagesForOutput(messagesForApiReviewFile);
294-
return messagesForApiReviewFile;
293+
this._sortMessagesForOutput(messagesForApiReportFile);
294+
return messagesForApiReportFile;
295295
}
296296

297297
/**
298298
* This returns all remaining messages that were flagged with `addToApiReportFile`, but which were not
299299
* retreieved using `fetchAssociatedMessagesForReviewFile()`.
300300
*/
301301
public fetchUnassociatedMessagesForReviewFile(): ExtractorMessage[] {
302-
const messagesForApiReviewFile: ExtractorMessage[] = [];
302+
const messagesForApiReportFile: ExtractorMessage[] = [];
303303

304304
for (const unassociatedMessage of this.messages) {
305305

@@ -311,15 +311,15 @@ export class MessageRouter {
311311
if (reportingRule.addToApiReportFile) {
312312

313313
// Include it in the result, and record that it went to the API review file
314-
messagesForApiReviewFile.push(unassociatedMessage);
314+
messagesForApiReportFile.push(unassociatedMessage);
315315
unassociatedMessage.handled = true;
316316
}
317317
}
318318

319319
}
320320

321-
this._sortMessagesForOutput(messagesForApiReviewFile);
322-
return messagesForApiReviewFile;
321+
this._sortMessagesForOutput(messagesForApiReportFile);
322+
return messagesForApiReportFile;
323323
}
324324

325325
/**

0 commit comments

Comments
 (0)