-
Notifications
You must be signed in to change notification settings - Fork 3
Test 129 test language #518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ambhrin-slalom
wants to merge
5
commits into
main
Choose a base branch
from
test-129-test-language
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d8b0880
Add test data and excluded that from secureli scan
ambhrin-slalom 85f418a
WIP-partial-test
ambhrin-slalom fe8cfd8
added test code to cover all languages
ambhrin-slalom 4818b2f
test repos
ambhrin-slalom 5b5e9a1
complete test
ambhrin-slalom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,136 @@ | ||
| # See https://pre-commit.com for more information | ||
| # See https://pre-commit.com/hooks.html for more hooks | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.5.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| - id: check-added-large-files | ||
| - repo: https://github.com/psf/black-pre-commit-mirror | ||
| rev: 24.3.0 | ||
| hooks: | ||
| - id: black | ||
| - repo: https://github.com/yelp/detect-secrets | ||
| rev: v1.4.0 | ||
| hooks: | ||
| - id: detect-secrets | ||
| - hooks: | ||
| - id: python-use-type-annotations | ||
| repo: https://github.com/pre-commit/pygrep-hooks | ||
| rev: v1.10.0 | ||
| - hooks: | ||
| - args: | ||
| - --exclude | ||
| - tests/ | ||
| - --severity-level | ||
| - medium | ||
| id: bandit | ||
| repo: https://github.com/PyCQA/bandit | ||
| rev: 1.7.8 | ||
| - hooks: | ||
| - id: black | ||
| repo: https://github.com/psf/black | ||
| rev: 24.3.0 | ||
| - hooks: | ||
| - entry: dotnet format --include | ||
| id: dotnet-format | ||
| language: system | ||
| name: dotnet-format | ||
| types: | ||
| - c# | ||
| repo: local | ||
| - hooks: | ||
| - id: golangci-lint | ||
| repo: https://github.com/golangci/golangci-lint | ||
| rev: v1.57.2 | ||
| - hooks: | ||
| - additional_dependencies: | ||
| - eslint@8.42.0 | ||
| - eslint-plugin-prettier@4.2.1 | ||
| args: | ||
| - --config | ||
| - javascript.eslintrc.yaml | ||
| - --fix | ||
| files: \.[j]sx?$ | ||
| id: eslint | ||
| types: | ||
| - file | ||
| repo: https://github.com/pre-commit/mirrors-eslint | ||
| rev: v9.0.0 | ||
| - hooks: | ||
| - args: | ||
| - --single-quote | ||
| - --trailing-comma | ||
| - all | ||
| id: prettier | ||
| types_or: | ||
| - css | ||
| - javascript | ||
| repo: https://github.com/pre-commit/mirrors-prettier | ||
| rev: v4.0.0-alpha.8 | ||
| - hooks: | ||
| - id: detekt | ||
| repo: https://github.com/quwac/pre-commit-detekt | ||
| rev: v1.23.4 | ||
| - hooks: | ||
| - args: | ||
| - --autofix | ||
| id: pretty-format-kotlin | ||
| repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks | ||
| rev: v2.13.0 | ||
| - hooks: | ||
| - exclude: .xcscheme$ | ||
| id: detect-secrets | ||
| repo: https://github.com/Yelp/detect-secrets | ||
| rev: v1.4.0 | ||
| - hooks: | ||
| - id: swiftlint | ||
| repo: https://github.com/realm/SwiftLint | ||
| rev: 0.54.0 | ||
| - hooks: | ||
| - id: detect-secrets | ||
| repo: https://github.com/Yelp/detect-secrets | ||
| rev: v1.4.0 | ||
| - hooks: | ||
| - id: terraform_tflint | ||
| repo: https://github.com/antonbabenko/pre-commit-terraform | ||
| rev: v1.88.4 | ||
| - hooks: | ||
| - additional_dependencies: | ||
| - eslint@8.42.0 | ||
| - '@typescript-eslint/eslint-plugin@5.59.11' | ||
| - '@typescript-eslint/parser@5.59.11' | ||
| - typescript@5.1.3 | ||
| - eslint-config-prettier@8.8.0 | ||
| - eslint-plugin-prettier@4.2.1 | ||
| args: | ||
| - --config | ||
| - typescript.eslintrc.yaml | ||
| - --fix | ||
| files: \.[t]sx?$ | ||
| id: eslint | ||
| types: | ||
| - file | ||
| repo: https://github.com/pre-commit/mirrors-eslint | ||
| rev: v9.0.0 | ||
| - hooks: | ||
| - args: | ||
| - --single-quote | ||
| - --trailing-comma | ||
| - all | ||
| id: prettier | ||
| repo: https://github.com/pre-commit/mirrors-prettier | ||
| rev: v4.0.0-alpha.8 | ||
| - hooks: | ||
| - id: check-added-large-files | ||
| - id: check-ast | ||
| - id: check-docstring-first | ||
| - id: check-executables-have-shebangs | ||
| - id: check-shebang-scripts-are-executable | ||
| - id: check-merge-conflict | ||
| - id: check-toml | ||
| - id: check-json | ||
| - id: check-xml | ||
| - id: check-yaml | ||
| - id: debug-statements | ||
| - args: | ||
| - --allow-missing-credentials | ||
| id: detect-aws-credentials | ||
| - id: detect-private-key | ||
| - args: | ||
| - --pytest-test-first | ||
| id: name-tests-test | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.6.0 | ||
| - hooks: | ||
| - id: detect-secrets | ||
| repo: https://github.com/Yelp/detect-secrets | ||
| rev: v1.4.0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Resources: | ||
| HelloWorld: | ||
| Type: AWS::S3::Bucket | ||
| Properties: | ||
| BucketName: "hello-world-bucket" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| using System; | ||
|
|
||
| class Program | ||
| { | ||
| static void Main(string[] args) | ||
| { | ||
| Console.WriteLine("Hello, World!"); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package main | ||
|
|
||
| import "fmt" | ||
|
|
||
| func main() { | ||
| fmt.Println("Hello, world!") | ||
| } |
11 changes: 11 additions & 0 deletions
11
tests/end-to-end/test-data/JavaScript_Sample/public/index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>JavaScript_Sample</title> | ||
| </head> | ||
| <body> | ||
| <script src="index.js"></script> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| console.log("Hello, world!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| fun main() { println("Hello, world!") } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| print("Hello, world!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| print("Hello, world!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| output "hello_world" { value = "Hello, world!" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| console.log("Hello, world!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| setup() { | ||
| load "${BATS_LIBS_ROOT}/bats-support/load" | ||
| load "${BATS_LIBS_ROOT}/bats-assert/load" | ||
| } | ||
|
|
||
| @test "can detect C# language" { | ||
| #cd tests/end-to-end/test-data/Csharp_Sample/ | ||
| run python secureli/main.py init -ry | ||
| assert_output --partial '[seCureLI] The following language(s) support secrets detection: C#' | ||
| assert_output --partial '[seCureLI] - C#: 100%' | ||
| } | ||
|
|
||
| @test "can detect Go language" { | ||
| #cd tests/end-to-end/test-data/Go_Sample/ | ||
| run python secureli/main.py init -ry | ||
| assert_output --partial '[seCureLI] - Go: 100%' | ||
| assert_output --partial '[seCureLI] seCureLI has been installed successfully for the following language(s): Go.' | ||
| } | ||
|
|
||
| @test "can detect Javascript language" { | ||
| #cd tests/end-to-end/test-data/JavaScript_Sample/ | ||
| run python secureli/main.py init -ry | ||
| assert_output --partial '[seCureLI] - JavaScript: 100%' | ||
| assert_output --partial '[seCureLI] seCureLI has been installed successfully for the following language(s): JavaScript.' | ||
| } | ||
|
|
||
| @test "can detect Kotlin language" { | ||
| #cd tests/end-to-end/test-data/Kotlin_Sample/ | ||
| run python secureli/main.py init -ry | ||
| assert_output --partial '[seCureLI] - Kotlin: 100%' | ||
| assert_output --partial '[seCureLI] seCureLI has been installed successfully for the following language(s): Kotlin.' | ||
| } | ||
|
|
||
| @test "can detect Python language" { | ||
| #cd tests/end-to-end/test-data/Python_Sample/ | ||
| run python secureli/main.py init -ry | ||
| assert_output --partial '[seCureLI] - Python: 100%' | ||
| assert_output --partial '[seCureLI] seCureLI has been installed successfully for the following language(s): Python.' | ||
| } | ||
|
|
||
| @test "can detect Swift language" { | ||
| #cd tests/end-to-end/test-data/Swift_Sample/ | ||
| run python secureli/main.py init -ry | ||
| assert_output --partial '[seCureLI] seCureLI has been installed successfully for the following language(s): Swift.' | ||
| assert_output --partial '[seCureLI] - Swift: 100%' | ||
| } | ||
|
|
||
| @test "can detect Terraform language" { | ||
| #cd tests/end-to-end/test-data/Terraform_Sample/ | ||
| run python secureli/main.py init -ry | ||
| assert_output --partial '[seCureLI] - Terraform: 100%' | ||
| assert_output --partial '[seCureLI] seCureLI has been installed successfully for the following language(s): Terraform.' | ||
| } | ||
|
|
||
| @test "can detect Typescript language" { | ||
| #cd tests/end-to-end/test-data/Typescript_Sample/ | ||
| run python secureli/main.py init -ry | ||
| assert_output --partial '[seCureLI] - TypeScript: 100%' | ||
| assert_output --partial '[seCureLI] seCureLI has been installed successfully for the following language(s): TypeScript.cd ..' | ||
| } | ||
|
|
||
| @test "can detect Cloudformation language" { | ||
ambhrin-slalom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #cd tests/end-to-end/test-data/CloudFormation_Sample/ | ||
| run python secureli/main.py init -ry | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.