From 719ba980e8a27da954b0753048e9a0ff07af5426 Mon Sep 17 00:00:00 2001 From: TylerJang27 <42743566+TylerJang27@users.noreply.github.com> Date: Wed, 24 Apr 2024 19:24:09 +0000 Subject: [PATCH] Auto add snapshots --- .../test_data/mypy_v1.10.0_CUSTOM.check.shot | 178 ++++++++++++++++++ .../test_data/regal_v0.21.1_basic.check.shot | 76 ++++++++ .../trufflehog_git_v3.74.0_CUSTOM.check.shot | 43 +++++ .../trufflehog_v3.74.0_buff_size.check.shot | 31 +++ .../trufflehog_v3.74.0_secrets.check.shot | 43 +++++ ...lehog_v3.74.0_wrong_line_number.check.shot | 54 ++++++ 6 files changed, 425 insertions(+) create mode 100644 linters/mypy/test_data/mypy_v1.10.0_CUSTOM.check.shot create mode 100644 linters/regal/test_data/regal_v0.21.1_basic.check.shot create mode 100644 linters/trufflehog/test_data/trufflehog_git_v3.74.0_CUSTOM.check.shot create mode 100644 linters/trufflehog/test_data/trufflehog_v3.74.0_buff_size.check.shot create mode 100644 linters/trufflehog/test_data/trufflehog_v3.74.0_secrets.check.shot create mode 100644 linters/trufflehog/test_data/trufflehog_v3.74.0_wrong_line_number.check.shot diff --git a/linters/mypy/test_data/mypy_v1.10.0_CUSTOM.check.shot b/linters/mypy/test_data/mypy_v1.10.0_CUSTOM.check.shot new file mode 100644 index 000000000..4b2e0c3b7 --- /dev/null +++ b/linters/mypy/test_data/mypy_v1.10.0_CUSTOM.check.shot @@ -0,0 +1,178 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter mypy test CUSTOM 1`] = ` +{ + "issues": [ + { + "code": "import-untyped", + "column": "1", + "file": "test_data/basic.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://mypy.readthedocs.io/en/stable/error_code_list.html", + "level": "LEVEL_HIGH", + "line": "1", + "linter": "mypy", + "message": "Library stubs not installed for "google.protobuf"", + "targetType": "python", + }, + { + "code": "import-untyped", + "column": "1", + "file": "test_data/basic.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://mypy.readthedocs.io/en/stable/error_code_list.html", + "level": "LEVEL_HIGH", + "line": "1", + "linter": "mypy", + "message": "Library stubs not installed for "google.protobuf.descriptor_pb2"", + "targetType": "python", + }, + { + "code": "note", + "column": "1", + "file": "test_data/basic.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://mypy.readthedocs.io/en/stable/error_code_list.html", + "level": "LEVEL_HIGH", + "line": "1", + "linter": "mypy", + "message": "Hint: "python3 -m pip install types-protobuf". (or run "mypy --install-types" to install all missing stub packages). See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports", + "targetType": "python", + }, + { + "code": "arg-type", + "column": "10", + "file": "test_data/basic.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://mypy.readthedocs.io/en/stable/error_code_list.html", + "level": "LEVEL_HIGH", + "line": "13", + "linter": "mypy", + "message": "Argument 1 to "greeting" has incompatible type "int"; expected "str"", + "targetType": "python", + }, + { + "code": "arg-type", + "column": "10", + "file": "test_data/basic.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://mypy.readthedocs.io/en/stable/error_code_list.html", + "level": "LEVEL_HIGH", + "line": "14", + "linter": "mypy", + "message": "Argument 1 to "greeting" has incompatible type "bytes"; expected "str"", + "targetType": "python", + }, + { + "code": "func-returns-value", + "column": "5", + "file": "test_data/basic.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://mypy.readthedocs.io/en/stable/error_code_list.html", + "level": "LEVEL_HIGH", + "line": "15", + "linter": "mypy", + "message": ""printer" does not return a value (it only ever returns None)", + "targetType": "python", + }, + { + "code": "assignment", + "column": "10", + "file": "test_data/basic.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://mypy.readthedocs.io/en/stable/error_code_list.html", + "level": "LEVEL_HIGH", + "line": "16", + "linter": "mypy", + "message": "Incompatible types in assignment (expression has type "int", variable has type "str")", + "targetType": "python", + }, + { + "code": "attr-defined", + "column": "1", + "file": "test_data/basic.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://mypy.readthedocs.io/en/stable/error_code_list.html", + "level": "LEVEL_HIGH", + "line": "3", + "linter": "mypy", + "message": "Module "test_data" has no attribute "mypy_import2"", + "targetType": "python", + }, + { + "code": "return", + "column": "1", + "file": "test_data/source.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://mypy.readthedocs.io/en/stable/error_code_list.html", + "level": "LEVEL_HIGH", + "line": "8", + "linter": "mypy", + "message": "Missing return statement", + "targetType": "python", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "python", + "linter": "mypy", + "paths": [ + "test_data/__init__.py", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "python", + "linter": "mypy", + "paths": [ + "test_data/basic.py", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "python", + "linter": "mypy", + "paths": [ + "test_data/source.py", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "python", + "linter": "mypy", + "paths": [ + "test_data/__init__.py", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "python", + "linter": "mypy", + "paths": [ + "test_data/basic.py", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "python", + "linter": "mypy", + "paths": [ + "test_data/source.py", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/regal/test_data/regal_v0.21.1_basic.check.shot b/linters/regal/test_data/regal_v0.21.1_basic.check.shot new file mode 100644 index 000000000..f5f581cd8 --- /dev/null +++ b/linters/regal/test_data/regal_v0.21.1_basic.check.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter regal test basic 1`] = ` +{ + "issues": [ + { + "code": "opa-fmt", + "column": "1", + "file": "test_data/basic.in.rego", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "1", + "linter": "regal", + "message": "File should be formatted with \`opa fmt\`", + "targetType": "rego", + }, + { + "code": "prefer-snake-case", + "column": "1", + "file": "test_data/basic.in.rego", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "12", + "linter": "regal", + "message": "Prefer snake_case for names", + "targetType": "rego", + }, + { + "code": "non-raw-regex-pattern", + "column": "27", + "file": "test_data/basic.in.rego", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "12", + "linter": "regal", + "message": "Use raw strings for regex patterns", + "targetType": "rego", + }, + { + "code": "use-assignment-operator", + "column": "15", + "file": "test_data/basic.in.rego", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "5", + "linter": "regal", + "message": "Prefer := over = for assignment", + "targetType": "rego", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "rego", + "linter": "regal", + "paths": [ + "test_data/basic.in.rego", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "rego", + "linter": "regal", + "paths": [ + "test_data/basic.in.rego", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/trufflehog/test_data/trufflehog_git_v3.74.0_CUSTOM.check.shot b/linters/trufflehog/test_data/trufflehog_git_v3.74.0_CUSTOM.check.shot new file mode 100644 index 000000000..ef6b700b9 --- /dev/null +++ b/linters/trufflehog/test_data/trufflehog_git_v3.74.0_CUSTOM.check.shot @@ -0,0 +1,43 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter trufflehog-git test CUSTOM 1`] = ` +{ + "issues": [ + { + "code": "URI", + "file": ".", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_NEW", + "level": "LEVEL_HIGH", + "linter": "trufflehog-git", + "message": "secrets.in.py:8: Secret detected: https://admin:********@the-internet.herokuapp.com on commit (file since deleted)", + "targetType": "ALL", + }, + { + "code": "URI", + "file": "secrets2.in.py", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_NEW", + "level": "LEVEL_HIGH", + "line": "8", + "linter": "trufflehog-git", + "message": "Secret detected: https://admin:********@the-internet.herokuapp.com on commit ", + "targetType": "ALL", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trufflehog-git", + "paths": [ + ".", + ], + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/trufflehog/test_data/trufflehog_v3.74.0_buff_size.check.shot b/linters/trufflehog/test_data/trufflehog_v3.74.0_buff_size.check.shot new file mode 100644 index 000000000..da6cc9615 --- /dev/null +++ b/linters/trufflehog/test_data/trufflehog_v3.74.0_buff_size.check.shot @@ -0,0 +1,31 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter trufflehog test buff_size 1`] = ` +{ + "issues": [], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trufflehog", + "paths": [ + "test_data/buff_size.in.cc", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trufflehog", + "paths": [ + "test_data/buff_size.in.cc", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/trufflehog/test_data/trufflehog_v3.74.0_secrets.check.shot b/linters/trufflehog/test_data/trufflehog_v3.74.0_secrets.check.shot new file mode 100644 index 000000000..76fde58b1 --- /dev/null +++ b/linters/trufflehog/test_data/trufflehog_v3.74.0_secrets.check.shot @@ -0,0 +1,43 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter trufflehog test secrets 1`] = ` +{ + "issues": [ + { + "code": "URI", + "file": "test_data/secrets.in.py", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "8", + "linter": "trufflehog", + "message": "Secret detected: https://admin:********@the-internet.herokuapp.com", + "targetType": "ALL", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trufflehog", + "paths": [ + "test_data/secrets.in.py", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trufflehog", + "paths": [ + "test_data/secrets.in.py", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/trufflehog/test_data/trufflehog_v3.74.0_wrong_line_number.check.shot b/linters/trufflehog/test_data/trufflehog_v3.74.0_wrong_line_number.check.shot new file mode 100644 index 000000000..97b99d614 --- /dev/null +++ b/linters/trufflehog/test_data/trufflehog_v3.74.0_wrong_line_number.check.shot @@ -0,0 +1,54 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter trufflehog test wrong_line_number 1`] = ` +{ + "issues": [ + { + "code": "URI", + "file": "test_data/wrong_line_number.in.ts", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "587", + "linter": "trufflehog", + "message": "Secret detected: https://admin:********@the-internet.herokuapp.com", + "targetType": "ALL", + }, + { + "code": "URI", + "file": "test_data/wrong_line_number.in.ts", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "592", + "linter": "trufflehog", + "message": "Secret detected: https://admin:********@the-internet.herokuapp.com", + "targetType": "ALL", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trufflehog", + "paths": [ + "test_data/wrong_line_number.in.ts", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trufflehog", + "paths": [ + "test_data/wrong_line_number.in.ts", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`;