diff --git a/linters/buf/test_data/buf_breaking_v1.32.0_basic.check.shot b/linters/buf/test_data/buf_breaking_v1.32.0_basic.check.shot new file mode 100644 index 000000000..91b5e3bc0 --- /dev/null +++ b/linters/buf/test_data/buf_breaking_v1.32.0_basic.check.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter buf-breaking test basic 1`] = ` +{ + "issues": [ + { + "code": "FIELD_NO_DELETE", + "column": "5", + "file": "test_data/buf_breaking.in.proto", + "issueUrl": "https://docs.buf.build/breaking/rules#field_no_delete", + "level": "LEVEL_HIGH", + "line": "7", + "linter": "buf-breaking", + "message": "Previously present field "2" with name "world" on message "HelloWorld" was deleted.", + "targetType": "proto", + }, + { + "code": "FIELD_SAME_TYPE", + "column": "7", + "file": "test_data/buf_breaking.in.proto", + "issueUrl": "https://docs.buf.build/breaking/rules#field_same_type", + "level": "LEVEL_HIGH", + "line": "8", + "linter": "buf-breaking", + "message": "Field "1" with name "hello" on message "HelloWorld" changed type from "string" to "int32".", + "targetType": "proto", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "proto", + "linter": "buf-breaking", + "paths": [ + ".", + ], + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/buf/test_data/buf_breaking_v1.32.0_dupFile.check.shot b/linters/buf/test_data/buf_breaking_v1.32.0_dupFile.check.shot new file mode 100644 index 000000000..0a106332a --- /dev/null +++ b/linters/buf/test_data/buf_breaking_v1.32.0_dupFile.check.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter buf-breaking test dupFile 1`] = ` +{ + "issues": [ + { + "code": "COMPILE", + "column": "13", + "file": "test_data/buf_breaking.in.proto", + "issueUrl": "https://docs.buf.build/breaking/rules#compile", + "level": "LEVEL_HIGH", + "line": "7", + "linter": "buf-breaking", + "message": "symbol "trunk.HelloWorld" already defined at test_data/buf_breaking.in.proto:7:13", + "targetType": "proto", + }, + { + "code": "COMPILE", + "column": "13", + "file": "test_data/buf_breaking.in.proto", + "issueUrl": "https://docs.buf.build/breaking/rules#compile", + "level": "LEVEL_HIGH", + "line": "8", + "linter": "buf-breaking", + "message": "symbol "trunk.HelloWorld.hello" already defined at test_data/buf_breaking.in.proto:8:13", + "targetType": "proto", + }, + { + "code": "COMPILE", + "column": "13", + "file": "test_data/buf_breaking.in.proto", + "issueUrl": "https://docs.buf.build/breaking/rules#compile", + "level": "LEVEL_HIGH", + "line": "9", + "linter": "buf-breaking", + "message": "symbol "trunk.HelloWorld.world" already defined at test_data/buf_breaking.in.proto:9:13", + "targetType": "proto", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "proto", + "linter": "buf-breaking", + "paths": [ + ".", + ], + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/buf/test_data/buf_format_v1.32.0_buf_lint.fmt.shot b/linters/buf/test_data/buf_format_v1.32.0_buf_lint.fmt.shot new file mode 100644 index 000000000..1e403d81f --- /dev/null +++ b/linters/buf/test_data/buf_format_v1.32.0_buf_lint.fmt.shot @@ -0,0 +1,14 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing formatter buf-format test buf_lint 1`] = ` +"syntax = "proto3"; + +package trunk; + +enum GoodEnum { + lower_case_UNSPECIFIED = 0; + GOOD_ENUM_VALUE_1 = 1; +} +" +`; diff --git a/linters/buf/test_data/buf_lint_v1.32.0_buf_lint.check.shot b/linters/buf/test_data/buf_lint_v1.32.0_buf_lint.check.shot new file mode 100644 index 000000000..a9b747ee0 --- /dev/null +++ b/linters/buf/test_data/buf_lint_v1.32.0_buf_lint.check.shot @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter buf-lint test buf_lint 1`] = ` +{ + "issues": [ + { + "code": "FILE_LOWER_SNAKE_CASE", + "column": "1", + "file": "test_data/buf_lint.in.proto", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.buf.build/lint/rules#file_lower_snake_case", + "level": "LEVEL_HIGH", + "line": "1", + "linter": "buf-lint", + "message": "Filename "buf_lint.in.proto" should be lower_snake_case.proto, such as "buf_lint_in.proto".", + "targetType": "proto", + }, + { + "code": "PACKAGE_DIRECTORY_MATCH", + "column": "1", + "file": "test_data/buf_lint.in.proto", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.buf.build/lint/rules#package_directory_match", + "level": "LEVEL_HIGH", + "line": "4", + "linter": "buf-lint", + "message": "Files with package "trunk" must be within a directory "trunk" relative to root but were in directory "test_data".", + "targetType": "proto", + }, + { + "code": "PACKAGE_VERSION_SUFFIX", + "column": "1", + "file": "test_data/buf_lint.in.proto", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.buf.build/lint/rules#package_version_suffix", + "level": "LEVEL_HIGH", + "line": "4", + "linter": "buf-lint", + "message": "Package name "trunk" should be suffixed with a correctly formed version, such as "trunk.v1".", + "targetType": "proto", + }, + { + "code": "ENUM_VALUE_PREFIX", + "column": "3", + "file": "test_data/buf_lint.in.proto", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.buf.build/lint/rules#enum_value_prefix", + "level": "LEVEL_HIGH", + "line": "7", + "linter": "buf-lint", + "message": "Enum value name "lower_case_UNSPECIFIED" should be prefixed with "GOOD_ENUM_".", + "targetType": "proto", + }, + { + "code": "ENUM_VALUE_UPPER_SNAKE_CASE", + "column": "3", + "file": "test_data/buf_lint.in.proto", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.buf.build/lint/rules#enum_value_upper_snake_case", + "level": "LEVEL_HIGH", + "line": "7", + "linter": "buf-lint", + "message": "Enum value name "lower_case_UNSPECIFIED" should be UPPER_SNAKE_CASE, such as "LOWER_CASE_UNSPECIFIED".", + "targetType": "proto", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "proto", + "linter": "buf-lint", + "paths": [ + "test_data/buf_lint.in.proto", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "proto", + "linter": "buf-lint", + "paths": [ + "test_data/buf_lint.in.proto", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`;