Skip to content

Commit e003b28

Browse files
aws-toolkit-automationhunterwerlla
aws-toolkit-automation
authored andcommitted
Reformat the whole repo with prettier
1 parent 8f8934b commit e003b28

File tree

201 files changed

+3121
-4041
lines changed

Some content is hidden

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

201 files changed

+3121
-4041
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"type": "Bug Fix",
3-
"description": "Creating SAM Applications into a different folder than the current VS Code workspaces will now open an application file after app creation (#678)"
4-
}
2+
"type": "Bug Fix",
3+
"description": "Creating SAM Applications into a different folder than the current VS Code workspaces will now open an application file after app creation (#678)"
4+
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"type": "Feature",
3-
"description": "Improved the description of the selection item when picking a location for a new SAM Application (#673, #675)"
4-
}
2+
"type": "Feature",
3+
"description": "Improved the description of the selection item when picking a location for a new SAM Application (#673, #675)"
4+
}

.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
out
2+
resources/endpoints.json
3+
third-party/**
4+
CHANGELOG.md
5+
src/shared/telemetry/service-2.json

.travis.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
language: node_js
22

3-
node_js:
4-
- "lts/*"
3+
node_js:
4+
- 'lts/*'
55

66
matrix:
7-
include:
8-
- os: linux
9-
dist: bionic
10-
- os: osx
7+
include:
8+
- os: linux
9+
dist: bionic
10+
- os: osx
1111

1212
services:
13-
- xvfb
13+
- xvfb
1414

1515
script:
16-
- npm install
17-
- npm run vscode:prepublish
18-
- npm test
16+
- npm install
17+
- npm run vscode:prepublish
18+
- npm test
1919

2020
after_success:
21-
- bash <(curl -s https://codecov.io/bash) -s .coverage
21+
- bash <(curl -s https://codecov.io/bash) -s .coverage

.vscode/launch.json

+5-13
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@
1010
"type": "extensionHost",
1111
"request": "launch",
1212
"runtimeExecutable": "${execPath}",
13-
"args": [
14-
"--extensionDevelopmentPath=${workspaceFolder}"
15-
],
16-
"outFiles": [
17-
"${workspaceFolder}/out/**/*.js"
18-
],
13+
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
14+
"outFiles": ["${workspaceFolder}/out/**/*.js"],
1915
"preLaunchTask": "npm: watch"
2016
},
2117
{
@@ -27,9 +23,7 @@
2723
"--extensionDevelopmentPath=${workspaceFolder}",
2824
"--extensionTestsPath=${workspaceFolder}/out/src/test"
2925
],
30-
"outFiles": [
31-
"${workspaceFolder}/out/src/test/**/*.js"
32-
],
26+
"outFiles": ["${workspaceFolder}/out/src/test/**/*.js"],
3327
"preLaunchTask": "npm: watch"
3428
},
3529
{
@@ -42,10 +36,8 @@
4236
"--extensionDevelopmentPath=${workspaceFolder}",
4337
"--extensionTestsPath=${workspaceFolder}/out/src/integrationTest"
4438
],
45-
"outFiles": [
46-
"${workspaceFolder}/out/src/integrationTest/**/*.js"
47-
],
39+
"outFiles": ["${workspaceFolder}/out/src/integrationTest/**/*.js"],
4840
"preLaunchTask": "npm: watch"
4941
}
5042
]
51-
}
43+
}

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"search.exclude": {
77
"out": true // set this to false to include "out" folder in search results
88
}
9-
}
9+
}

.vscode/tasks.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@
4040
"problemMatcher": []
4141
}
4242
]
43-
}
43+
}

build-scripts/bundleDeps.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
'use strict';
1+
'use strict'
22
/*
33
This script is called from npm run compile.
44
It adds clientside libraries to ./media/libs.
55
*/
6-
const fs = require('fs-extra');
7-
const path = require('path');
8-
const _ = require('lodash');
6+
const fs = require('fs-extra')
7+
const path = require('path')
8+
const _ = require('lodash')
99

