Skip to content
Open
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
62 changes: 62 additions & 0 deletions linters/biome/test_data/biome_v2.5.6_basic_check.check.shot
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// trunk-upgrade-validation:RELEASE

exports[`Testing linter biome test basic_check 1`] = `
{
"issues": [
{
"code": "lint/correctness/noUnusedVariables",
"column": "7",
"file": "test_data/basic_check.in.ts",
"issueClass": "ISSUE_CLASS_EXISTING",
"level": "LEVEL_HIGH",
"line": "6",
"linter": "biome",
"message": "This variable foo is unused.",
"targetType": "typescript",
},
],
"lintActions": [
{
"command": "fmt",
"fileGroupName": "typescript",
"linter": "biome",
"paths": [
"test_data/basic_check.in.ts",
],
"verb": "TRUNK_VERB_FMT",
},
{
"command": "lint",
"fileGroupName": "typescript",
"linter": "biome",
"paths": [
"test_data/basic_check.in.ts",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "lint",
"fileGroupName": "typescript",
"linter": "biome",
"paths": [
"test_data/basic_check.in.ts",
],
"upstream": true,
"verb": "TRUNK_VERB_CHECK",
},
],
"taskFailures": [],
"unformattedFiles": [
{
"column": "1",
"file": "test_data/basic_check.in.ts",
"issueClass": "ISSUE_CLASS_UNFORMATTED",
"level": "LEVEL_HIGH",
"line": "1",
"linter": "biome",
"message": "Incorrect formatting, autoformat by running 'trunk fmt'",
},
],
}
`;
22 changes: 22 additions & 0 deletions linters/biome/test_data/biome_v2.5.6_basic_fmt.fmt.shot
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// trunk-upgrade-validation:RELEASE

exports[`Testing formatter biome test basic_fmt 1`] = `
"const foobar = () => {};
const barfoo = () => {};

enum Bar {
Baz,
}

const foo = (bar: Bar) => {
switch (bar) {
case Bar.Baz:
foobar();
barfoo();
break;
}
!foo ? null : 1;
};
"
`;
7 changes: 7 additions & 0 deletions linters/biome/test_data/biome_v2.5.6_basic_json.fmt.shot
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// trunk-upgrade-validation:RELEASE

exports[`Testing formatter biome test basic_json 1`] = `
"{ "a": "foo", "b": 1, "a": true }
"
`;
40 changes: 40 additions & 0 deletions linters/biome/test_data/biome_v2.5.6_gitignore_check.check.shot
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// trunk-upgrade-validation:RELEASE

exports[`Testing linter biome test gitignore_check 1`] = `
{
"issues": [],
"lintActions": [
{
"command": "fmt",
"fileGroupName": "typescript",
"linter": "biome",
"paths": [
"test_data/gitignore_check.in.ts",
],
"verb": "TRUNK_VERB_FMT",
},
{
"command": "lint",
"fileGroupName": "typescript",
"linter": "biome",
"paths": [
"test_data/gitignore_check.in.ts",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "lint",
"fileGroupName": "typescript",
"linter": "biome",
"paths": [
"test_data/gitignore_check.in.ts",
],
"upstream": true,
"verb": "TRUNK_VERB_CHECK",
},
],
"taskFailures": [],
"unformattedFiles": [],
}
`;
52 changes: 52 additions & 0 deletions linters/biome/test_data/biome_v2.5.6_warning_check.check.shot
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// trunk-upgrade-validation:RELEASE

exports[`Testing linter biome test warning_check 1`] = `
{
"issues": [
{
"code": "lint/style/noNonNullAssertion",
"column": "16",
"file": "test_data/warning_check.in.ts",
"issueClass": "ISSUE_CLASS_EXISTING",
"level": "LEVEL_HIGH",
"line": "5",
"linter": "biome",
"message": "Forbidden non-null assertion.",
"targetType": "typescript",
},
],
"lintActions": [
{
"command": "fmt",
"fileGroupName": "typescript",
"linter": "biome",
"paths": [
"test_data/warning_check.in.ts",
],
"verb": "TRUNK_VERB_FMT",
},
{
"command": "lint",
"fileGroupName": "typescript",
"linter": "biome",
"paths": [
"test_data/warning_check.in.ts",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "lint",
"fileGroupName": "typescript",
"linter": "biome",
"paths": [
"test_data/warning_check.in.ts",
],
"upstream": true,
"verb": "TRUNK_VERB_CHECK",
},
],
"taskFailures": [],
"unformattedFiles": [],
}
`;
44 changes: 44 additions & 0 deletions linters/buf/test_data/buf_breaking_v1.72.0_basic.check.shot
Original file line number Diff line number Diff line change
@@ -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": [],
}
`;
33 changes: 33 additions & 0 deletions linters/buf/test_data/buf_breaking_v1.72.0_dupFile.check.shot
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// 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": "\`HelloWorld\` declared multiple times",
"targetType": "proto",
},
],
"lintActions": [
{
"command": "lint",
"fileGroupName": "proto",
"linter": "buf-breaking",
"paths": [
".",
],
"verb": "TRUNK_VERB_CHECK",
},
],
"taskFailures": [],
"unformattedFiles": [],
}
`;
14 changes: 14 additions & 0 deletions linters/buf/test_data/buf_format_v1.72.0_buf_lint.fmt.shot
Original file line number Diff line number Diff line change
@@ -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;
}
"
`;
92 changes: 92 additions & 0 deletions linters/buf/test_data/buf_lint_v1.72.0_buf_lint.check.shot
Original file line number Diff line number Diff line change
@@ -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": [],
}
`;
Loading
Loading