Skip to content

Commit 798224b

Browse files
authored
Merge CodeWhisperer enhancements #4084
2 parents 0b63c71 + 5bc2398 commit 798224b

File tree

65 files changed

+2631
-117
lines changed

Some content is hidden

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

65 files changed

+2631
-117
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "CodeWhisperer supports Json, yaml and Tf"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "CodeWhisperer security scans support typescript, csharp, json, yaml, tf and hcl files."
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "CodeWhisperer: Uses Generative AI and automated reasoning to rewrite lines of code flagged for security vulnerabilities during a security scan."
4+
}

package-lock.json

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

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3845,18 +3845,20 @@
38453845
"report": "nyc report --reporter=html --reporter=json"
38463846
},
38473847
"devDependencies": {
3848-
"@aws-toolkits/telemetry": "^1.0.148",
3848+
"@aws-toolkits/telemetry": "^1.0.166",
38493849
"@cspotcode/source-map-support": "^0.8.1",
38503850
"@sinonjs/fake-timers": "^10.0.2",
38513851
"@types/adm-zip": "^0.4.34",
38523852
"@types/async-lock": "^1.4.0",
38533853
"@types/bytes": "^3.1.0",
38543854
"@types/circular-dependency-plugin": "^5.0.5",
38553855
"@types/cross-spawn": "^6.0.0",
3856+
"@types/diff": "^5.0.7",
38563857
"@types/fs-extra": "^9.0.11",
38573858
"@types/glob": "^7.1.1",
38583859
"@types/js-yaml": "^4.0.5",
38593860
"@types/lodash": "^4.14.180",
3861+
"@types/markdown-it": "^13.0.2",
38603862
"@types/marked": "^5.0.0",
38613863
"@types/mime-types": "^2.1.1",
38623864
"@types/mocha": "^10.0.0",
@@ -3880,11 +3882,13 @@
38803882
"@vue/compiler-sfc": "^3.3.2",
38813883
"circular-dependency-plugin": "^5.2.2",
38823884
"css-loader": "^6.7.3",
3885+
"diff": "^5.1.0",
38833886
"esbuild-loader": "2.20.0",
38843887
"eslint": "^8.26.0",
38853888
"eslint-config-prettier": "8.8",
38863889
"eslint-plugin-header": "^3.1.1",
38873890
"eslint-plugin-no-null": "^1.0.2",
3891+
"file-loader": "^6.2.0",
38883892
"glob": "^7.1.7",
38893893
"husky": "^7.0.2",
38903894
"json-schema-to-typescript": "^13.0.2",
@@ -3928,10 +3932,12 @@
39283932
"fast-json-patch": "^3.1.1",
39293933
"fs-extra": "^10.0.1",
39303934
"got": "^11.8.5",
3935+
"highlight.js": "^11.9.0",
39313936
"immutable": "^4.3.0",
39323937
"js-yaml": "^4.1.0",
39333938
"jsonc-parser": "^3.2.0",
39343939
"lodash": "^4.17.21",
3940+
"markdown-it": "^13.0.2",
39353941
"mime-types": "^2.1.32",
39363942
"moment": "^2.29.4",
39373943
"portfinder": "^1.0.32",

resources/css/securityIssue.css

Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
html,
2+
body {
3+
font-family: var(
4+
--markdown-font-family,
5+
-apple-system,
6+
BlinkMacSystemFont,
7+
'Segoe WPC',
8+
'Segoe UI',
9+
system-ui,
10+
'Ubuntu',
11+
'Droid Sans',
12+
sans-serif
13+
);
14+
font-size: var(--markdown-font-size, 14px);
15+
padding: 0 26px;
16+
line-height: var(--markdown-line-height, 22px);
17+
word-wrap: break-word;
18+
}
19+
20+
body {
21+
padding-top: 1em;
22+
}
23+
24+
/* Reset margin top for elements */
25+
h1,
26+
h2,
27+
h3,
28+
h4,
29+
h5,
30+
h6,
31+
p,
32+
ol,
33+
ul,
34+
pre {
35+
margin-top: 0;
36+
}
37+
38+
h1,
39+
h2,
40+
h3,
41+
h4,
42+
h5,
43+
h6 {
44+
font-weight: 600;
45+
margin-top: 24px;
46+
margin-bottom: 16px;
47+
line-height: 1.25;
48+
}
49+
50+
/* Prevent `sub` and `sup` elements from affecting line height */
51+
sub,
52+
sup {
53+
line-height: 0;
54+
}
55+
56+
ul ul:first-child,
57+
ul ol:first-child,
58+
ol ul:first-child,
59+
ol ol:first-child {
60+
margin-bottom: 0;
61+
}
62+
63+
img,
64+
video {
65+
max-width: 100%;
66+
max-height: 100%;
67+
}
68+
69+
a {
70+
text-decoration: none;
71+
}
72+
73+
a:hover {
74+
text-decoration: underline;
75+
}
76+
77+
a:focus,
78+
input:focus,
79+
select:focus,
80+
textarea:focus {
81+
outline: 1px solid -webkit-focus-ring-color;
82+
outline-offset: -1px;
83+
}
84+
85+
p {
86+
margin-bottom: 16px;
87+
}
88+
89+
li p {
90+
margin-bottom: 0.7em;
91+
}
92+
93+
ul,
94+
ol {
95+
margin-bottom: 0.7em;
96+
}
97+
98+
hr {
99+
border: 0;
100+
height: 1px;
101+
border-bottom: 1px solid;
102+
}
103+
104+
h1 {
105+
font-size: 2em;
106+
margin-top: 0;
107+
}
108+
109+
h2 {
110+
font-size: 1.5em;
111+
padding-bottom: 0.3em;
112+
border-bottom-width: 1px;
113+
border-bottom-style: solid;
114+
}
115+
116+
h3 {
117+
font-size: 1.25em;
118+
}
119+
120+
h4 {
121+
font-size: 1em;
122+
}
123+
124+
h5 {
125+
font-size: 0.875em;
126+
}
127+
128+
h6 {
129+
font-size: 0.85em;
130+
}
131+
132+
table {
133+
border-collapse: collapse;
134+
margin-bottom: 0.7em;
135+
}
136+
137+
th {
138+
text-align: left;
139+
border-bottom: 1px solid;
140+
}
141+
142+
th,
143+
td {
144+
padding: 5px 10px;
145+
}
146+
147+
table > tbody > tr + tr > td {
148+
border-top: 1px solid;
149+
}
150+
151+
blockquote {
152+
margin: 0;
153+
padding: 2px 16px 0 10px;
154+
border-left-width: 5px;
155+
border-left-style: solid;
156+
border-radius: 2px;
157+
}
158+
159+
code {
160+
font-family: var(
161+
--vscode-editor-font-family,
162+
'SF Mono',
163+
Monaco,
164+
Menlo,
165+
Consolas,
166+
'Ubuntu Mono',
167+
'Liberation Mono',
168+
'DejaVu Sans Mono',
169+
'Courier New',
170+
monospace
171+
);
172+
font-size: 1em;
173+
line-height: 1.357em;
174+
}
175+
176+
body.wordWrap pre {
177+
white-space: pre-wrap;
178+
}
179+
180+
pre:not(.hljs),
181+
pre.hljs code > div {
182+
padding: 0 16px 16px 16px;
183+
border-radius: 3px;
184+
overflow: auto;
185+
}
186+
187+
pre code {
188+
color: var(--vscode-editor-foreground);
189+
tab-size: 4;
190+
}
191+
192+
pre {
193+
background-color: var(--vscode-textCodeBlock-background);
194+
border: 1px solid var(--vscode-widget-border);
195+
}
196+
197+
/* These styles are used to render code diff with markdown-it rendered output */
198+
.hljs-addition {
199+
background-color: var(--vscode-diffEditor-insertedTextBackground, rgba(155, 185, 85, 0.2));
200+
color: var(--vscode-diffEditorOverview-insertedForeground, rgb(155, 185, 85));
201+
display: inline-block;
202+
width: 100%;
203+
margin: 0 -16px;
204+
padding: 0 16px;
205+
}
206+
207+
.hljs-deletion {
208+
background-color: var(--vscode-diffEditor-removedTextBackground, rgba(255, 0, 0, 0.2));
209+
color: var(--vscode-diffEditorOverview-removedForeground, rgb(255, 0, 0));
210+
display: inline-block;
211+
width: 100%;
212+
margin: 0 -16px;
213+
padding: 0 16px;
214+
}
215+
216+
.hljs-meta {
217+
background-color: var(--vscode-editorMarkerNavigationInfo-headerBackground);
218+
color: var(--vscode-editorOverviewRuler-selectionHighlightForeground);
219+
display: inline-block;
220+
width: 100%;
221+
margin: 0 -16px;
222+
padding: 8px 16px;
223+
}
224+
225+
input[type='submit'] {
226+
background-color: var(--vscode-button-background);
227+
border: none;
228+
color: var(--vscode-button-foreground);
229+
padding: 6px 14px;
230+
cursor: pointer;
231+
border-radius: 5%;
232+
}
233+
234+
input[type='submit']:hover {
235+
background-color: var(--vscode-button-hoverBackground);
236+
}
237+
238+
.flex-container {
239+
display: flex;
240+
flex-wrap: wrap;
241+
justify-content: space-between;
242+
}
243+
244+
.flex-container > div {
245+
flex: 33%;
246+
}
247+
248+
@media screen and (max-width: 900px) {
249+
.flex-container > div {
250+
flex: 50%;
251+
}
252+
}
253+
254+
@media screen and (max-width: 400px) {
255+
.flex-container {
256+
flex-direction: column;
257+
}
258+
}
259+
260+
hr {
261+
border: unset;
262+
height: unset;
263+
border-bottom: 1px solid var(--vscode-menu-separatorBackground);
264+
}
265+
266+
img.severity {
267+
height: 0.75em;
268+
}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

resources/images/severity-high.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)