Skip to content

Commit 36c8d68

Browse files
committed
merge in upstream changes
2 parents 7685707 + 2e94873 commit 36c8d68

File tree

86 files changed

+867
-695
lines changed

Some content is hidden

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

86 files changed

+867
-695
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

package-lock.json

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

packages/amazonq/.changes/1.42.0.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"date": "2025-01-09",
3+
"version": "1.42.0",
4+
"entries": [
5+
{
6+
"type": "Bug Fix",
7+
"description": "Amazon Q /doc: Improve button text phrasing"
8+
},
9+
{
10+
"type": "Bug Fix",
11+
"description": "Amazon Q /dev: Fix issue when files are deleted while preparing context"
12+
},
13+
{
14+
"type": "Bug Fix",
15+
"description": "Amazon Q Code Transformation: allow POSTGRESQL as target DB for SQL conversions"
16+
},
17+
{
18+
"type": "Bug Fix",
19+
"description": "Fix context menu displaying when typing @, even though input is disallowed"
20+
},
21+
{
22+
"type": "Bug Fix",
23+
"description": "Amazon Q can update mvn and gradle build files"
24+
},
25+
{
26+
"type": "Bug Fix",
27+
"description": "/transform: use correct documentation link in SQL conversion help message"
28+
},
29+
{
30+
"type": "Bug Fix",
31+
"description": "Up/down history navigation only triggering on first/last line of prompt input"
32+
},
33+
{
34+
"type": "Bug Fix",
35+
"description": "Amazon Q /test: Fix to redirect /test to generate tests in chat for external files out of workspace scope."
36+
},
37+
{
38+
"type": "Bug Fix",
39+
"description": "/review: Code block extends beyond page margins in code issue detail view"
40+
},
41+
{
42+
"type": "Bug Fix",
43+
"description": "Amazon Q Code Transformation: retry project upload up to 3 times"
44+
},
45+
{
46+
"type": "Feature",
47+
"description": "Amazon Q Code Transformation: add view summary button in chat"
48+
},
49+
{
50+
"type": "Feature",
51+
"description": "Amazon Q: new code syntax highlighter for improved accuracy"
52+
},
53+
{
54+
"type": "Removal",
55+
"description": "Settings: No longer migrate old CodeWhisperer settings or initialize telemetry setting from AWS Toolkit."
56+
}
57+
]
58+
}

packages/amazonq/.changes/next-release/Bug Fix-525ae1a7-9ded-4bd1-8357-0a4c0e7fe33f.json

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "Fix inline completion supplementalContext length exceeding maximum in certain cases"
4+
}

packages/amazonq/.changes/next-release/Bug Fix-99919167-cb02-4bb1-846a-949a55b37130.json

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

packages/amazonq/.changes/next-release/Bug Fix-c0428af9-a9e5-4f7f-a4f3-9cfe4ea851c9.json

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "User-selected customizations are sometimes not being persisted."
4+
}

0 commit comments

Comments
 (0)