Skip to content

Commit d44ad35

Browse files
authored
[EngSys] Fix format checking error (Azure#27602)
Some files are not formated in commits that were merged without CI. This PR updates them with the result from `rush format`, and also fixes `format` script for ts-http-runtime
1 parent 49626ce commit d44ad35

File tree

15 files changed

+85
-46
lines changed

15 files changed

+85
-46
lines changed

common/tools/dev-tool/src/config/rollup.base.config.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,18 @@ function ignoreExternalModules(warning: RollupWarning): boolean {
9696
);
9797
}
9898

99-
function createWarningInhibitors({ ignoreMissingNodeBuiltins }: MakeOnWarnForTestingOptions = {}): Array<(warning: RollupWarning) => boolean> {return [
100-
ignoreChaiCircularDependency,
101-
ignoreRheaPromiseCircularDependency,
102-
ignoreNiseSinonEval,
103-
ignoreOpenTelemetryCircularDependency,
104-
ignoreOpenTelemetryThisIsUndefined,
105-
ignoreMissingExportsFromEmpty,
106-
...ignoreMissingNodeBuiltins ? [ignoreExternalModules] : [],
107-
];
99+
function createWarningInhibitors({
100+
ignoreMissingNodeBuiltins,
101+
}: MakeOnWarnForTestingOptions = {}): Array<(warning: RollupWarning) => boolean> {
102+
return [
103+
ignoreChaiCircularDependency,
104+
ignoreRheaPromiseCircularDependency,
105+
ignoreNiseSinonEval,
106+
ignoreOpenTelemetryCircularDependency,
107+
ignoreOpenTelemetryThisIsUndefined,
108+
ignoreMissingExportsFromEmpty,
109+
...(ignoreMissingNodeBuiltins ? [ignoreExternalModules] : []),
110+
];
108111
}
109112

110113
interface MakeOnWarnForTestingOptions {
@@ -115,7 +118,9 @@ interface MakeOnWarnForTestingOptions {
115118
* Construct a warning handler for the shared rollup configuration
116119
* that ignores certain warnings that are not relevant to testing.
117120
*/
118-
export function makeOnWarnForTesting(opts: MakeOnWarnForTestingOptions = {}): (warning: RollupWarning, warn: WarningHandlerWithDefault) => void {
121+
export function makeOnWarnForTesting(
122+
opts: MakeOnWarnForTestingOptions = {}
123+
): (warning: RollupWarning, warn: WarningHandlerWithDefault) => void {
119124
const warningInhibitors = createWarningInhibitors(opts);
120125
return (warning, warn) => {
121126
if (!warningInhibitors.some((inhibited) => inhibited(warning))) {

common/tools/dev-tool/src/util/customization/customize.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ export async function customize(originalDir: string, customDir: string, outDir:
4040
return;
4141
}
4242

43-
_originalFolderName = originalDir.replace(commonPrefix(originalDir, customDir), "").replace(/\\/g, "/") ?? _originalFolderName;
43+
_originalFolderName =
44+
originalDir.replace(commonPrefix(originalDir, customDir), "").replace(/\\/g, "/") ??
45+
_originalFolderName;
4446

4547
// Bring files only present in custom into the output
4648
copyFilesInCustom(originalDir, customDir, outDir);
@@ -295,9 +297,9 @@ function isSelfImport(module: string, file: SourceFile): boolean {
295297
projectPath = projectPath.getParent() as Directory;
296298
}
297299
// e.g: ./sources/generated/src
298-
const relativeOriginal = originalDir.replace(/\\/g, '/').replace(projectPath.getPath(), ".");
300+
const relativeOriginal = originalDir.replace(/\\/g, "/").replace(projectPath.getPath(), ".");
299301
// e.g: ./sources/customizations
300-
const relativeCustom = customDir.replace(/\\/g, '/').replace(projectPath.getPath(), ".");
302+
const relativeCustom = customDir.replace(/\\/g, "/").replace(projectPath.getPath(), ".");
301303
// e.g: ./sources/
302304
const prefix = commonPrefix(relativeOriginal, relativeCustom);
303305
// e.g generated/src
@@ -310,7 +312,7 @@ function isSelfImport(module: string, file: SourceFile): boolean {
310312
return false;
311313
}
312314
const moduleRelative = module.substring(index + originalSuffix.length);
313-
const sanitizedPath = file.getFilePath().replace(/\\/g, '/').replace(/\.ts$/, ".js");
315+
const sanitizedPath = file.getFilePath().replace(/\\/g, "/").replace(/\.ts$/, ".js");
314316
if (sanitizedPath.endsWith(moduleRelative)) {
315317
return true;
316318
}

common/tools/dev-tool/src/util/testProxyUtils.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ export function createAssetsJson(project: ProjectInfo): Promise<void> {
187187
const execPromise = promisify(exec);
188188

189189
async function getRecordingsDirectory(project: ProjectInfo): Promise<string> {
190-
const { stdout } = await execPromise(`${await getTestProxyExecutable()} config locate -a assets.json`, { cwd: project.path });
190+
const { stdout } = await execPromise(
191+
`${await getTestProxyExecutable()} config locate -a assets.json`,
192+
{ cwd: project.path }
193+
);
191194
const lines = stdout.split("\n");
192195

193196
// the directory is the second-to-last line of output (there's some other log output that comes out from the test proxy first, and the last line is empty)
@@ -200,7 +203,11 @@ export async function linkRecordingsDirectory() {
200203
const recordingsDirectory = await getRecordingsDirectory(project);
201204
const projectRelativeToRoot = path.relative(root, project.path);
202205

203-
const trueRecordingsDirectory = path.join(recordingsDirectory, projectRelativeToRoot, 'recordings/');
206+
const trueRecordingsDirectory = path.join(
207+
recordingsDirectory,
208+
projectRelativeToRoot,
209+
"recordings/"
210+
);
204211
const relativeRecordingsDirectory = path.relative(project.path, trueRecordingsDirectory);
205212

206213
const symlinkLocation = path.join(project.path, "_recordings");
@@ -210,7 +217,9 @@ export async function linkRecordingsDirectory() {
210217
if (stat.isSymbolicLink()) {
211218
await fs.unlink(symlinkLocation);
212219
} else {
213-
log.warn("Could not create symbolic link to recordings directory: a file exists at _recordings already.");
220+
log.warn(
221+
"Could not create symbolic link to recordings directory: a file exists at _recordings already."
222+
);
214223
return;
215224
}
216225
}
@@ -272,7 +281,8 @@ export async function isProxyToolActive(): Promise<boolean> {
272281
await axios.get(`http://localhost:${process.env.TEST_PROXY_HTTP_PORT ?? 5000}/info/available`);
273282

274283
log.info(
275-
`Proxy tool seems to be active at http://localhost:${process.env.TEST_PROXY_HTTP_PORT ?? 5000
284+
`Proxy tool seems to be active at http://localhost:${
285+
process.env.TEST_PROXY_HTTP_PORT ?? 5000
276286
}\n`
277287
);
278288
return true;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "../../../config/rush-project.json",
2+
"extends": "../../../config/rush-project.json"
33
}

sdk/appconfiguration/perf-tests/app-configuration/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"compilerOptions": {
44
"module": "commonjs",
55
"declarationDir": "./types/latest",
6-
"outDir": "./dist-esm",
6+
"outDir": "./dist-esm"
77
},
88
"compileOnSave": true,
99
"exclude": ["node_modules"],

sdk/core/ts-http-runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"clean": "rimraf dist dist-* temp types *.tgz *.log",
3636
"execute:samples": "echo skipped",
3737
"extract-api": "tsc -p . && api-extractor run --local",
38-
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
38+
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
3939
"integration-test:browser": "echo skipped",
4040
"integration-test:node": "echo skipped",
4141
"integration-test": "npm run integration-test:node && npm run integration-test:browser",

sdk/devcenter/developer-devcenter-rest/test/public/devBoxesTest.spec.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ describe("DevCenter Dev Boxes Operations Test", () => {
6666

6767
assert.equal(devBoxCreateResponse.status, "201", "Dev Box creation should return 201 Created.");
6868

69-
const devBoxCreatePoller = getLongRunningPoller(client, devBoxCreateResponse, testPollingOptions);
69+
const devBoxCreatePoller = getLongRunningPoller(
70+
client,
71+
devBoxCreateResponse,
72+
testPollingOptions
73+
);
7074
const devBoxCreateResult = await devBoxCreatePoller.pollUntilDone();
7175

7276
if (isUnexpected(devBoxCreateResult)) {
@@ -97,7 +101,11 @@ describe("DevCenter Dev Boxes Operations Test", () => {
97101

98102
assert.equal(devBoxDeleteResponse.status, "202", "Delete Dev Box should return 202 Accepted.");
99103

100-
const devBoxDeletePoller = getLongRunningPoller(client, devBoxDeleteResponse, testPollingOptions);
104+
const devBoxDeletePoller = getLongRunningPoller(
105+
client,
106+
devBoxDeleteResponse,
107+
testPollingOptions
108+
);
101109
const devBoxDeleteResult = await devBoxDeletePoller.pollUntilDone();
102110

103111
if (isUnexpected(devBoxDeleteResult)) {

sdk/devcenter/developer-devcenter-rest/test/public/environmentsTest.spec.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ describe("DevCenter Environments Operations Test", () => {
7979
"Environment creation should return 201 created."
8080
);
8181

82-
const environmentCreatePoller = getLongRunningPoller(client, environmentCreateResponse, testPollingOptions);
82+
const environmentCreatePoller = getLongRunningPoller(
83+
client,
84+
environmentCreateResponse,
85+
testPollingOptions
86+
);
8387
const environmentCreateResult = await environmentCreatePoller.pollUntilDone();
8488

8589
if (isUnexpected(environmentCreateResult)) {
@@ -119,7 +123,11 @@ describe("DevCenter Environments Operations Test", () => {
119123
"Environment delete should return 202 accepted."
120124
);
121125

122-
const environmentDeletePoller = getLongRunningPoller(client, environmentDeleteResponse, testPollingOptions);
126+
const environmentDeletePoller = getLongRunningPoller(
127+
client,
128+
environmentDeleteResponse,
129+
testPollingOptions
130+
);
123131
const environmentDeleteResult = await environmentDeletePoller.pollUntilDone();
124132

125133
if (isUnexpected(environmentDeleteResult)) {

sdk/eventhub/perf-tests/event-hubs/test/subscribe.spec.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface ReceiverOptions {
2121
* Useful when relevant code is updated
2222
* Introduced when prefetch feature was added to Event Hubs
2323
*/
24-
"log-median-batch-size": boolean
24+
"log-median-batch-size": boolean;
2525
}
2626

2727
const connectionString = getEnvVar("EVENTHUB_CONNECTION_STRING");
@@ -67,9 +67,10 @@ export class SubscribeTest extends EventPerfTest<ReceiverOptions> {
6767
},
6868
"log-median-batch-size": {
6969
required: false,
70-
description: "Logs more information related to the batch size, such as median, max, average, etc",
70+
description:
71+
"Logs more information related to the batch size, such as median, max, average, etc",
7172
defaultValue: false,
72-
}
73+
},
7374
};
7475

7576
constructor() {
@@ -121,9 +122,17 @@ export class SubscribeTest extends EventPerfTest<ReceiverOptions> {
121122
await consumer.close();
122123
// The following might just be noise if we don't think there are related changes to the code
123124
if (this.parsedOptions["log-median-batch-size"].value) {
124-
console.log(`\tBatch count: ${this.callbackCallsCount}, Batch count per sec: ${this.callbackCallsCount / this.parsedOptions.duration.value}`);
125+
console.log(
126+
`\tBatch count: ${this.callbackCallsCount}, Batch count per sec: ${
127+
this.callbackCallsCount / this.parsedOptions.duration.value
128+
}`
129+
);
125130
console.log(`\tmessagesPerBatch: ${this.messagesPerBatch}`);
126-
console.log(`\tmessagesPerBatch... median: ${median(this.messagesPerBatch)}, avg: ${this.messagesPerBatch.reduce((a, b) => a + b, 0) / this.messagesPerBatch.length}, max: ${Math.max(...this.messagesPerBatch)}, min: ${Math.min(...this.messagesPerBatch)}`);
131+
console.log(
132+
`\tmessagesPerBatch... median: ${median(this.messagesPerBatch)}, avg: ${
133+
this.messagesPerBatch.reduce((a, b) => a + b, 0) / this.messagesPerBatch.length
134+
}, max: ${Math.max(...this.messagesPerBatch)}, min: ${Math.min(...this.messagesPerBatch)}`
135+
);
127136
}
128137
}
129138
}
@@ -171,8 +180,7 @@ function median(values: number[]) {
171180

172181
const half = Math.floor(values.length / 2);
173182

174-
if (values.length % 2)
175-
return values[half];
183+
if (values.length % 2) return values[half];
176184

177185
return (values[half - 1] + values[half]) / 2.0;
178186
}

sdk/formrecognizer/ai-form-recognizer/test/public/browser/analysis.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ describe("analysis (browser)", () => {
3333
const urlParts = testingContainerUrl.split("?");
3434
const url = `${urlParts[0]}/contoso-allinone.jpg?${urlParts[1]}`;
3535

36-
const poller = await client.beginAnalyzeDocumentFromUrl("prebuilt-receipt", url, testPollingOptions);
36+
const poller = await client.beginAnalyzeDocumentFromUrl(
37+
"prebuilt-receipt",
38+
url,
39+
testPollingOptions
40+
);
3741
const { documents: receipts } = await poller.pollUntilDone();
3842

3943
assert.ok(

0 commit comments

Comments
 (0)