1010
const JS_DEPS = [
1111
{
1212
name: 'vue.min.js',
1313
path: 'vue/dist/vue.min.js'
1414
}
15-
];
16-
const WORKING_DIR = path.join(__dirname, '..');
17-
const NODE_MODULES_DIR = path.join(WORKING_DIR, 'node_modules');
18-
const LIBRARY_DIR = path.join(WORKING_DIR, 'media', 'libs');
19-
(async () => {
20-
const work = [];
21-
copy(JS_DEPS, LIBRARY_DIR, work);
15+
]
16+
const WORKING_DIR = path.join(__dirname, '..')
17+
const NODE_MODULES_DIR = path.join(WORKING_DIR, 'node_modules')
18+
const LIBRARY_DIR = path.join(WORKING_DIR, 'media', 'libs')
19+
;(async () => {
20+
const work = []
21+
copy(JS_DEPS, LIBRARY_DIR, work)
2222
try {
23-
await Promise.all(work);
24-
console.log('Successfully copied all clientside dependencies.');
23+
await Promise.all(work)
24+
console.log('Successfully copied all clientside dependencies.')
2525
} catch (e) {
26-
console.error('Error when copying clientside dependencies.');
27-
console.error(e);
26+
console.error('Error when copying clientside dependencies.')
27+
console.error(e)
2828
}
2929

3030
function copy(deps, destinationPath, workArr) {
31-
_.forEach(deps, (dep) => {
32-
const depPath = path.join(NODE_MODULES_DIR, dep.path);
33-
console.log(`Copying ${depPath} to ${destinationPath}`);
34-
workArr.push(fs.copy(depPath, path.join(destinationPath, dep.name)));
35-
});
31+
_.forEach(deps, dep => {
32+
const depPath = path.join(NODE_MODULES_DIR, dep.path)
33+
console.log(`Copying ${depPath} to ${destinationPath}`)
34+
workArr.push(fs.copy(depPath, path.join(destinationPath, dep.name)))
35+
})
3636
}
37-
})();
37+
})()

build-scripts/clean.js

+21-20
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
'use strict'
77

88
/*
9-
* This script removes the specified folders.
9+
* This script removes the specified folders.
1010
* Used to perform a clean compile, which is useful for things like:
1111
* - flushing out stale test files.
1212
* - updating dependencies after changing branches
1313
*/
1414

15-
const fs = require('fs');
16-
const _path = require('path');
15+
const fs = require('fs')
16+
const _path = require('path')
1717
const util = require('util')
1818

1919
const readdir = util.promisify(fs.readdir)
@@ -24,39 +24,40 @@ const unlink = util.promisify(fs.unlink)
2424
// Recursive delete without requiring a third-party library. This allows the script
2525
// to be run before `npm install`.
2626
async function rdelete(path) {
27-
const stats = await stat(path);
27+
const stats = await stat(path)
2828
if (stats.isFile()) {
29-
await unlink(path);
29+
await unlink(path)
3030
} else if (stats.isDirectory()) {
31-
const promises = (await readdir(path))
32-
.map(child => rdelete(_path.join(path, child)));
31+
const promises = (await readdir(path)).map(child => rdelete(_path.join(path, child)))
3332

34-
await Promise.all(promises);
35-
await rmdir(path);
33+
await Promise.all(promises)
34+
await rmdir(path)
3635
} else {
37-
throw new Error(`Could not delete '${path}' because it is neither a file nor directory`);
36+
throw new Error(`Could not delete '${path}' because it is neither a file nor directory`)
3837
}
3938
}
4039

41-
(async () => {
40+
;(async () => {
4241
for (const arg of process.argv.slice(2)) {
4342
try {
44-
const directory = _path.join(__dirname, '..', arg);
43+
const directory = _path.join(__dirname, '..', arg)
4544

4645
try {
47-
fs.accessSync(directory);
46+
fs.accessSync(directory)
4847
} catch (e) {
49-
console.log(`Could not access '${directory}', probably because it does not exist. Skipping clean for this directory.`);
50-
return;
48+
console.log(
49+
`Could not access '${directory}', probably because it does not exist. Skipping clean for this directory.`
50+
)
51+
return
5152
}
5253

53-
console.log(`Removing ${directory} ...`);
54+
console.log(`Removing ${directory} ...`)
5455

55-
await rdelete(directory);
56+
await rdelete(directory)
5657

57-
console.log('Done');
58+
console.log('Done')
5859
} catch (e) {
59-
console.error(`Could not clean '${arg}': ${String(e)}`);
60+
console.error(`Could not clean '${arg}': ${String(e)}`)
6061
}
6162
}
62-
})();
63+
})()

build-scripts/copyNonCodeFiles.js

