Skip to content

Commit dad4001

Browse files
authored
Merge branch 'aws:master' into master
2 parents e3043db + cf700b6 commit dad4001

File tree

253 files changed

+3758
-3307
lines changed

Some content is hidden

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

253 files changed

+3758
-3307
lines changed

.eslintrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,15 @@ module.exports = {
206206
message:
207207
'Avoid child_process, use ChildProcess from `shared/utilities/processUtils.ts` instead.',
208208
},
209+
{
210+
name: '..',
211+
message:
212+
'Avoid importing from index.ts files as it can lead to circular dependencies. Import from the module directly instead.',
213+
},
209214
],
210215
},
211216
],
217+
218+
'prettier/prettier': ['error', { endOfLine: 'auto' }],
212219
},
213220
}

.github/workflows/filterDuplicates.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* the program exits with an error and logs the filtered report to console.
55
*
66
* Usage:
7-
* node filterDuplicates.js run [path_to_git_diff] [path_to_jscpd_report]
7+
* node filterDuplicates.js run [path_to_git_diff] [path_to_jscpd_report] [commit_hash] [repo_name]
88
*
99
* Tests:
1010
* node filterDuplicates.js test
@@ -84,25 +84,40 @@ function filterDuplicates(report, changes) {
8484
return duplicates
8585
}
8686

87+
function formatDuplicates(duplicates, commitHash, repoName) {
88+
const baseUrl = `https://github.com/${repoName}`
89+
return duplicates.map((dupe) => {
90+
return {
91+
first: formUrl(dupe.firstFile, commitHash),
92+
second: formUrl(dupe.secondFile, commitHash),
93+
numberOfLines: dupe.lines,
94+
}
95+
})
96+
function formUrl(file, commitHash) {
97+
return `${baseUrl}/blob/${commitHash}/${file.name}#L${file.start}-L${file.end}`
98+
}
99+
}
100+
87101
async function run() {
88102
const rawDiffPath = process.argv[3]
89103
const jscpdReportPath = process.argv[4]
104+
const commitHash = process.argv[5]
105+
const repoName = process.argv[6]
90106
const changes = await parseDiff(rawDiffPath)
91107
const jscpdReport = JSON.parse(await fs.readFile(jscpdReportPath, 'utf8'))
92108
const filteredDuplicates = filterDuplicates(jscpdReport, changes)
93109

94110
console.log('%s files changes', changes.size)
95111
console.log('%s duplicates found', filteredDuplicates.length)
96112
if (filteredDuplicates.length > 0) {
97-
console.log(filteredDuplicates)
113+
console.log(formatDuplicates(filteredDuplicates, commitHash, repoName))
98114
process.exit(1)
99115
}
100116
}
101117

