Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Feature",
"description": "Security Scan: Auto-scan now supports JSX, TSX, Kotlin, Scala, and Shell files."
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ describe('securityScanLanguageContext', function () {
['javascript', true],
['typescript', true],
['jsx', false],
['javascriptreact', false],
['typescriptreact', false],
['javascriptreact', true],
['typescriptreact', true],
['tsx', false],
['csharp', true],
['python', true],
['c', true],
['cpp', true],
['go', true],
['kotlin', false],
['kotlin', true],
['php', true],
['ruby', true],
['rust', false],
['scala', false],
['shellscript', false],
['scala', true],
['shellscript', true],
['sql', false],
['json', true],
['yaml', true],
Expand Down Expand Up @@ -92,7 +92,9 @@ describe('securityScanLanguageContext', function () {
['java', 'java'],
['python', 'python'],
['javascript', 'javascript'],
['javascriptreact', 'javascript'],
['typescript', 'typescript'],
['typescriptreact', 'typescript'],
['csharp', 'csharp'],
['go', 'go'],
['ruby', 'ruby'],
Expand All @@ -112,6 +114,9 @@ describe('securityScanLanguageContext', function () {
['java-properties', 'plaintext'],
['go.mod', 'plaintext'],
['go.sum', 'plaintext'],
['kotlin', 'kotlin'],
['scala', 'scala'],
['shellscript', 'shell'],
]

for (const [securityScanLanguageId, expectedCwsprLanguageId] of securityScanLanguageIds) {
Expand Down
7 changes: 7 additions & 0 deletions packages/core/src/codewhisperer/models/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ export const securityScanLanguageIds = [
'java',
'python',
'javascript',
'javascriptreact',
'typescript',
'typescriptreact',
'csharp',
'go',
'ruby',
Expand All @@ -286,6 +288,11 @@ export const securityScanLanguageIds = [
'java-properties',
'go.mod',
'go.sum',
'kotlin',
'scala',
'sh',
'shell',
'shellscript',
] as const

export type SecurityScanLanguageId = (typeof securityScanLanguageIds)[number]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export class SecurityScanLanguageContext {
java: 'java',
python: 'python',
javascript: 'javascript',
javascriptreact: 'javascript',
typescript: 'typescript',
typescriptreact: 'typescript',
csharp: 'csharp',
go: 'go',
golang: 'go',
Expand All @@ -40,6 +42,11 @@ export class SecurityScanLanguageContext {
'java-properties': 'plaintext',
'go.mod': 'plaintext',
'go.sum': 'plaintext',
kotlin: 'kotlin',
scala: 'scala',
sh: 'shell',
shell: 'shell',
shellscript: 'shell',
})
}

Expand Down
Loading