+13-20
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
1-
'use strict';
1+
'use strict'
22

33
/*
44
This script is called from npm run compile. It copies the
55
files and directories listed in `relativePaths` to `out/`.
66
*/
77

8-
const fs = require('fs-extra');
9-
const path = require('path');
8+
const fs = require('fs-extra')
9+
const path = require('path')
1010

11-
const repoRoot = path.dirname(__dirname);
12-
const outRoot = path.join(repoRoot, 'out');
11+
const repoRoot = path.dirname(__dirname)
12+
const outRoot = path.join(repoRoot, 'out')
1313

1414
// May be individual files or entire directories.
15-
const relativePaths = [
16-
path.join('src', 'schemas'),
17-
path.join('src', 'test', 'shared', 'cloudformation', 'yaml')
18-
];
15+
const relativePaths = [path.join('src', 'schemas'), path.join('src', 'test', 'shared', 'cloudformation', 'yaml')]
1916

20-
(async () => {
17+
;(async () => {
2118
for (const relativePath of relativePaths) {
22-
await fs.copy(
23-
path.join(repoRoot, relativePath),
24-
path.join(outRoot, relativePath),
25-
{
26-
recursive: true,
27-
overwrite: true,
28-
errorOnExist: false,
29-
}
30-
);
19+
await fs.copy(path.join(repoRoot, relativePath), path.join(outRoot, relativePath), {
20+
recursive: true,
21+
overwrite: true,
22+
errorOnExist: false
23+
})
3124
}
32-
})();
25+
})()

build-scripts/createRelease.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ for (const changeFile of changeFiles) {
4242
}
4343

4444
// tslint:disable-next-line: no-unsafe-any
45-
changelog.entries.sort((x: {type: string}, y: {type: string}) => x.type.localeCompare(y.type))
45+
changelog.entries.sort((x: { type: string }, y: { type: string }) => x.type.localeCompare(y.type))
4646

4747
// Write changelog file
4848
fs.writeFileSync(changesFile, JSON.stringify(changelog, undefined, '\t'))

build-scripts/createWelcomePage.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict';
1+
'use strict'
22

33
/*
44
This script is called from npm run compile.
@@ -7,21 +7,21 @@
77
This makes it easier to swap in relative links when the extension loads.
88
*/
99

10-
const fs = require('fs-extra');
11-
const path = require('path');
10+
const fs = require('fs-extra')
11+
const path = require('path')
1212
const marked = require('marked')
1313

14-
const repoRoot = path.dirname(__dirname);
14+
const repoRoot = path.dirname(__dirname)
1515

16-
( () => {
17-
const fileText = fs.readFileSync(path.join(repoRoot, 'extension-readme.md')).toString();
16+
;(() => {
17+
const fileText = fs.readFileSync(path.join(repoRoot, 'extension-readme.md')).toString()
1818

1919
// paths are a little more foolproof to find in markdown form than HTML.
20-
// find anything with a relative path and convert it to an easy-to-find token so we can convert to paths relative
21-
const relativePathRegex = /]\(\.\//g;
22-
const transformedText = fileText.replace(relativePathRegex, '](!!EXTENSIONROOT!!/');
20+
// find anything with a relative path and convert it to an easy-to-find token so we can convert to paths relative
21+
const relativePathRegex = /]\(\.\//g
22+
const transformedText = fileText.replace(relativePathRegex, '](!!EXTENSIONROOT!!/')
2323

2424
marked(transformedText, (err, result) => {
25-
fs.writeFileSync(path.join(repoRoot, './welcomePage.html'), result);
25+
fs.writeFileSync(path.join(repoRoot, './welcomePage.html'), result)
2626
})
27-
})();
27+
})()

build-scripts/newChange.ts

+2-9
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,10 @@ import { v4 as uuid } from 'uuid'
1212

1313
const directory = '.changes/next-release'
1414

15-
const changeTypes = [
16-
'Breaking Change',
17-
'Feature',
18-
'Bug Fix',
19-
'Deprecation',
20-
'Removal',
21-
'Test'
22-
]
15+
const changeTypes = ['Breaking Change', 'Feature', 'Bug Fix', 'Deprecation', 'Removal', 'Test']
2316

2417
interface NewChange {
25-
type: string,
18+
type: string
2619
description: string
2720
}
2821

0 commit comments

Comments
 (0)