102118
/**
103119
* Mini-test Suite
104120
*/
105-
console.log(__dirname)
106121
const testDiffFile = path.resolve(__dirname, 'test/test_diff.txt')
107122
let testCounter = 0
108123
function assertEqual(actual, expected) {

.github/workflows/node.js.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ jobs:
101101
path: ./jscpd-report.json
102102

103103
- name: Check for Duplicates
104-
run: node "$GITHUB_WORKSPACE/.github/workflows/filterDuplicates.js" run diff_output.txt jscpd-report.json
104+
env:
105+
COMMIT_HASH: ${{ github.sha}}
106+
REPO_NAME: ${{ github.repository }}
107+
run: node "$GITHUB_WORKSPACE/.github/workflows/filterDuplicates.js" run diff_output.txt jscpd-report.json $COMMIT_HASH $REPO_NAME
105108

106109
macos:
107110
needs: lint-commits

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ packages/amazonq/package.nls.json
4747
packages/amazonq/resources
4848

4949
# Icons
50-
packages/*/resources/icons/cloud9/generated/**
5150
packages/*/resources/fonts/aws-toolkit-icons.woff
5251
packages/*/resources/css/icons.css
5352

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ If you are contribuing visual assets from other open source repos, the source re
633633
## Using new vscode APIs
634634

635635
The minimum required vscode version specified in [package.json](https://github.com/aws/aws-toolkit-vscode/blob/07119655109bb06105a3f53bbcd86b812b32cdbe/package.json#L16)
636-
is decided by the version of vscode running in Cloud9 and other vscode-compatible targets.
636+
is decided by the version of vscode running in other supported vscode-compatible targets (e.g. web).
637637

638638
But you can still use the latest vscode APIs, by checking the current running vscode version. For example, to use a vscode 1.64 API:
639639

cloud9-toolkit-install.sh

Lines changed: 0 additions & 139 deletions
This file was deleted.

docs/CODE_GUIDELINES.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,10 @@ that is a net cost.
8181
- Telemetry: "active" vs "passive"
8282
- Active (`passive:false`) metrics are those intended to appear in DAU count.
8383
- Icons:
84-
- Where possible, use IDE-specific standard icons (e.g. standard VSCode
85-
standard icons in VSCode, and Cloud9 standard icons in Cloud9). The typical
86-
(maintainable) way to do this is to use _named_ icons (what VSCode calls
84+
- Where possible, use standard VSCode icons. The typical (maintainable)
85+
way to do this is to use _named_ icons (what VSCode calls
8786
[codicons](https://microsoft.github.io/vscode-codicons/)) as opposed to
8887
icons shipped with the Toolkit build and referenced by _path_.
89-
- For cases where icons must be statically defined (package.json), if Cloud9
90-
does not support the VSCode standard icon, use the Cloud9 icon.
9188
- Changelog guidelines
9289
- Prefer active voice: "You can do X" instead of "X can be done"
9390
- Avoid unnecessary use of `lodash` (which we may remove in the future).
@@ -240,11 +237,11 @@ _See also [arch_develop.md](./arch_develop.md#exceptions)._
240237
241238
- PREFER:
242239
```ts
243-
things.filter(o => o.isFoo)
240+
things.filter((o) => o.isFoo)
244241
```
245242
- INSTEAD OF:
246243
```ts
247-
things.filter(thing => thing.isFoo)
244+
things.filter((thing) => thing.isFoo)
248245
```
249246
250247
## User settings

docs/arch_runtime.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ If you must define a new key (is it _really_ necessary?), follow these guideline
3131
These keys are currently set by the core/ package, but many of them may eventually be migrated to
3232
toolkit/ or amazonq/ if appropriate.
3333

34-
- `isCloud9`: This is hardcoded by Cloud9 itself, not the Toolkit.
35-
- Cloud9 _does not support setContext_. So this is the only usable key there.
3634
- `aws.codecatalyst.connected`: CodeCatalyst connection is active.
3735
- `aws.codewhisperer.connected`: CodeWhisperer connection is active.
3836
- `aws.codewhisperer.connectionExpired`: CodeWhisperer connection is active, but the connection is expired.

docs/icons.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ All icons that are used in the extensions can be found in `resources/icons`.
44

55
A [build script](../scripts/generateIcons.ts) generates extension artifacts in [core/](../packages/core/):
66

7-
- `resources/icons/cloud9/generated`
87
- `resources/fonts/aws-toolkit-icons.woff`
98
- `resources/css/icons.css`
109
- `contributes.icons` in [amazonq package.json](../packages/amazonq/package.json) and [toolkit package.json](../packages/toolkit/package.json)
@@ -31,7 +30,7 @@ If your desired icon does not work well as a font, see [Theme Overrides](#theme-
3130

3231
## Identifiers
3332

34-
Icons (except those in `cloud9`) can be referenced within the Toolkit by concatenating the icon path with hyphens, omitting the 'theme' if applicable.
33+
Icons can be referenced within the Toolkit by concatenating the icon path with hyphens, omitting the 'theme' if applicable.
3534

3635
Examples:
3736

@@ -50,11 +49,6 @@ For example, if I wanted to use a special App Runner service icon, then I need t
5049
- `resources/icons/aws/dark/apprunner-service.svg`
5150
- `resources/icons/aws/light/apprunner-service.svg`
5251

53-
A similar format is used for overriding icons only on Cloud9:
54-
55-
- `resources/icons/cloud9/dark/aws-apprunner-service.svg`
56-
- `resources/icons/cloud9/light/aws-apprunner-service.svg`
57-
5852
These icons will **not** be usuable as Codicons or as font icons.
5953

6054
## Third Party

0 commit comments

Comments
 (0)