diff --git a/linters/cspell/test_data/cspell_v9.6.2_basic.check.shot b/linters/cspell/test_data/cspell_v9.6.2_basic.check.shot new file mode 100644 index 000000000..415f44616 --- /dev/null +++ b/linters/cspell/test_data/cspell_v9.6.2_basic.check.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter cspell test basic 1`] = ` +{ + "issues": [], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/basic_md.in.md", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/basic_py.in.py", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/basic_ts.in.ts", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/empty.in.txt", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/basic_md.in.md", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/basic_py.in.py", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/basic_ts.in.ts", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/empty.in.txt", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/cspell/test_data/cspell_v9.6.2_dictionary.check.shot b/linters/cspell/test_data/cspell_v9.6.2_dictionary.check.shot new file mode 100644 index 000000000..ea3d2014c --- /dev/null +++ b/linters/cspell/test_data/cspell_v9.6.2_dictionary.check.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter cspell test dictionary 1`] = ` +{ + "issues": [], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/basic_md.in.md", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/basic_py.in.py", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/basic_ts.in.ts", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/empty.in.txt", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/basic_md.in.md", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/basic_py.in.py", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/basic_ts.in.ts", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "cspell", + "paths": [ + "test_data/empty.in.txt", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/markdownlint-cli2/test_data/markdownlint_cli2_v0.20.0_basic.check.shot b/linters/markdownlint-cli2/test_data/markdownlint_cli2_v0.20.0_basic.check.shot new file mode 100644 index 000000000..bf011d69c --- /dev/null +++ b/linters/markdownlint-cli2/test_data/markdownlint_cli2_v0.20.0_basic.check.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter markdownlint-cli2 test basic 1`] = ` +{ + "issues": [ + { + "code": "error", + "column": "1", + "file": "test_data/basic.in.md", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#error", + "level": "LEVEL_HIGH", + "line": "3", + "linter": "markdownlint-cli2", + "message": "MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "This file fails some rules"]", + "targetType": "markdown", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "markdown", + "linter": "markdownlint-cli2", + "paths": [ + "test_data/basic.in.md", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "markdown", + "linter": "markdownlint-cli2", + "paths": [ + "test_data/basic.in.md", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/ruff/test_data/ruff_nbqa_v0.14.14_basic_nb.check.shot b/linters/ruff/test_data/ruff_nbqa_v0.14.14_basic_nb.check.shot new file mode 100644 index 000000000..12ddd491d --- /dev/null +++ b/linters/ruff/test_data/ruff_nbqa_v0.14.14_basic_nb.check.shot @@ -0,0 +1,50 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter ruff-nbqa test basic_nb 1`] = ` +{ + "issues": [ + { + "code": "error", + "file": "test_data/basic_nb.in.ipynb", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "linter": "ruff-nbqa", + "message": "F401 [*] \`os\` imported but unused + --> /tmp/plugins_/test_data/basic_nb.in.ipynb:2:8 + | +1 | # %%NBQA-CELL-SEP +2 | import os + | ^^ +3 | +4 | print("Hello World!") + | +help: Remove unused import: \`os\`", + "targetType": "jupyter", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "jupyter", + "linter": "ruff-nbqa", + "paths": [ + "test_data/basic_nb.in.ipynb", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "jupyter", + "linter": "ruff-nbqa", + "paths": [ + "test_data/basic_nb.in.ipynb", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/ruff/test_data/ruff_v0.14.14_basic.check.shot b/linters/ruff/test_data/ruff_v0.14.14_basic.check.shot new file mode 100644 index 000000000..43626df0b --- /dev/null +++ b/linters/ruff/test_data/ruff_v0.14.14_basic.check.shot @@ -0,0 +1,101 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter ruff test basic 1`] = ` +{ + "issues": [ + { + "code": "E402", + "column": "1", + "file": "test_data/basic.in.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.astral.sh/ruff/rules/#E402", + "level": "LEVEL_HIGH", + "line": "7", + "linter": "ruff", + "message": "Module level import not at top of file", + "ranges": [ + { + "filePath": "test_data/basic.in.py", + "length": "10", + "offset": "83", + }, + ], + "targetType": "python", + }, + { + "autofixOptions": [ + { + "message": "Remove unused import: \`sys\`", + "replacements": [ + { + "filePath": "test_data/basic.in.py", + "length": "11", + "offset": "83", + }, + ], + }, + ], + "code": "F401", + "column": "8", + "file": "test_data/basic.in.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.astral.sh/ruff/rules/#F401", + "level": "LEVEL_HIGH", + "line": "7", + "linter": "ruff", + "message": "\`sys\` imported but unused", + "ranges": [ + { + "filePath": "test_data/basic.in.py", + "length": "3", + "offset": "90", + }, + ], + "targetType": "python", + }, + { + "code": "E402", + "column": "1", + "file": "test_data/basic.in.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.astral.sh/ruff/rules/#E402", + "level": "LEVEL_HIGH", + "line": "9", + "linter": "ruff", + "message": "Module level import not at top of file", + "ranges": [ + { + "filePath": "test_data/basic.in.py", + "length": "11", + "offset": "120", + }, + ], + "targetType": "python", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "python", + "linter": "ruff", + "paths": [ + "test_data/basic.in.py", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "python", + "linter": "ruff", + "paths": [ + "test_data/basic.in.py", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/ruff/test_data/ruff_v0.14.14_basic_nb.check.shot b/linters/ruff/test_data/ruff_v0.14.14_basic_nb.check.shot new file mode 100644 index 000000000..6622660ab --- /dev/null +++ b/linters/ruff/test_data/ruff_v0.14.14_basic_nb.check.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter ruff test basic_nb 1`] = ` +{ + "issues": [ + { + "autofixOptions": [ + { + "message": "Remove unused import: \`os\`", + "replacements": [ + { + "filePath": "test_data/basic_nb.in.ipynb", + "length": "2", + }, + ], + }, + ], + "code": "F401", + "column": "1", + "file": "test_data/basic_nb.in.ipynb", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.astral.sh/ruff/rules/#F401", + "level": "LEVEL_HIGH", + "line": "1", + "linter": "ruff", + "message": "\`os\` imported but unused", + "targetType": "jupyter", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "jupyter", + "linter": "ruff", + "paths": [ + "test_data/basic_nb.in.ipynb", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "jupyter", + "linter": "ruff", + "paths": [ + "test_data/basic_nb.in.ipynb", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/ruff/test_data/ruff_v0.14.14_format.fmt.shot b/linters/ruff/test_data/ruff_v0.14.14_format.fmt.shot new file mode 100644 index 000000000..06ab53d44 --- /dev/null +++ b/linters/ruff/test_data/ruff_v0.14.14_format.fmt.shot @@ -0,0 +1,14 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing formatter ruff test format 1`] = ` +"# whitespace below vvv + +# A malindented comment +if __name__ == "__main__": + a = 4 + 1 + b = 2 * 7 + c = [1, 2, 3] + print(a / b) +" +`; diff --git a/linters/ruff/test_data/ruff_v0.14.14_interface.check.shot b/linters/ruff/test_data/ruff_v0.14.14_interface.check.shot new file mode 100644 index 000000000..85c96e44f --- /dev/null +++ b/linters/ruff/test_data/ruff_v0.14.14_interface.check.shot @@ -0,0 +1,209 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter ruff test interface 1`] = ` +{ + "issues": [ + { + "code": "F821", + "column": "2", + "file": "test_data/interface.in.pyi", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.astral.sh/ruff/rules/#F821", + "level": "LEVEL_HIGH", + "line": "11", + "linter": "ruff", + "message": "Undefined name \`overload\`", + "ranges": [ + { + "filePath": "test_data/interface.in.pyi", + "length": "8", + "offset": "170", + }, + ], + "targetType": "python-interface", + }, + { + "code": "F811", + "column": "5", + "file": "test_data/interface.in.pyi", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.astral.sh/ruff/rules/#F811", + "level": "LEVEL_HIGH", + "line": "12", + "linter": "ruff", + "message": "Redefinition of unused \`a\` from line 9: \`a\` redefined here", + "ranges": [ + { + "filePath": "test_data/interface.in.pyi", + "length": "1", + "offset": "183", + }, + ], + "targetType": "python-interface", + }, + { + "code": "F821", + "column": "2", + "file": "test_data/interface.in.pyi", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.astral.sh/ruff/rules/#F821", + "level": "LEVEL_HIGH", + "line": "14", + "linter": "ruff", + "message": "Undefined name \`overload\`", + "ranges": [ + { + "filePath": "test_data/interface.in.pyi", + "length": "8", + "offset": "202", + }, + ], + "targetType": "python-interface", + }, + { + "code": "F811", + "column": "5", + "file": "test_data/interface.in.pyi", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.astral.sh/ruff/rules/#F811", + "level": "LEVEL_HIGH", + "line": "15", + "linter": "ruff", + "message": "Redefinition of unused \`a\` from line 12: \`a\` redefined here", + "ranges": [ + { + "filePath": "test_data/interface.in.pyi", + "length": "1", + "offset": "215", + }, + ], + "targetType": "python-interface", + }, + { + "autofixOptions": [ + { + "message": "Remove unused import: \`json\`", + "replacements": [ + { + "filePath": "test_data/interface.in.pyi", + "length": "12", + "offset": "47", + }, + ], + }, + ], + "code": "F401", + "column": "8", + "file": "test_data/interface.in.pyi", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.astral.sh/ruff/rules/#F401", + "level": "LEVEL_HIGH", + "line": "2", + "linter": "ruff", + "message": "\`json\` imported but unused", + "ranges": [ + { + "filePath": "test_data/interface.in.pyi", + "length": "4", + "offset": "54", + }, + ], + "targetType": "python-interface", + }, + { + "code": "F821", + "column": "6", + "file": "test_data/interface.in.pyi", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.astral.sh/ruff/rules/#F821", + "level": "LEVEL_HIGH", + "line": "31", + "linter": "ruff", + "message": "Undefined name \`decorated\`", + "ranges": [ + { + "filePath": "test_data/interface.in.pyi", + "length": "9", + "offset": "479", + }, + ], + "targetType": "python-interface", + }, + { + "code": "F811", + "column": "1", + "file": "test_data/interface.in.pyi", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.astral.sh/ruff/rules/#F811", + "level": "LEVEL_HIGH", + "line": "37", + "linter": "ruff", + "message": "Redefinition of unused \`a\` from line 15: \`a\` redefined here", + "ranges": [ + { + "filePath": "test_data/interface.in.pyi", + "length": "1", + "offset": "548", + }, + ], + "targetType": "python-interface", + }, + { + "autofixOptions": [ + { + "message": "Remove unused import: \`typing.Sequence\`", + "replacements": [ + { + "filePath": "test_data/interface.in.pyi", + "length": "32", + "offset": "60", + "replacementText": "from typing import Any", + }, + ], + }, + ], + "code": "F401", + "column": "25", + "file": "test_data/interface.in.pyi", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.astral.sh/ruff/rules/#F401", + "level": "LEVEL_HIGH", + "line": "4", + "linter": "ruff", + "message": "\`typing.Sequence\` imported but unused", + "ranges": [ + { + "filePath": "test_data/interface.in.pyi", + "length": "8", + "offset": "84", + }, + ], + "targetType": "python-interface", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "python-interface", + "linter": "ruff", + "paths": [ + "test_data/interface.in.pyi", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "python-interface", + "linter": "ruff", + "paths": [ + "test_data/interface.in.pyi", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/ruff/test_data/ruff_v0.14.14_syntax.check.shot b/linters/ruff/test_data/ruff_v0.14.14_syntax.check.shot new file mode 100644 index 000000000..910835a5a --- /dev/null +++ b/linters/ruff/test_data/ruff_v0.14.14_syntax.check.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter ruff test syntax 1`] = ` +{ + "issues": [ + { + "code": "invalid-syntax", + "column": "1", + "file": "test_data/syntax.in.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://docs.astral.sh/ruff/rules/#invalid-syntax", + "level": "LEVEL_HIGH", + "line": "2", + "linter": "ruff", + "message": "unexpected EOF while parsing", + "targetType": "python", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "python", + "linter": "ruff", + "paths": [ + "test_data/syntax.in.py", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "python", + "linter": "ruff", + "paths": [ + "test_data/syntax.in.py", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`;