Skip to content

Commit bfb1ff4

Browse files
authored
chore: enforce curly-newline lint rule to comply with COE action item (#70)
--- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent c6d05c3 commit bfb1ff4

File tree

101 files changed

+681
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+681
-231
lines changed

.eslintrc.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cdk-build-tools/.eslintrc.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cdk-build-tools/lib/bockfs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ namespace bockfs {
3737
* Turn a fake path into a real path
3838
*/
3939
export function path(fakePath: string) {
40-
if (fakePath.startsWith('/')) { fakePath = fakePath.slice(1); } // Force path to be non-absolute
40+
if (fakePath.startsWith('/')) {
41+
fakePath = fakePath.slice(1);
42+
} // Force path to be non-absolute
4143
return path_.join(bockFsRoot, fakePath);
4244
}
4345

packages/@aws-cdk/cdk-build-tools/lib/os.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,19 @@ export async function makeExecutable(javascriptFile: string): Promise<void> {
145145
*/
146146
async function makeShellScriptExecutable(script: string) {
147147
try {
148-
if (await canExecute(script)) { return; }
149-
if (!await isShellScript(script)) { return; }
148+
if (await canExecute(script)) {
149+
return;
150+
}
151+
if (!await isShellScript(script)) {
152+
return;
153+
}
150154
await util.promisify(fs.chmod)(script, 0o755);
151155
} catch (e: any) {
152156
// If it happens that this file doesn't exist, that's fine. It's
153157
// probably a file that can be found on the $PATH.
154-
if (e.code === 'ENOENT') { return; }
158+
if (e.code === 'ENOENT') {
159+
return;
160+
}
155161
throw e;
156162
}
157163
}
@@ -161,7 +167,9 @@ async function canExecute(fileName: string): Promise<boolean> {
161167
await util.promisify(fs.access)(fileName, fs.constants.X_OK);
162168
return true;
163169
} catch (e: any) {
164-
if (e.code === 'EACCES') { return false; }
170+
if (e.code === 'EACCES') {
171+
return false;
172+
}
165173
throw e;
166174
}
167175
}

packages/@aws-cdk/cdk-build-tools/lib/package-info.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ export async function listFiles(dirName: string, predicate: (x: File) => boolean
7070

7171
return ret;
7272
} catch (e: any) {
73-
if (e.code === 'ENOENT') { return []; }
73+
if (e.code === 'ENOENT') {
74+
return [];
75+
}
7476
throw e;
7577
}
7678
}

packages/@aws-cdk/cdk-build-tools/lib/timer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export class Timer {
2222
}
2323

2424
public humanTime() {
25-
if (!this.timeMs) { return '???'; }
25+
if (!this.timeMs) {
26+
return '???';
27+
}
2628

2729
const parts = [];
2830

packages/@aws-cdk/cdk-cli-wrapper/.eslintrc.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cdk-cli-wrapper/lib/utils.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ export function exec(commandLine: string[], options: { cwd?: string; json?: bool
1414
cwd: options.cwd,
1515
});
1616

17-
if (proc.error) { throw proc.error; }
17+
if (proc.error) {
18+
throw proc.error;
19+
}
1820
if (proc.status !== 0) {
1921
if (process.stderr) { // will be 'null' in verbose mode
2022
process.stderr.write(proc.stderr);
@@ -26,7 +28,9 @@ export function exec(commandLine: string[], options: { cwd?: string; json?: bool
2628

2729
try {
2830
if (options.json) {
29-
if (output.length === 0) { return {}; }
31+
if (output.length === 0) {
32+
return {};
33+
}
3034

3135
return JSON.parse(output);
3236
}

packages/@aws-cdk/cdk-cli-wrapper/test/cdk-wrapper.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ beforeEach(() => {
1818
});
1919
spawnMock = jest.spyOn(child_process, 'spawn').mockImplementation(jest.fn(() => {
2020
return {
21-
on: jest.fn(() => {}),
21+
on: jest.fn(() => {
22+
}),
2223
} as unknown as child_process.ChildProcess;
2324
}));
2425
});

packages/@aws-cdk/cli-lib-alpha/.eslintrc.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)