├── .devcontainer.json ├── .editorconfig ├── .git-blame-ignore-revs ├── .gitattributes ├── .github ├── actionlint.yaml ├── actions │ ├── action_tests │ │ └── action.yaml │ ├── linter_tests │ │ └── action.yaml │ └── tool_tests │ │ └── action.yaml ├── dependabot.yaml ├── filters.yaml ├── renovate.json5 └── workflows │ ├── annotate_pr.yaml │ ├── codeql.yml │ ├── nightly.yaml │ ├── pr.yaml │ ├── repo_tests.reusable.yaml │ ├── scorecard.yml │ ├── upgrade_trunk.yaml │ ├── upload_results.reusable.yaml │ └── windows_nightly.yaml ├── .gitignore ├── .trunk ├── .gitignore ├── setup-ci │ └── action.yaml └── trunk.yaml ├── .vscode ├── extensions.json └── settings.json ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── actions ├── buf │ ├── README.md │ └── plugin.yaml ├── commitizen │ ├── README.md │ ├── package.json │ └── plugin.yaml ├── commitlint │ ├── README.md │ ├── commitlint.test.ts │ ├── package.json │ └── plugin.yaml ├── git-blame-ignore-revs │ ├── README.md │ ├── plugin.yaml │ └── update_config.sh ├── git │ └── plugin.yaml ├── go-mod-tidy-vendor │ ├── README.md │ ├── go-mod-tidy-vendor.sh │ └── plugin.yaml ├── go-mod-tidy │ ├── README.md │ └── plugin.yaml ├── hello-world │ └── python │ │ ├── README.md │ │ ├── hello │ │ ├── hello_world.test.ts │ │ ├── plugin.yaml │ │ └── requirements.txt ├── npm-check-pre-push │ ├── npm_check.js │ ├── package.json │ └── plugin.yaml ├── npm-check │ ├── README.md │ ├── npm.png │ ├── npm_check.js │ ├── package.json │ └── plugin.yaml ├── poetry │ ├── README.md │ ├── plugin.yaml │ ├── poetry.test.ts │ └── requirements.txt ├── submodules │ └── plugin.yaml ├── terraform-docs │ ├── README.md │ ├── plugin.yaml │ └── terraform-docs.py ├── trunk │ └── plugin.yaml └── yarn-check │ ├── README.md │ ├── package.json │ ├── plugin.yaml │ ├── yarn.png │ └── yarn_check.js ├── eslint.config.cjs ├── jest.config.json ├── linters ├── actionlint │ ├── actionlint.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── actionlint_v1.6.21_CUSTOM.check.shot │ │ ├── actionlint_v1.6.26_CUSTOM.check.shot │ │ ├── actionlint_v1.6.9_CUSTOM.check.shot │ │ ├── bad.in.yaml │ │ └── empty.in.yaml ├── ansible-lint │ ├── README.md │ ├── ansible_lint.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── ansible_lint_v24.6.0_FQCN.check.shot │ │ ├── ansible_lint_v24.6.0_non_FQCN.check.shot │ │ ├── ansible_lint_v25.2.0_FQCN.check.shot │ │ ├── ansible_lint_v25.2.0_non_FQCN.check.shot │ │ ├── ansible_lint_v6.13.0_FQCN.check.shot │ │ ├── ansible_lint_v6.13.0_non_FQCN.check.shot │ │ └── jboss-standalone │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── demo-aws-launch.yml │ │ ├── deploy-application.yml │ │ ├── group_vars │ │ └── all │ │ ├── hosts │ │ ├── roles │ │ ├── java-app │ │ │ ├── files │ │ │ │ ├── jboss-helloworld.war │ │ │ │ └── ticket-monster.war │ │ │ └── tasks │ │ │ │ └── main.yml │ │ └── jboss-standalone │ │ │ ├── files │ │ │ └── jboss-as-standalone.sh │ │ │ ├── handlers │ │ │ └── main.yml │ │ │ ├── tasks │ │ │ └── main.yml │ │ │ └── templates │ │ │ ├── iptables-save │ │ │ └── standalone.xml │ │ └── site.yml ├── autopep8 │ ├── autopep8.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── autopep8_v2.0.4_basic.fmt.shot │ │ └── basic.in.py ├── bandit │ ├── bandit.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── bandit_v1.7.3_basic.check.shot │ │ └── basic.in.py ├── biome │ ├── biome.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic_check.in.ts │ │ ├── basic_fmt.in.ts │ │ ├── basic_json.in.json │ │ ├── biome_v1.9.4_basic_check.check.shot │ │ ├── biome_v1.9.4_basic_fmt.fmt.shot │ │ ├── biome_v1.9.4_basic_json.fmt.shot │ │ └── biome_v1.9.4_error.check.shot ├── black │ ├── black.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.py │ │ ├── basic_nb.in.ipynb │ │ ├── black_py_v22.3.0_basic.fmt.shot │ │ ├── black_v22.3.0_basic.fmt.shot │ │ └── black_v22.3.0_basic_nb.fmt.shot ├── brakeman │ ├── brakeman.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── Gemfile │ │ ├── Gemfile.lock │ │ ├── app │ │ ├── empty.rb │ │ └── helpers │ │ │ └── users_helper.rb │ │ └── brakeman_v5.4.0_CUSTOM.check.shot ├── buf │ ├── buf.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── buf_breaking.in.proto │ │ ├── buf_breaking_v1.32.0_basic.check.shot │ │ ├── buf_breaking_v1.32.0_dupFile.check.shot │ │ ├── buf_breaking_v1.5.0_basic.check.shot │ │ ├── buf_breaking_v1.5.0_dupFile.check.shot │ │ ├── buf_breaking_v1.9.0_basic.check.shot │ │ ├── buf_breaking_v1.9.0_dupFile.check.shot │ │ ├── buf_format_v1.17.0_buf_lint.fmt.shot │ │ ├── buf_format_v1.32.0_buf_lint.fmt.shot │ │ ├── buf_lint.in.proto │ │ ├── buf_lint_v1.17.0_buf_lint.check.shot │ │ └── buf_lint_v1.32.0_buf_lint.check.shot ├── buildifier │ ├── buildifier.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── add_tables.BUILD │ │ ├── basic.bzl │ │ ├── buildifier_v6.1.0_basic_check.check.shot │ │ ├── buildifier_v6.1.0_no_config.test_data.add_tables.BUILD.fmt.shot │ │ ├── buildifier_v6.1.0_no_config.test_data.basic.bzl.fmt.shot │ │ ├── buildifier_v6.1.0_with_config.test_data.add_tables.BUILD.fmt.shot │ │ ├── buildifier_v7.1.0_basic_check.check.shot │ │ ├── buildifier_v7.1.0_no_config.test_data.add_tables.BUILD.fmt.shot │ │ ├── buildifier_v7.1.0_no_config.test_data.basic.bzl.fmt.shot │ │ ├── buildifier_v7.1.0_with_config.test_data.add_tables.BUILD.fmt.shot │ │ ├── buildifier_v7.3.1_basic_check.check.shot │ │ ├── buildifier_v7.3.1_no_config.test_data.add_tables.BUILD.fmt.shot │ │ ├── buildifier_v7.3.1_no_config.test_data.basic.bzl.fmt.shot │ │ ├── buildifier_v7.3.1_with_config.test_data.add_tables.BUILD.fmt.shot │ │ ├── buildifier_v8.0.3_basic_check.check.shot │ │ ├── buildifier_v8.0.3_no_config.test_data.add_tables.BUILD.fmt.shot │ │ ├── buildifier_v8.0.3_no_config.test_data.basic.bzl.fmt.shot │ │ └── buildifier_v8.0.3_with_config.test_data.add_tables.BUILD.fmt.shot ├── cfnlint │ ├── cfnlint.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.yaml │ │ ├── cfnlint_v0.58.2_basic.check.shot │ │ ├── cfnlint_v1.3.0_basic.check.shot │ │ ├── cfnlint_v1.3.2_basic.check.shot │ │ └── cfnlint_v1.35.1_basic.check.shot ├── checkov │ ├── checkov.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.tf │ │ ├── basic_kubernetes.in.yaml │ │ ├── checkov_v2.3.259_basic.check.shot │ │ ├── checkov_v2.3.259_basic_kubernetes.check.shot │ │ ├── checkov_v2.3.264_basic.check.shot │ │ ├── checkov_v2.3.264_basic_kubernetes.check.shot │ │ ├── checkov_v2.3.75_basic.check.shot │ │ └── checkov_v2.3.75_basic_kubernetes.check.shot ├── circleci │ ├── circleci.test.ts │ ├── plugin.yaml │ ├── run.sh │ └── test_data │ │ ├── bad_version │ │ └── .circleci │ │ │ └── config.yml │ │ ├── basic │ │ └── .circleci │ │ │ └── config.yml │ │ ├── circleci_v0.1.28811_CUSTOM.check.shot │ │ └── malformed │ │ └── .circleci │ │ └── config.yml ├── clang-format │ ├── clang_format.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.hh │ │ ├── clang_format_v16.0.3_basic.fmt.shot │ │ ├── clang_format_v16.0.3_cuda.fmt.shot │ │ ├── clang_format_v16.0.3_proto.fmt.shot │ │ ├── cuda.in.cu │ │ └── proto.in.proto ├── clang-tidy │ ├── .clang-tidy │ ├── clang_tidy.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── .clang-tidy │ │ ├── a_includes.cc │ │ ├── b_includes.cc │ │ ├── basic.cc │ │ ├── clang_tidy_v16.0.3_default_config.check.shot │ │ ├── clang_tidy_v16.0.3_test_config.check.shot │ │ ├── compile_commands.json │ │ ├── invalid_case_style.hh │ │ └── test.hh ├── clippy │ ├── clippy.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── basic │ │ └── main.rs │ │ ├── clippy_v1.65.0_basic.check.shot │ │ ├── clippy_v1.65.0_complex.check.shot │ │ ├── clippy_v1.65.0_complex_subdir.check.shot │ │ ├── clippy_v1.65.0_malformed.check.shot │ │ ├── clippy_v1.65.0_malformed_subdir.check.shot │ │ ├── clippy_v1.65.0_manual_non_exhaustive.check.shot │ │ ├── clippy_v1.65.0_src.main.rs.check.shot │ │ ├── complex │ │ ├── high.rs │ │ ├── main.rs │ │ └── wont_compile.rs │ │ ├── complex_subdir │ │ └── src │ │ │ ├── high.rs │ │ │ ├── main.rs │ │ │ └── wont_compile.rs │ │ ├── malformed │ │ └── main.rs │ │ └── malformed_subdir │ │ └── src │ │ └── main.rs ├── cmake-format │ ├── cmake-format.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── cmake_format_v0.6.13_test1.fmt.shot │ │ ├── cmake_format_v0.6.13_test2.fmt.shot │ │ ├── test1.in.cmake │ │ └── test2.in.cmake ├── codespell │ ├── codespell.test.ts │ ├── codespell_to_sarif.py │ ├── plugin.yaml │ └── test_data │ │ ├── basic_md.in.md │ │ ├── basic_py.in.py │ │ ├── basic_ts.in.ts │ │ ├── codespell_v2.2.2_basic.check.shot │ │ ├── codespell_v2.2.2_dictionary.check.shot │ │ ├── codespell_v2.2.4_basic.check.shot │ │ ├── codespell_v2.2.4_dictionary.check.shot │ │ ├── codespell_v2.2.6_basic.check.shot │ │ ├── codespell_v2.2.6_dictionary.check.shot │ │ ├── codespell_v2.3.0_basic.check.shot │ │ ├── codespell_v2.3.0_dictionary.check.shot │ │ └── empty.in.txt ├── cspell │ ├── cspell.test.ts │ ├── cspell.yaml │ ├── expected_basic_issues.json │ ├── expected_dictionary_issues.json │ ├── plugin.yaml │ └── test_data │ │ ├── basic_md.in.md │ │ ├── basic_py.in.py │ │ ├── basic_ts.in.ts │ │ ├── cspell_v7.0.0_basic.check.shot │ │ ├── cspell_v7.0.0_dictionary.check.shot │ │ └── empty.in.txt ├── cue-fmt │ ├── cue_fmt.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.cue │ │ └── cue_fmt_v0.5.0_basic.fmt.shot ├── dart │ ├── dart.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── analysis_options.yaml │ │ ├── basic.in.dart │ │ ├── dart_v3.2.6_basic.check.shot │ │ ├── dart_v3.2.6_test_data.basic.in.dart.check.shot │ │ └── pubspec.yaml ├── deno │ ├── deno.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.js │ │ └── deno_v1.36.4_basic.fmt.shot ├── detekt │ ├── detekt.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic_detekt.in.kt │ │ ├── basic_explicit.in.kt │ │ ├── detekt_explicit_v1.19.0_basic_explicit.check.shot │ │ ├── detekt_explicit_v1.21.0_basic_explicit.check.shot │ │ ├── detekt_gradle │ │ ├── .gitignore │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── lib │ │ │ ├── build.gradle.kts │ │ │ ├── no-potential-bugs.detekt.yaml │ │ │ ├── potential-bugs.detekt.yaml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── kotlin │ │ │ │ └── detekt_gradle │ │ │ │ └── Library.kt │ │ └── settings.gradle.kts │ │ ├── detekt_gradle_CUSTOM.check.shot │ │ ├── detekt_v1.19.0_basic_detekt.check.shot │ │ └── detekt_v1.21.0_basic_detekt.check.shot ├── djlint │ ├── .djlintrc │ ├── README.md │ ├── djlint.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── djlint_v1.19.16_logout.check.shot │ │ ├── djlint_v1.19.16_logout.fmt.shot │ │ ├── djlint_v1.19.17_logout.check.shot │ │ ├── djlint_v1.19.17_logout.fmt.shot │ │ ├── djlint_v1.22.0_logout.check.shot │ │ ├── djlint_v1.22.0_logout.fmt.shot │ │ └── logout.in.html ├── dotenv-linter │ ├── dotenv_linter.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.env │ │ └── dotenv_linter_v3.3.0_basic.fmt.shot ├── dotnet-format │ ├── dotnet_format.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic │ │ ├── Program.cs │ │ ├── basic.csproj │ │ ├── basic.in.cs │ │ └── obj │ │ │ ├── Debug │ │ │ └── net7.0 │ │ │ │ ├── .NETCoreApp,Version=v7.0.AssemblyAttributes.cs │ │ │ │ ├── basic.AssemblyInfo.cs │ │ │ │ └── basic.GlobalUsings.g.cs │ │ │ └── basic.csproj.nuget.g.targets │ │ ├── dotnet_format_v7.0.400_CUSTOM.test_data.basic.Program.cs.fmt.shot │ │ ├── dotnet_format_v7.0.400_CUSTOM.test_data.basic.basic.in.cs.fmt.shot │ │ ├── dotnet_format_v7.0.400_CUSTOM.test_data.second_one.Program.cs.fmt.shot │ │ ├── example_solution.sln │ │ └── second_one │ │ ├── Program.cs │ │ └── second_one.csproj ├── dustilock │ ├── dustilock.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── dustilock_v1.2.0_CUSTOM.check.shot │ │ ├── package.json │ │ └── requirements.txt ├── eslint │ ├── README.md │ ├── eslint.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── .eslintrc.yaml │ │ ├── eof_autofix.ts │ │ ├── eslint.config.cjs │ │ ├── eslint_v8.10.0_CUSTOM.check.shot │ │ ├── eslint_v8.10.0_bad_install.check.shot │ │ ├── eslint_v8.10.0_test_data.eof_autofix.ts.check.shot │ │ ├── eslint_v8.10.0_test_data.format_imports.ts.check.shot │ │ ├── eslint_v8.10.0_test_data.non_ascii.ts.check.shot │ │ ├── eslint_v9.0.0_CUSTOM.check.shot │ │ ├── eslint_v9.0.0_bad_install.check.shot │ │ ├── eslint_v9.0.0_test_data.eof_autofix.ts.check.shot │ │ ├── eslint_v9.0.0_test_data.format_imports.ts.check.shot │ │ ├── eslint_v9.0.0_test_data.non_ascii.ts.check.shot │ │ ├── format_imports.ts │ │ ├── non_ascii.ts │ │ ├── null_rule_id.ts │ │ ├── package-lock-new.json │ │ ├── package-lock-old.json │ │ ├── package-new.json │ │ └── package-old.json ├── flake8 │ ├── .flake8 │ ├── flake8.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.py │ │ └── flake8_v4.0.1_basic.check.shot ├── git-diff-check │ ├── git_diff_check.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.txt │ │ ├── conflict.in.txt │ │ ├── git_diff_check_basic.check.shot │ │ └── git_diff_check_conflict.check.shot ├── gitleaks │ ├── gitleaks.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.py │ │ ├── gitleaks_v8.1.3_basic.check.shot │ │ ├── gitleaks_v8.21.2_basic.check.shot │ │ ├── gitleaks_v8.22.0_basic.check.shot │ │ └── gitleaks_v8.8.7_basic.check.shot ├── gofmt │ ├── gofmt.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.go │ │ ├── empty.in.go │ │ ├── gofmt_v1.20.4_basic.fmt.shot │ │ └── gofmt_v1.20.4_empty.check.shot ├── gofumpt │ ├── gofumpt.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.go │ │ ├── empty.in.go │ │ ├── gofumpt.in.go │ │ ├── gofumpt_v0.5.0_basic.fmt.shot │ │ ├── gofumpt_v0.5.0_empty.check.shot │ │ └── gofumpt_v0.5.0_gofumpt.fmt.shot ├── goimports │ ├── goimports.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.go │ │ ├── empty.in.go │ │ ├── goimports_v0.9.1_basic.fmt.shot │ │ └── goimports_v0.9.1_empty.check.shot ├── gokart │ ├── analyzers.yml │ ├── gokart.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── go.mod │ │ ├── gokart_v0.5.1_CUSTOM.check.shot │ │ ├── path_traversal │ │ └── path_traversal.in.go │ │ └── sql_injection │ │ └── sql_injection.in.go ├── golangci-lint │ ├── golangci_lint.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── .golangci.yml │ │ ├── .golangci2.yml │ │ ├── basic.go │ │ ├── go.mod │ │ ├── golangci_lint2_v2.0.0_all.check.shot │ │ ├── golangci_lint2_v2.0.0_empty.check.shot │ │ ├── golangci_lint2_v2.0.0_unbuildable.check.shot │ │ ├── golangci_lint_v1.49.0_all.check.shot │ │ ├── golangci_lint_v1.49.0_empty.check.shot │ │ ├── golangci_lint_v1.49.0_unbuildable.check.shot │ │ ├── golangci_lint_v1.57.0_all.check.shot │ │ ├── golangci_lint_v1.57.0_empty.check.shot │ │ ├── golangci_lint_v1.57.0_unbuildable.check.shot │ │ ├── golangci_lint_v1.63.4_all.check.shot │ │ ├── golangci_lint_v1.63.4_empty.check.shot │ │ ├── golangci_lint_v1.63.4_unbuildable.check.shot │ │ ├── golangci_lint_v1.64.4_all.check.shot │ │ ├── golangci_lint_v1.64.4_empty.check.shot │ │ ├── golangci_lint_v1.64.4_unbuildable.check.shot │ │ ├── unbuildable.go │ │ ├── unused_func.go │ │ └── wrapper │ │ ├── printer.go │ │ └── wrapper.go ├── golines │ ├── golines.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.go │ │ ├── empty.in.go │ │ ├── golines_v0.11.0_basic.fmt.shot │ │ └── golines_v0.11.0_empty.check.shot ├── google-java-format │ ├── google-java-format.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── c.in.java │ │ ├── e.in.java │ │ ├── google_java_format_v1.15.0_c.fmt.shot │ │ └── google_java_format_v1.15.0_e.fmt.shot ├── graphql-schema-linter │ ├── graphql_schema_linter.test.ts │ ├── parse.py │ ├── plugin.yaml │ └── test_data │ │ ├── comment.in.graphqls │ │ ├── graphql_schema_linter_v3.0.1_comment.check.shot │ │ ├── graphql_schema_linter_v3.0.1_invalid-ast.check.shot │ │ ├── graphql_schema_linter_v3.0.1_user.check.shot │ │ ├── invalid-ast.in.graphqls │ │ └── user.in.graphqls ├── hadolint │ ├── .hadolint.yaml │ ├── hadolint.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── Dockerfile │ │ ├── Dockerfile.empty │ │ ├── basic.Dockerfile │ │ ├── empty.Dockerfile │ │ ├── hadolint_v2.10.0_CUSTOM.check.shot │ │ ├── hadolint_v2.12.1-beta_CUSTOM.check.shot │ │ └── nested │ │ ├── Dockerfile.debug │ │ ├── dockerfile │ │ ├── not-dockerfile │ │ ├── prefix.Dockerfile │ │ └── prefix.Dockerfile.debug ├── haml-lint │ ├── haml_lint.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.haml │ │ ├── empty.haml │ │ └── haml_lint_v0.40.0_CUSTOM.check.shot ├── isort │ ├── .isort.cfg │ ├── isort.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.py │ │ └── isort_v5.9.3_basic.fmt.shot ├── iwyu │ ├── iwyu.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── a.hh │ │ ├── b.hh │ │ ├── c.hh │ │ ├── compile_commands.json │ │ ├── include_what_you_use_v0.20_CUSTOM.check.shot │ │ ├── include_what_you_use_v0.20_test_data.test.cc.check.shot │ │ └── test.cc ├── ktlint │ ├── ktlint.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.kt │ │ ├── complex.in.kt │ │ ├── ktlint_v0.43.2_basic.fmt.shot │ │ ├── ktlint_v0.43.2_complex.fmt.shot │ │ ├── ktlint_v0.43.2_utf8.fmt.shot │ │ ├── ktlint_v0.48.0_basic.fmt.shot │ │ ├── ktlint_v0.48.0_complex.fmt.shot │ │ ├── ktlint_v0.48.0_utf8.fmt.shot │ │ ├── ktlint_v1.0.0_basic.fmt.shot │ │ ├── ktlint_v1.0.0_complex.fmt.shot │ │ ├── ktlint_v1.0.0_utf8.fmt.shot │ │ └── utf8.in.kt ├── kube-linter │ ├── kube_linter.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.yaml │ │ ├── kube_linter_v0.6.4_basic.check.shot │ │ └── kube_linter_v0.7.2_basic.check.shot ├── markdown-link-check │ ├── markdown-link-check.test.ts │ ├── parse.py │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.md │ │ └── markdown_link_check_v3.11.2_basic.check.shot ├── markdown-table-prettify │ ├── markdown_table_prettify.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.md │ │ └── markdown_table_prettify_v3.6.0_basic.fmt.shot ├── markdownlint-cli2 │ ├── markdownlint.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── .markdownlint-cli2.jsonc │ │ ├── basic.in.md │ │ └── markdownlint_cli2_v0.14.0_basic.check.shot ├── markdownlint │ ├── .markdownlint.yaml │ ├── README.md │ ├── markdownlint.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.md │ │ └── markdownlint_v0.33.0_basic.check.shot ├── mypy │ ├── README.md │ ├── mypy.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── __init__.py │ │ ├── basic.py │ │ ├── mypy_v0.931_CUSTOM.check.shot │ │ ├── mypy_v0.990_CUSTOM.check.shot │ │ ├── mypy_v1.10.0_CUSTOM.check.shot │ │ ├── mypy_v1.13.0_CUSTOM.check.shot │ │ ├── mypy_v1.6.0_CUSTOM.check.shot │ │ ├── mypy_v1.7.0_CUSTOM.check.shot │ │ └── source.py ├── nancy │ ├── expected_issues.json │ ├── nancy.test.ts │ ├── parse.py │ ├── plugin.yaml │ ├── run.sh │ └── test_data │ │ ├── Gopkg.lock │ │ ├── Gopkg.toml │ │ ├── README.md │ │ ├── go.mod │ │ ├── go.sum │ │ ├── main.go │ │ └── nancy_v1.0.41_CUSTOM.check.shot ├── nixpkgs-fmt │ ├── nixpkgs_fmt.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── nixpkgs_fmt_v1.3.0_test.fmt.shot │ │ └── test.in.nix ├── opa │ ├── opa.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.rego │ │ ├── opa_v0.62.1_basic.fmt.shot │ │ └── opa_v1.0.0_basic.fmt.shot ├── osv-scanner │ ├── expected_issues.json │ ├── osv_scanner.test.ts │ ├── osv_to_sarif.py │ ├── plugin.yaml │ └── test_data │ │ ├── Cargo.lock │ │ ├── Gemfile.lock │ │ ├── bun.lock │ │ ├── composer.lock │ │ ├── go.mod │ │ ├── go.sum │ │ ├── osv_scanner_v1.3.6_CUSTOM.check.shot │ │ ├── osv_scanner_v2.0.1_CUSTOM.check.shot │ │ ├── requirements.txt │ │ └── yarn.lock ├── oxipng │ ├── oxipng.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── bad.png │ │ ├── empty.txt │ │ ├── good.png │ │ ├── oxipng_v7.0.0_basic.test_data.empty.txt.fmt.shot │ │ └── oxipng_v7.0.0_malformed.check.shot ├── perlcritic │ ├── .perlcriticrc │ ├── perlcritic.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.pl │ │ └── perlcritic_basic.check.shot ├── perltidy │ ├── .perltidyrc │ ├── perltidy.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.pl │ │ └── perltidy_basic.fmt.shot ├── php-cs-fixer │ ├── php-cs-fixer.test.ts │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.php │ │ └── php_cs_fixer_v3.54.0_basic.fmt.shot ├── phpstan │ ├── phpstan.test.ts │ ├── phpstan_parser.py │ ├── plugin.yaml │ └── test_data │ │ ├── basic.in.php │ │ └── phpstan_v2.0.3_basic.check.shot ├── plugin.yaml ├── pmd │ ├── plugin.yaml │ ├── pmd.test.ts │ └── test_data │ │ ├── apex.in.cls │ │ ├── hello.in.java │ │ ├── pmd_v6.55.0_CUSTOM.check.shot │ │ ├── pmd_v7.0.0_CUSTOM.check.shot │ │ └── pmd_v7.13.0_CUSTOM.check.shot ├── pragma-once │ ├── README.md │ ├── fix.sh │ ├── plugin.yaml │ ├── pragma_once.test.ts │ └── test_data │ │ ├── basic.in.hh │ │ └── pragma_once_basic.fmt.shot ├── pre-commit-hooks │ ├── README.md │ ├── plugin.yaml │ ├── pre_commit_hooks.test.ts │ └── test_data │ │ ├── end-of-file-fixer.in.txt │ │ └── pre_commit_hooks_v4.4.0_end-of-file-fixer.fmt.shot ├── prettier │ ├── plugin.yaml │ ├── prettier.test.ts │ ├── prettier_to_sarif.py │ └── test_data │ │ ├── basic.in.yaml │ │ ├── error.in.yaml │ │ ├── prettier_v2.6.2_basic.check.shot │ │ ├── prettier_v2.6.2_basic.fmt.shot │ │ ├── prettier_v2.6.2_error.check.shot │ │ └── prettier_v2.6.2_error.fmt.shot ├── prisma │ ├── plugin.yaml │ ├── prisma.test.ts │ └── test_data │ │ ├── prisma_v4.16.1_test0.fmt.shot │ │ └── test0.in.prisma ├── psscriptanalyzer │ ├── README.md │ ├── format.ps1 │ ├── lint.ps1 │ ├── plugin.yaml │ ├── psscriptanalyzer.test.ts │ └── test_data │ │ ├── check.in.ps1 │ │ ├── format.in.ps1 │ │ ├── psscriptanalyzer_v1.21.0_check.check.shot │ │ ├── psscriptanalyzer_v1.21.0_check_custom_settings.check.shot │ │ └── psscriptanalyzer_v1.21.0_format.fmt.shot ├── pylint │ ├── plugin.yaml │ ├── pylint.test.ts │ └── test_data │ │ ├── .pylintrc │ │ ├── basic.in.py │ │ ├── empty.in.py │ │ ├── pylint_v2.11.1_basic.check.shot │ │ ├── pylint_v2.11.1_config.check.shot │ │ ├── pylint_v2.11.1_empty.check.shot │ │ └── severity.py ├── pyright │ ├── plugin.yaml │ ├── pyright.test.ts │ ├── pyright_to_sarif.py │ └── test_data │ │ ├── basic.in.py │ │ ├── pyright_v1.1.304_basic.check.shot │ │ ├── pyright_v1.1.315_basic.check.shot │ │ ├── pyright_v1.1.321_basic.check.shot │ │ ├── pyright_v1.1.334_basic.check.shot │ │ ├── pyright_v1.1.348_basic.check.shot │ │ ├── pyright_v1.1.359_basic.check.shot │ │ └── pyright_v1.1.378_basic.check.shot ├── regal │ ├── plugin.yaml │ ├── regal.test.ts │ └── test_data │ │ ├── basic.in.rego │ │ ├── regal_v0.18.0_basic.check.shot │ │ ├── regal_v0.21.0_basic.check.shot │ │ ├── regal_v0.25.0_basic.check.shot │ │ ├── regal_v0.26.0_basic.check.shot │ │ └── regal_v0.28.0_basic.check.shot ├── remark-lint │ ├── .remarkrc.yaml │ ├── parse.py │ ├── plugin.yaml │ ├── remark_lint.test.ts │ └── test_data │ │ ├── basic.in.md │ │ ├── remark_lint_v11.0.0_basic.check.shot │ │ ├── remark_lint_v11.0.0_basic.fmt.shot │ │ ├── remark_lint_v12.0.0_basic.check.shot │ │ └── remark_lint_v12.0.0_basic.fmt.shot ├── renovate │ ├── parse.py │ ├── plugin.yaml │ ├── renovate.test.ts │ └── test_data │ │ ├── .renovaterc.json │ │ ├── renovate.json │ │ ├── renovate.json5 │ │ └── renovate_v34.122.0_CUSTOM.check.shot ├── rome │ ├── plugin.yaml │ ├── rome.test.ts │ └── test_data │ │ ├── basic_check.in.ts │ │ ├── basic_fmt.in.ts │ │ ├── rome_v10.0.1_basic_check.check.shot │ │ ├── rome_v10.0.1_basic_fmt.fmt.shot │ │ ├── rome_v11.0.0_basic_check.check.shot │ │ ├── rome_v11.0.0_basic_fmt.fmt.shot │ │ ├── rome_v12.0.0_basic_check.check.shot │ │ ├── rome_v12.0.0_basic_fmt.fmt.shot │ │ ├── rome_v12.1.0_basic_check.check.shot │ │ └── rome_v12.1.0_basic_fmt.fmt.shot ├── rubocop │ ├── plugin.yaml │ ├── rubocop.test.ts │ ├── rubocop_to_sarif.py │ └── test_data │ │ ├── basic.rb │ │ ├── rubocop_v1.39.0_basic.check.shot │ │ └── rubocop_v1.39.0_basic.test_data.basic.rb.fmt.shot ├── ruff │ ├── README.md │ ├── plugin.yaml │ ├── ruff.test.ts │ ├── ruff.toml │ ├── ruff_to_sarif.py │ └── test_data │ │ ├── basic.in.py │ │ ├── basic_nb.in.ipynb │ │ ├── format.in.py │ │ ├── interface.in.pyi │ │ ├── ruff_nbqa_v0.0.250_basic_nb.check.shot │ │ ├── ruff_nbqa_v0.1.0_basic_nb.check.shot │ │ ├── ruff_nbqa_v0.5.0_basic_nb.check.shot │ │ ├── ruff_nbqa_v0.9.2_basic_nb.check.shot │ │ ├── ruff_v0.0.250_basic.check.shot │ │ ├── ruff_v0.0.250_interface.check.shot │ │ ├── ruff_v0.1.0_basic.check.shot │ │ ├── ruff_v0.2.1_basic_nb.check.shot │ │ ├── ruff_v0.2.1_format.fmt.shot │ │ ├── ruff_v0.2.1_syntax.check.shot │ │ ├── ruff_v0.6.0_basic_nb.check.shot │ │ └── syntax.in.py ├── rufo │ ├── plugin.yaml │ ├── rufo.test.ts │ └── test_data │ │ ├── basic.rb │ │ ├── empty.rb │ │ ├── rufo_v0.13.0_basic.test_data.basic.rb.fmt.shot │ │ └── rufo_v0.13.0_empty.check.shot ├── rustfmt │ ├── .rustfmt.toml │ ├── plugin.yaml │ ├── rustfmt.test.ts │ └── test_data │ │ ├── basic.in.rs │ │ ├── empty.in.rs │ │ ├── rustfmt_v1.65.0_basic.fmt.shot │ │ └── rustfmt_v1.65.0_empty.check.shot ├── scalafmt │ ├── plugin.yaml │ ├── scalafmt.test.ts │ └── test_data │ │ ├── basic.in.scala │ │ ├── empty.in.scala │ │ ├── scalafmt_v3.4.3_basic.fmt.shot │ │ ├── scalafmt_v3.4.3_empty.check.shot │ │ ├── scalafmt_v3.9.1_basic.fmt.shot │ │ └── scalafmt_v3.9.1_empty.check.shot ├── semgrep │ ├── plugin.yaml │ ├── semgrep.test.ts │ └── test_data │ │ ├── basic.go │ │ ├── element.ts │ │ ├── empty_go.go │ │ ├── empty_js.js │ │ ├── empty_py.py │ │ ├── request.py │ │ └── semgrep_v1.33.2_CUSTOM.check.shot ├── shellcheck │ ├── .shellcheckrc │ ├── plugin.yaml │ ├── shellcheck.test.ts │ └── test_data │ │ ├── basic.in.sh │ │ ├── empty.in.sh │ │ ├── shellcheck_v0.8.0_basic.check.shot │ │ ├── shellcheck_v0.8.0_empty.check.shot │ │ ├── shellcheck_v0.8.0_unicode.check.shot │ │ ├── shellcheck_v0.9.0_basic.check.shot │ │ ├── shellcheck_v0.9.0_empty.check.shot │ │ ├── shellcheck_v0.9.0_unicode.check.shot │ │ └── unicode.in.sh ├── shfmt │ ├── plugin.yaml │ ├── shfmt.test.ts │ └── test_data │ │ ├── basic.in.sh │ │ ├── empty.in.sh │ │ ├── shfmt_v3.6.0_basic.check.shot │ │ ├── shfmt_v3.6.0_basic.fmt.shot │ │ └── shfmt_v3.6.0_empty.check.shot ├── snyk │ ├── plugin.yaml │ ├── snyk.test.ts │ └── test_data │ │ ├── java.in.java │ │ ├── js.in.js │ │ ├── snyk_v1.1295.0_java.check.shot │ │ └── snyk_v1.1295.0_js.check.shot ├── sort-package-json │ ├── plugin.yaml │ ├── sort_package_json.test.ts │ └── test_data │ │ ├── bad_package.json │ │ ├── package.json │ │ ├── sort_package_json_v2.1.0_CUSTOM.check.shot │ │ └── sort_package_json_v2.1.0_basic.test_data.package.json.fmt.shot ├── sourcery │ ├── README.md │ ├── plugin.yaml │ ├── sourcery.test.ts │ └── test_data │ │ ├── _plugin.yaml │ │ ├── basic.in.py │ │ └── sourcery_v1.37.0_CUSTOM.check.shot ├── sql-formatter │ ├── plugin.yaml │ ├── sql_formatter.test.ts │ └── test_data │ │ ├── basic.in.sql │ │ ├── empty.in.sql │ │ ├── sql_formatter_v7.0.1_basic.fmt.shot │ │ └── sql_formatter_v7.0.1_empty.check.shot ├── sqlfluff │ ├── .sqlfluff │ ├── plugin.yaml │ ├── sqlfluff.test.ts │ ├── sqlfluff_to_sarif.py │ └── test_data │ │ ├── bad.ddl │ │ ├── bad.sql │ │ ├── bad.sql.j2 │ │ ├── basic_check.in.sql │ │ ├── basic_fmt.in.sql │ │ ├── sqlfluff_v2.0.0_basic_check.check.shot │ │ ├── sqlfluff_v2.0.0_basic_check.fmt.shot │ │ ├── sqlfluff_v2.0.0_basic_fmt.fmt.shot │ │ ├── sqlfluff_v3.0.0_basic_check.check.shot │ │ ├── sqlfluff_v3.0.0_basic_check.fmt.shot │ │ └── sqlfluff_v3.0.0_basic_fmt.fmt.shot ├── sqlfmt │ ├── plugin.yaml │ ├── sqlfmt.test.ts │ └── test_data │ │ ├── basic.in.sql │ │ ├── empty.in.sql │ │ ├── sqlfmt_v0.16.0_basic.fmt.shot │ │ └── sqlfmt_v0.16.0_empty.fmt.shot ├── squawk │ ├── plugin.yaml │ ├── squawk.test.ts │ └── test_data │ │ ├── basic.in.sql │ │ ├── squawk_v1.4.0_basic.check.shot │ │ ├── squawk_v1.5.3_basic.check.shot │ │ ├── squawk_v2.4.0_basic.check.shot │ │ └── squawk_v2.8.0_basic.check.shot ├── standardrb │ ├── plugin.yaml │ ├── standardrb.test.ts │ └── test_data │ │ ├── basic.in.rb │ │ ├── standardrb_v1.3.0_basic.check.shot │ │ └── standardrb_v1.3.0_basic.fmt.shot ├── stringslint │ ├── plugin.yaml │ ├── stringslint.test.ts │ └── test_data │ │ ├── Localizable.strings │ │ ├── basic.swift │ │ └── stringslint_v0.1.1_CUSTOM.check.shot ├── stylelint │ ├── plugin.yaml │ ├── stylelint.test.ts │ └── test_data │ │ ├── basic.in.css │ │ ├── stylelint_v14.6.1_basic.check.shot │ │ ├── stylelint_v14.6.1_basic.fmt.shot │ │ ├── stylelint_v16.0.1_basic.check.shot │ │ └── stylelint_v16.0.1_basic.fmt.shot ├── stylua │ ├── plugin.yaml │ ├── stylua.test.ts │ ├── stylua.toml │ └── test_data │ │ ├── basic.in.lua │ │ ├── empty.in.lua │ │ ├── stylua_v0.17.0_basic.fmt.shot │ │ └── stylua_v0.17.0_empty.fmt.shot ├── svgo │ ├── plugin.yaml │ ├── svgo.config.mjs │ ├── svgo.test.ts │ └── test_data │ │ ├── basic.in.svg │ │ ├── svgo_v2.8.0_basic.fmt.shot │ │ └── svgo_v3.0.0_basic.fmt.shot ├── swiftformat │ ├── plugin.yaml │ ├── swiftformat.test.ts │ └── test_data │ │ ├── basic.swift │ │ └── swiftformat_v0.50.0_basic.test_data.basic.swift.fmt.shot ├── swiftlint │ ├── plugin.yaml │ ├── swiftlint.test.ts │ └── test_data │ │ ├── basic.swift │ │ ├── swiftlint_v0.49.1_basic.check.shot │ │ ├── swiftlint_v0.49.1_nested_configs.check.shot │ │ ├── swiftlint_v0.51.0_basic.check.shot │ │ ├── swiftlint_v0.51.0_nested_configs.check.shot │ │ ├── swiftlint_v0.55.0_basic.check.shot │ │ └── swiftlint_v0.55.0_nested_configs.check.shot ├── taplo │ ├── plugin.yaml │ ├── taplo.test.ts │ └── test_data │ │ ├── bad.toml │ │ ├── basic.toml │ │ ├── empty.toml │ │ ├── taplo_v0.8.0_CUSTOM.check.shot │ │ └── taplo_v0.8.0_test_data.basic.toml.check.shot ├── terraform │ ├── plugin.yaml │ ├── terraform.test.ts │ └── test_data │ │ ├── terraform_v1.1.0_variables.check.shot │ │ ├── terraform_v1.1.0_variables.fmt.shot │ │ └── variables.in.tf ├── terragrunt │ ├── plugin.yaml │ ├── terragrunt.test.ts │ └── test_data │ │ ├── terragrunt_v0.45.8_unformatted.fmt.shot │ │ └── unformatted.in.hcl ├── terrascan │ ├── plugin.yaml │ ├── sarif_to_sarif.py │ ├── terrascan.test.ts │ └── test_data │ │ ├── aws_db_instance_violation.in.tf │ │ ├── basic.in.dockerfile │ │ ├── terrascan_v1.18.1_aws_db_instance_violation.check.shot │ │ └── terrascan_v1.18.1_basic.check.shot ├── tflint │ ├── README.md │ ├── plugin.yaml │ ├── test_data │ │ ├── aws.tf │ │ ├── bad.tflint.hcl │ │ ├── tflint_v0.47.0_CUSTOM.check.shot │ │ └── tflint_v0.47.0_bad_config.check.shot │ └── tflint.test.ts ├── tfsec │ ├── parse.py │ ├── plugin.yaml │ ├── test_data │ │ ├── aws.in.tf │ │ ├── parse_error.in.tf │ │ └── tfsec_v1.28.1_basic.check.shot │ └── tfsec.test.ts ├── tofu │ ├── plugin.yaml │ ├── test_data │ │ ├── tofu_v1.6.2_variables.check.shot │ │ ├── tofu_v1.6.2_variables.fmt.shot │ │ └── variables.in.tf │ └── tofu.test.ts ├── trivy │ ├── README.md │ ├── config_expected_issues.json │ ├── plugin.yaml │ ├── test_data │ │ ├── Gemfile.lock │ │ ├── aws.tf │ │ ├── basic.Dockerfile │ │ ├── basic.yaml │ │ ├── go.mod │ │ ├── main.tf │ │ ├── nested │ │ │ └── requirements.txt │ │ ├── no_errors │ │ │ └── requirements.txt │ │ ├── requirements.txt │ │ ├── secrets.py │ │ ├── trivy_v0.44.1_config.check.shot │ │ ├── trivy_v0.44.1_fs-secret.check.shot │ │ └── trivy_v0.44.1_fs-vuln.check.shot │ ├── trivy.test.ts │ ├── trivy_config_to_sarif.py │ ├── trivy_fs_secret_to_sarif.py │ ├── trivy_fs_vuln_to_sarif.py │ └── vuln_expected_issues.json ├── trufflehog │ ├── plugin.yaml │ ├── test_data │ │ ├── buff_size.in.cc │ │ ├── secrets.in.py │ │ ├── trufflehog_git_v3.59.0_CUSTOM.check.shot │ │ ├── trufflehog_git_v3.68.0_CUSTOM.check.shot │ │ ├── trufflehog_git_v3.69.0_CUSTOM.check.shot │ │ ├── trufflehog_git_v3.88.3_CUSTOM.check.shot │ │ ├── trufflehog_v3.59.0_buff_size.check.shot │ │ ├── trufflehog_v3.59.0_secrets.check.shot │ │ ├── trufflehog_v3.59.0_wrong_line_number.check.shot │ │ ├── trufflehog_v3.68.0_buff_size.check.shot │ │ ├── trufflehog_v3.68.0_secrets.check.shot │ │ ├── trufflehog_v3.68.0_wrong_line_number.check.shot │ │ ├── trufflehog_v3.69.0_buff_size.check.shot │ │ ├── trufflehog_v3.69.0_secrets.check.shot │ │ ├── trufflehog_v3.69.0_wrong_line_number.check.shot │ │ ├── trufflehog_v3.88.3_buff_size.check.shot │ │ ├── trufflehog_v3.88.3_secrets.check.shot │ │ ├── trufflehog_v3.88.3_wrong_line_number.check.shot │ │ └── wrong_line_number.in.ts │ ├── trufflehog.test.ts │ └── trufflehog_to_sarif.py ├── trunk-toolbox │ ├── plugin.yaml │ ├── test_data │ │ ├── do_not_land.in.txt │ │ ├── trunk_toolbox_v0.2.0_do_not_land.check.shot │ │ ├── trunk_toolbox_v0.4.1_do_not_land.check.shot │ │ └── trunk_toolbox_v0.5.3_do_not_land.check.shot │ └── trunk_toolbox.test.ts ├── txtpbfmt │ ├── plugin.yaml │ ├── test_data │ │ ├── test0.in.textproto │ │ ├── test1.in.textpb │ │ ├── txtpbfmt_v0.0.0-20230412060525-fa9f017c0ded_test0.fmt.shot │ │ └── txtpbfmt_v0.0.0-20230412060525-fa9f017c0ded_test1.fmt.shot │ └── txtpbfmt.test.ts ├── ty │ ├── plugin.yaml │ ├── test_data │ │ ├── basic.in.py │ │ ├── interface.in.pyi │ │ ├── ty_v0.0.1-alpha.1_basic.check.shot │ │ └── ty_v0.0.1-alpha.1_interface.check.shot │ └── ty.test.ts ├── vale │ ├── .vale.ini │ ├── plugin.yaml │ ├── test_data │ │ ├── basic.in.md │ │ └── vale_v3.4.1_basic.check.shot │ └── vale.test.ts ├── yamllint │ ├── .yamllint.yaml │ ├── plugin.yaml │ ├── test_data │ │ ├── basic.in.yaml │ │ └── yamllint_v1.26.3_basic.check.shot │ └── yamllint.test.ts └── yapf │ ├── plugin.yaml │ ├── test_data │ ├── basic.in.py │ └── yapf_v0.32.0_basic.fmt.shot │ └── yapf.test.ts ├── package-lock.json ├── package.json ├── plugin.yaml ├── repo-tools ├── definition-checker │ └── check.ts ├── linter-test-helper │ ├── generate │ ├── linter_sample.test.ts │ ├── linter_sample_plugin.yaml │ └── requirements.txt └── tool-test-helper │ ├── generate │ ├── requirements.txt │ ├── tool_sample.test.ts │ └── tool_sample_plugin.yaml ├── runtimes ├── README.md ├── go │ └── plugin.yaml ├── java │ └── plugin.yaml ├── node │ └── plugin.yaml ├── php │ └── plugin.yaml ├── python │ └── plugin.yaml ├── ruby │ └── plugin.yaml └── rust │ └── plugin.yaml ├── security.md ├── tests ├── README.md ├── driver │ ├── action_driver.ts │ ├── driver.ts │ ├── index.ts │ ├── lint_driver.ts │ └── tool_driver.ts ├── index.ts ├── jest_setup.ts ├── parse │ └── index.ts ├── repo_tests │ ├── config_check.test.ts │ ├── readme_inclusion.test.ts │ └── valid_package_download.test.ts ├── reporter │ ├── index.js │ └── reporter.ts ├── types │ └── index.ts └── utils │ ├── index.ts │ ├── landing_state.ts │ └── trunk_config.ts ├── tools ├── 1password-cli │ ├── 1password_cli.test.ts │ └── plugin.yaml ├── act │ ├── act.test.ts │ └── plugin.yaml ├── action-validator │ ├── action_validator.test.ts │ └── plugin.yaml ├── adr │ ├── adr.test.ts │ └── plugin.yaml ├── age │ ├── age.test.ts │ └── plugin.yaml ├── agebox │ ├── agebox.test.ts │ └── plugin.yaml ├── air │ ├── air.test.ts │ └── plugin.yaml ├── alp │ ├── alp.test.ts │ └── plugin.yaml ├── amazon-ecr-credential-helper │ ├── amazon_ecr_credential_helper.test.ts │ └── plugin.yaml ├── asciinema │ ├── asciinema.test.ts │ └── plugin.yaml ├── assh │ ├── assh.test.ts │ └── plugin.yaml ├── aws-amplify │ ├── aws_amplify.test.ts │ └── plugin.yaml ├── awscli │ ├── awscli.test.ts │ └── plugin.yaml ├── bazel-differ │ ├── bazel.test.ts │ └── plugin.yaml ├── bazel │ ├── bazel.test.ts │ └── plugin.yaml ├── circleci │ ├── circleci.test.ts │ └── plugin.yaml ├── clangd-indexing-tools │ ├── clangd_indexing_tools.test.ts │ └── plugin.yaml ├── clangd │ ├── clangd.test.ts │ └── plugin.yaml ├── dbt-cli │ ├── dbt_cli.test.ts │ └── plugin.yaml ├── deno │ ├── deno.test.ts │ └── plugin.yaml ├── diff-so-fancy │ ├── diff_so_fancy.test.ts │ └── plugin.yaml ├── difft │ ├── difft.test.ts │ └── plugin.yaml ├── direnv │ ├── direnv.test.ts │ └── plugin.yaml ├── docker-credential-ecr-login │ ├── docker-credential-ecr-login.test.ts │ └── plugin.yaml ├── dotnet │ ├── dotnet.test.ts │ └── plugin.yaml ├── eksctl │ ├── eksctl.test.ts │ └── plugin.yaml ├── gh │ ├── gh.test.ts │ └── plugin.yaml ├── gk │ ├── gk.test.ts │ └── plugin.yaml ├── goreleaser │ ├── goreleaser.test.ts │ └── plugin.yaml ├── grpcui │ ├── grpcui.test.ts │ └── plugin.yaml ├── gt │ ├── gt.test.ts │ └── plugin.yaml ├── gulp │ ├── gulp.test.ts │ └── plugin.yaml ├── helm │ ├── helm.test.ts │ └── plugin.yaml ├── ibazel │ ├── ibazel.test.ts │ └── plugin.yaml ├── istioctl │ ├── istioctl.test.ts │ └── plugin.yaml ├── jq │ ├── jq.test.ts │ └── plugin.yaml ├── kubectl │ ├── kubectl.test.ts │ └── plugin.yaml ├── minikube │ ├── minikube.test.ts │ └── plugin.yaml ├── paratest │ ├── paratest.test.ts │ └── plugin.yaml ├── phpunit │ ├── phpunit.test.ts │ └── plugin.yaml ├── platformio │ ├── platformio.test.ts │ └── plugin.yaml ├── pnpm │ ├── plugin.yaml │ └── pnpm.test.ts ├── prisma │ ├── plugin.yaml │ └── prisma.test.ts ├── pwsh │ ├── plugin.yaml │ └── pwsh.test.ts ├── renovate │ ├── plugin.yaml │ └── renovate.test.ts ├── ripgrep │ ├── plugin.yaml │ └── ripgrep.test.ts ├── sentry-cli │ ├── plugin.yaml │ └── sentry_cli.test.ts ├── sfdx │ ├── plugin.yaml │ └── sfdx.test.ts ├── sourcery │ ├── plugin.yaml │ └── sourcery.test.ts ├── tailwindcss │ ├── plugin.yaml │ └── tailwindcss.test.ts ├── target-determinator │ ├── plugin.yaml │ └── target_determinator.test.ts ├── terraform-docs │ ├── plugin.yaml │ └── terraform_docs.test.ts ├── terraform-switcher │ ├── plugin.yaml │ └── terraform_switcher.test.ts ├── terraform │ ├── plugin.yaml │ └── terraform.test.ts ├── terraformer │ ├── plugin.yaml │ └── terraformer.test.ts ├── terramate │ ├── plugin.yaml │ └── terramate.test.ts ├── tfmigrate │ ├── plugin.yaml │ └── tfmigrate.test.ts ├── tfnotify │ ├── plugin.yaml │ └── tfnotify.test.ts ├── tfupdate │ ├── plugin.yaml │ └── tfupdate.test.ts ├── tofu │ ├── plugin.yaml │ └── tofu.test.ts ├── tree-sitter │ ├── plugin.yaml │ └── tree_sitter.test.ts ├── ts-node │ ├── plugin.yaml │ └── ts_node.test.ts ├── tsc │ ├── plugin.yaml │ └── tsc.test.ts ├── webpack │ ├── plugin.yaml │ └── webpack.test.ts ├── yarn │ ├── plugin.yaml │ └── yarn.test.ts └── yq │ ├── plugin.yaml │ └── yq.test.ts ├── trunk.ps1 └── tsconfig.json /.devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "image": "mcr.microsoft.com/devcontainers/typescript-node:0-18", 3 | "customizations": { 4 | "vscode": { 5 | "extensions": ["redhat.vscode-yaml"], 6 | "files.autoSave": "off" // we want to require explicit save - otherwise we overload the trunk extension 7 | } 8 | }, 9 | "features": { 10 | "git-lfs": "latest", 11 | "ghcr.io/trunk-io/devcontainer-feature/trunk": "latest" 12 | }, 13 | "onCreateCommand": "npm ci" 14 | } 15 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/.git-blame-ignore-revs -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | *.png binary -text -eol 3 | *.war binary -text -eol 4 | *.xml binary -text -eol 5 | *.bat binary -text -eol 6 | -------------------------------------------------------------------------------- /.github/actionlint.yaml: -------------------------------------------------------------------------------- 1 | self-hosted-runner: 2 | # Labels of self-hosted runner in array of strings. 3 | labels: 4 | - ubuntu-x64 5 | - macOS 6 | - ubuntu-latest 7 | # Configuration variables in array of strings defined in your repository or 8 | # organization. `null` means disabling configuration variables check. 9 | # Empty array means no configuration variable is allowed. 10 | config-variables: null 11 | -------------------------------------------------------------------------------- /.github/renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | $schema: "https://docs.renovatebot.com/renovate-schema.json", 3 | extends: ["config:base", "schedule:weekly"], 4 | updateNotScheduled: false, 5 | prConcurrentLimit: 3, 6 | ignorePaths: ["**/test_data/**"], 7 | packageRules: [ 8 | { 9 | groupName: "all non-major dependencies", 10 | groupSlug: "all-minor-patch", 11 | matchPackagePatterns: ["*"], 12 | matchUpdateTypes: ["minor", "patch"], 13 | labels: ["renovate"] 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Mac 2 | .DS_Store 3 | 4 | # Node 5 | node_modules/ 6 | 7 | # Typescript 8 | out/ 9 | 10 | junit.xml 11 | 12 | # Snyk 13 | .dccache 14 | -------------------------------------------------------------------------------- /.trunk/.gitignore: -------------------------------------------------------------------------------- 1 | *out 2 | *logs 3 | *actions 4 | *notifications 5 | *tools 6 | plugins 7 | user_trunk.yaml 8 | user.yaml 9 | tmp 10 | -------------------------------------------------------------------------------- /.trunk/setup-ci/action.yaml: -------------------------------------------------------------------------------- 1 | name: trunk-io/plugins setup for trunk check/upgrade 2 | description: Set up 3 | 4 | runs: 5 | using: composite 6 | steps: 7 | - name: Setup node 8 | uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2 9 | with: 10 | node-version: 18 11 | 12 | - name: Install dependencies 13 | run: npm ci 14 | shell: bash 15 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["redhat.vscode-yaml", "trunk.io"] 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.defaultFormatter": "trunk.io", 3 | "files.insertFinalNewline": true, 4 | "files.trimFinalNewlines": true, 5 | "files.trimTrailingWhitespace": true, 6 | "git.enableSmartCommit": true, 7 | "git.ignoreLimitWarning": true, 8 | "gitlens.advanced.fileHistoryFollowsRenames": true, 9 | "gitlens.codeLens.enabled": false, 10 | "terminal.integrated.scrollback": 100000, 11 | "workbench.list.horizontalScrolling": true 12 | } 13 | -------------------------------------------------------------------------------- /actions/buf/README.md: -------------------------------------------------------------------------------- 1 | # buf-gen 2 | 3 | Generates files from `.proto` files using [`buf`](https://buf.build) whenever protobuf files change. 4 | **Must** have a `buf.gen.yaml` and `buf.work.yaml` (if running from project root) 5 | -------------------------------------------------------------------------------- /actions/buf/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | actions: 3 | definitions: 4 | - id: buf-gen 5 | display_name: Buf generate 6 | description: 7 | Run 'buf generate' anytime a .proto file changes. Must have a buf.work.yaml to work properly 8 | run: buf generate 9 | triggers: 10 | - files: ["**/*.proto", buf.gen.yaml, buf.work.yaml] 11 | -------------------------------------------------------------------------------- /actions/commitizen/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@commitlint/cli": "^18.6.0", 4 | "@commitlint/config-conventional": "^18.6.0", 5 | "@commitlint/cz-commitlint": "^18.6.0", 6 | "commitizen": "^4.3.0", 7 | "inquirer": "^8.2.6" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /actions/commitlint/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@commitlint/cli": "^19.0", 4 | "@commitlint/config-conventional": "^19.0" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /actions/commitlint/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | actions: 3 | definitions: 4 | - id: commitlint 5 | display_name: Commitlint 6 | description: Enforce git commit message standards 7 | runtime: node 8 | packages_file: package.json 9 | run: commitlint --edit ${1} 10 | triggers: 11 | - git_hooks: [commit-msg] 12 | -------------------------------------------------------------------------------- /actions/git-blame-ignore-revs/README.md: -------------------------------------------------------------------------------- 1 | # git-blame-ignore-revs 2 | 3 | This action will automatically configure git blame to use the `.git-blame-ignore-revs` file while it 4 | exists. A typical use of this file is to run `trunk fmt -a` on a repository. Commit those changes, 5 | and then add the git commit sha256 to that file. This will cause `git blame` to skip that formatting 6 | commit when deciding who last changed each line. 7 | 8 | See also: https://git-scm.com/docs/git-blame#Documentation/git-blame.txt-blameignoreRevsFile 9 | -------------------------------------------------------------------------------- /actions/git-blame-ignore-revs/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | actions: 3 | definitions: 4 | - id: git-blame-ignore-revs 5 | display_name: Auto-enable .git-blame-ignore-revs 6 | description: Automatically configure git to use .git-blame-ignore-revs while the file exists 7 | run: bash ${cwd}/update_config.sh 8 | triggers: 9 | - files: [.git-blame-ignore-revs] 10 | - schedule: 24h 11 | -------------------------------------------------------------------------------- /actions/git/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | actions: 3 | definitions: 4 | - id: git-lfs 5 | display_name: Git LFS 6 | description: Git LFS hooks 7 | run: git lfs "${hook}" ${@} 8 | triggers: 9 | - git_hooks: [post-checkout, post-commit, post-merge, pre-push] 10 | environment: 11 | - name: SSH_AUTH_SOCK 12 | value: ${env.SSH_AUTH_SOCK} 13 | optional: true 14 | - name: SSH_AGENT_PID 15 | value: ${env.SSH_AGENT_PID} 16 | optional: true 17 | 18 | notify_on_error: false 19 | -------------------------------------------------------------------------------- /actions/go-mod-tidy-vendor/README.md: -------------------------------------------------------------------------------- 1 | # go-mod-tidy-vendor 2 | 3 | Run `go mod tidy` followed by `go mod vendor` whenever go.mod file is modified 4 | -------------------------------------------------------------------------------- /actions/go-mod-tidy-vendor/go-mod-tidy-vendor.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | go mod tidy && go mod vendor 3 | -------------------------------------------------------------------------------- /actions/go-mod-tidy-vendor/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | actions: 3 | definitions: 4 | - id: go-mod-tidy-vendor 5 | display_name: Go Mod Tidy & Vendor 6 | description: Runs go mod tidy followed by go mod vendor 7 | runtime: go 8 | run: bash ${plugin}/actions/go-mod-tidy-vendor/go-mod-tidy-vendor.sh 9 | triggers: 10 | - files: [go.mod] 11 | -------------------------------------------------------------------------------- /actions/go-mod-tidy/README.md: -------------------------------------------------------------------------------- 1 | # go-mod-tidy 2 | 3 | Run `go mod tidy` whenever go.mod file is modified 4 | -------------------------------------------------------------------------------- /actions/go-mod-tidy/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | actions: 3 | definitions: 4 | - id: go-mod-tidy 5 | display_name: Go Mod Tidy 6 | description: Runs go mod tidy when changes are detected to go.mod 7 | runtime: go 8 | run: go mod tidy 9 | triggers: 10 | - files: [go.mod] 11 | -------------------------------------------------------------------------------- /actions/hello-world/python/README.md: -------------------------------------------------------------------------------- 1 | # hello-world python 2 | 3 | To enable run `trunk actions enable hello-world-python` 4 | 5 | To run `trunk run hello-world-python` or `git commit` 6 | -------------------------------------------------------------------------------- /actions/hello-world/python/hello: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | from colorama import Fore 3 | 4 | print(Fore.BLUE + "Hello" + Fore.RED + " World") 5 | -------------------------------------------------------------------------------- /actions/hello-world/python/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | actions: 3 | definitions: 4 | - id: hello-world-python 5 | display_name: Hello World 6 | description: Prints 'Hello World' to the terminal during pre-commit trigger 7 | runtime: python 8 | packages_file: requirements.txt 9 | run: python3 ${cwd}/hello # {cwd} resolves to current directory containing this plugin.yaml file 10 | triggers: 11 | - git_hooks: [pre-commit] 12 | -------------------------------------------------------------------------------- /actions/hello-world/python/requirements.txt: -------------------------------------------------------------------------------- 1 | colorama==0.4.6 2 | -------------------------------------------------------------------------------- /actions/npm-check-pre-push/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "chalk": "4.1.2", 4 | "npm-check": "^6.0.1" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /actions/npm-check-pre-push/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | actions: 3 | definitions: 4 | - id: npm-check-pre-push 5 | display_name: NPM Check 6 | description: Generate notifications if node_modules are out of date as a pre-push hook 7 | runtime: node 8 | packages_file: package.json 9 | triggers: 10 | - git_hooks: [pre-push] 11 | run: node ${cwd}/npm_check.js 12 | environment: 13 | - name: NODE_PATH 14 | value: ${linter}/node_modules 15 | -------------------------------------------------------------------------------- /actions/npm-check/README.md: -------------------------------------------------------------------------------- 1 | # npm-check 2 | 3 | Monitors changes to `package.json` and `package-lock.json` to verify whether your npm install is 4 | up-to-date. Enable `npm-check`, and you'll never have to worry about out-of-date node_modules again! 5 | -------------------------------------------------------------------------------- /actions/npm-check/npm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/actions/npm-check/npm.png -------------------------------------------------------------------------------- /actions/npm-check/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "chalk": "4.1.2", 4 | "npm-check": "^6.0.1" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /actions/npm-check/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | actions: 3 | definitions: 4 | - id: npm-check 5 | display_name: NPM Check 6 | description: Generate notifications if node_modules are out of date 7 | runtime: node 8 | packages_file: package.json 9 | triggers: 10 | - schedule: 24h 11 | - files: [package.json, package-lock.json] 12 | run: node ${cwd}/npm_check.js 13 | output_type: notification_v1 14 | environment: 15 | - name: NODE_PATH 16 | value: ${linter}/node_modules 17 | -------------------------------------------------------------------------------- /actions/poetry/requirements.txt: -------------------------------------------------------------------------------- 1 | poetry==1.8.2 2 | poetry-plugin-export==1.7.1 3 | -------------------------------------------------------------------------------- /actions/submodules/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | actions: 3 | definitions: 4 | - id: submodule-init-update 5 | display_name: Submodule Init Update 6 | description: Git hook for updating submodules 7 | run: git submodule update --init --recursive 8 | triggers: 9 | - git_hooks: [post-checkout, post-merge, pre-rebase] 10 | notify_on_error: false 11 | -------------------------------------------------------------------------------- /actions/terraform-docs/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | actions: 3 | definitions: 4 | - id: terraform-docs 5 | display_name: Terraform Docs 6 | description: Generate documentation from Terraform modules in various output formats 7 | runtime: python 8 | triggers: 9 | - git_hooks: [pre-commit] 10 | run: python3 ${cwd}/terraform-docs.py 11 | -------------------------------------------------------------------------------- /actions/yarn-check/README.md: -------------------------------------------------------------------------------- 1 | # yarn-check 2 | 3 | Monitors changes to `package.json` and `yarn.lock` to verify whether your yarn install is 4 | up-to-date. Enable `yarn-check`, and you'll never have to worry about out-of-date node_modules 5 | again! 6 | -------------------------------------------------------------------------------- /actions/yarn-check/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "yarn-check": "^0.0.3" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /actions/yarn-check/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | actions: 3 | definitions: 4 | - id: yarn-check 5 | display_name: Yarn Check 6 | description: Generate notifications if node_modules are out of date 7 | runtime: node 8 | packages_file: package.json 9 | triggers: 10 | - schedule: 24h 11 | - files: [package.json, yarn.lock] 12 | run: node ${cwd}/yarn-check/yarn_check.js 13 | output_type: notification_v1 14 | environment: 15 | - name: NODE_PATH 16 | value: ${linter}/node_modules 17 | -------------------------------------------------------------------------------- /actions/yarn-check/yarn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/actions/yarn-check/yarn.png -------------------------------------------------------------------------------- /jest.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "ts-jest", 3 | "modulePaths": [""], 4 | "setupFilesAfterEnv": ["/tests/jest_setup.ts"], 5 | "reporters": ["/tests/reporter/index.js", "default", "jest-junit"], 6 | "testPathIgnorePatterns": ["/node_modules/", "/repo-tools/"] 7 | } 8 | -------------------------------------------------------------------------------- /linters/actionlint/test_data/bad.in.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | schedule: 3 | # Cron syntax is not correct 4 | - cron: '0 */3 * *' 5 | # Interval of scheduled job is too small (job runs too frequently) 6 | - cron: '* */3 * * *' 7 | 8 | jobs: 9 | test: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - run: echo ... 13 | -------------------------------------------------------------------------------- /linters/actionlint/test_data/empty.in.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/actionlint/test_data/empty.in.yaml -------------------------------------------------------------------------------- /linters/ansible-lint/test_data/jboss-standalone/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 AnsibleWorks, Inc. 2 | 3 | The work in this jboss-standalone subdirectory is licensed under the Creative Commons Attribution 3.0 Unported License. To view a copy of 4 | this license, visit http://creativecommons.org/licenses/by/3.0/deed.en_US. 5 | -------------------------------------------------------------------------------- /linters/ansible-lint/test_data/jboss-standalone/deploy-application.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This playbook deploys two simple applications to JBoss server. 3 | 4 | - hosts: all 5 | 6 | roles: 7 | # Optionally, (re)deploy JBoss here. 8 | # - jboss-standalone 9 | - java-app 10 | -------------------------------------------------------------------------------- /linters/ansible-lint/test_data/jboss-standalone/hosts: -------------------------------------------------------------------------------- 1 | appserver1 2 | -------------------------------------------------------------------------------- /linters/ansible-lint/test_data/jboss-standalone/roles/java-app/files/jboss-helloworld.war: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/ansible-lint/test_data/jboss-standalone/roles/java-app/files/jboss-helloworld.war -------------------------------------------------------------------------------- /linters/ansible-lint/test_data/jboss-standalone/roles/java-app/files/ticket-monster.war: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/ansible-lint/test_data/jboss-standalone/roles/java-app/files/ticket-monster.war -------------------------------------------------------------------------------- /linters/ansible-lint/test_data/jboss-standalone/roles/jboss-standalone/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart jboss 3 | service: 4 | name: jboss 5 | state: restarted 6 | 7 | - name: restart iptables 8 | service: 9 | name: iptables 10 | state: restarted 11 | -------------------------------------------------------------------------------- /linters/ansible-lint/test_data/jboss-standalone/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This playbook deploys a simple standalone JBoss server. 3 | 4 | - hosts: all 5 | 6 | roles: 7 | - jboss-standalone 8 | -------------------------------------------------------------------------------- /linters/autopep8/autopep8.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | // TODO(Tyler): We will eventually need to add a couple more test cases involving failure modes. 4 | linterFmtTest({ linterName: "autopep8" }); 5 | -------------------------------------------------------------------------------- /linters/bandit/bandit.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | 3 | // TODO(Tyler): We will eventually need to add a couple more test cases involving failure modes. 4 | linterCheckTest({ linterName: "bandit" }); 5 | -------------------------------------------------------------------------------- /linters/bandit/test_data/basic.in.py: -------------------------------------------------------------------------------- 1 | import dill 2 | import StringIO 3 | 4 | # dill 5 | pick = dill.dumps({"a": "b", "c": "d"}) 6 | print(dill.loads(pick)) 7 | 8 | file_obj = StringIO.StringIO() 9 | dill.dump([1, 2, "3"], file_obj) 10 | -------------------------------------------------------------------------------- /linters/biome/biome.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest, linterFmtTest } from "tests"; 2 | 3 | linterCheckTest({ linterName: "biome", namedTestPrefixes: ["basic_check"] }); 4 | 5 | linterFmtTest({ linterName: "biome", namedTestPrefixes: ["basic_fmt", "basic_json"] }); 6 | -------------------------------------------------------------------------------- /linters/biome/test_data/basic_check.in.ts: -------------------------------------------------------------------------------- 1 | const foobar = () => { } 2 | const barfoo = () => { } 3 | 4 | enum Bar { Baz }; 5 | 6 | const foo = (bar: Bar) => { 7 | switch (bar) { 8 | case Bar.Baz: 9 | foobar(); 10 | barfoo(); 11 | break; 12 | } 13 | { !foo ? null : 1 } 14 | } 15 | -------------------------------------------------------------------------------- /linters/biome/test_data/basic_fmt.in.ts: -------------------------------------------------------------------------------- 1 | const foobar = () => { } 2 | const barfoo = () => { } 3 | 4 | enum Bar { Baz }; 5 | 6 | const foo = (bar: Bar) => { 7 | switch (bar) { 8 | case Bar.Baz: 9 | foobar(); 10 | barfoo(); 11 | break; 12 | } 13 | { !foo ? null : 1 } 14 | } 15 | -------------------------------------------------------------------------------- /linters/biome/test_data/basic_json.in.json: -------------------------------------------------------------------------------- 1 | {"a": 2 | "foo", 3 | "b": 1, 4 | "a": true} 5 | -------------------------------------------------------------------------------- /linters/biome/test_data/biome_v1.9.4_basic_fmt.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter biome test basic_fmt 1`] = ` 4 | "const foobar = () => {}; 5 | const barfoo = () => {}; 6 | 7 | enum Bar { 8 | Baz = 0, 9 | } 10 | 11 | const foo = (bar: Bar) => { 12 | switch (bar) { 13 | case Bar.Baz: 14 | foobar(); 15 | barfoo(); 16 | break; 17 | } 18 | !foo ? null : 1; 19 | }; 20 | " 21 | `; 22 | -------------------------------------------------------------------------------- /linters/biome/test_data/biome_v1.9.4_basic_json.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter biome test basic_json 1`] = ` 4 | "{ "a": "foo", "b": 1, "a": true } 5 | " 6 | `; 7 | -------------------------------------------------------------------------------- /linters/black/black.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | // TODO(Tyler): We will eventually need to add a couple more test cases involving failure modes and other autofixes. 4 | linterFmtTest({ linterName: "black", namedTestPrefixes: ["basic", "basic_nb"] }); 5 | -------------------------------------------------------------------------------- /linters/black/test_data/basic.in.py: -------------------------------------------------------------------------------- 1 | 2 | #whitespace below vvv 3 | 4 | #A malindented comment 5 | if __name__ == "__main__" : 6 | a=4+1 7 | b=( 2*7 ) 8 | c = [1, 9 | 2, 10 | 3 11 | ] 12 | print(a/b) 13 | -------------------------------------------------------------------------------- /linters/black/test_data/black_py_v22.3.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter black-py test basic 1`] = ` 4 | "# whitespace below vvv 5 | 6 | # A malindented comment 7 | if __name__ == "__main__": 8 | a = 4 + 1 9 | b = 2 * 7 10 | c = [1, 2, 3] 11 | print(a / b) 12 | " 13 | `; 14 | -------------------------------------------------------------------------------- /linters/black/test_data/black_v22.3.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter black test basic 1`] = ` 4 | "# whitespace below vvv 5 | 6 | # A malindented comment 7 | if __name__ == "__main__": 8 | a = 4 + 1 9 | b = 2 * 7 10 | c = [1, 2, 3] 11 | print(a / b) 12 | " 13 | `; 14 | -------------------------------------------------------------------------------- /linters/brakeman/brakeman.test.ts: -------------------------------------------------------------------------------- 1 | import { customLinterCheckTest } from "tests"; 2 | import { osTimeoutMultiplier, skipOS, TEST_DATA } from "tests/utils"; 3 | 4 | // Note that the ruby setup can sometimes take a while. 5 | // Ruby build is quite slow on Mac, so only run tests on linux for now 6 | jest.setTimeout(600000 * osTimeoutMultiplier); 7 | 8 | customLinterCheckTest({ 9 | linterName: "brakeman", 10 | args: TEST_DATA, 11 | skipTestIf: skipOS(["darwin"]), 12 | }); 13 | -------------------------------------------------------------------------------- /linters/brakeman/test_data/app/empty.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/brakeman/test_data/app/empty.rb -------------------------------------------------------------------------------- /linters/brakeman/test_data/app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | def bad_helper 3 | eval(params[:x]) 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /linters/buf/test_data/buf_breaking.in.proto: -------------------------------------------------------------------------------- 1 | 2 | syntax = "proto3"; 3 | 4 | package trunk; 5 | 6 | message HelloWorld { 7 | string hello = 1; 8 | string world = 2; 9 | } 10 | -------------------------------------------------------------------------------- /linters/buf/test_data/buf_format_v1.17.0_buf_lint.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter buf-format test buf_lint 1`] = ` 4 | "syntax = "proto3"; 5 | 6 | package trunk; 7 | 8 | enum GoodEnum { 9 | lower_case_UNSPECIFIED = 0; 10 | GOOD_ENUM_VALUE_1 = 1; 11 | } 12 | " 13 | `; 14 | -------------------------------------------------------------------------------- /linters/buf/test_data/buf_format_v1.32.0_buf_lint.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | // trunk-upgrade-validation:RELEASE 3 | 4 | exports[`Testing formatter buf-format test buf_lint 1`] = ` 5 | "syntax = "proto3"; 6 | 7 | package trunk; 8 | 9 | enum GoodEnum { 10 | lower_case_UNSPECIFIED = 0; 11 | GOOD_ENUM_VALUE_1 = 1; 12 | } 13 | " 14 | `; 15 | -------------------------------------------------------------------------------- /linters/buf/test_data/buf_lint.in.proto: -------------------------------------------------------------------------------- 1 | 2 | syntax = "proto3"; 3 | 4 | package trunk; 5 | 6 | enum GoodEnum { 7 | lower_case_UNSPECIFIED = 0; 8 | GOOD_ENUM_VALUE_1 = 1; 9 | } 10 | -------------------------------------------------------------------------------- /linters/buildifier/test_data/add_tables.BUILD: -------------------------------------------------------------------------------- 1 | foo_macro( 2 | fizz = [ 3 | ":lib2", 4 | ":lib1", 5 | ], 6 | ) 7 | 8 | filegroup( 9 | name = "files", 10 | srcs = glob(["**"]), 11 | ) 12 | 13 | sh_library( 14 | name = "lib1", 15 | srcs = ["src1.sh"], 16 | ) 17 | 18 | sh_library( 19 | name = "lib2", 20 | srcs = ["src1.sh"], 21 | ) 22 | 23 | sh_binary( 24 | name = "foo", 25 | srcs = ["foo.sh"], 26 | deps = [ 27 | ":lib2", 28 | ":lib1", 29 | ], 30 | ) 31 | -------------------------------------------------------------------------------- /linters/buildifier/test_data/basic.bzl: -------------------------------------------------------------------------------- 1 | load("@foo//:test.bzl", "a") 2 | load("@bar//:test.bzl", "b") 3 | 4 | # Misformatted file 5 | def eponymous_name(): 6 | name = native.package_name() 7 | 8 | 9 | 10 | 11 | 12 | return name[name.rfind("/") + 1:] 13 | -------------------------------------------------------------------------------- /linters/buildifier/test_data/buildifier_v6.1.0_no_config.test_data.basic.bzl.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter buildifier test no_config 1`] = ` 4 | "# Misformatted file 5 | def eponymous_name(): 6 | name = native.package_name() 7 | 8 | return name[name.rfind("/") + 1:] 9 | " 10 | `; 11 | -------------------------------------------------------------------------------- /linters/buildifier/test_data/buildifier_v7.1.0_no_config.test_data.basic.bzl.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter buildifier test no_config 1`] = ` 4 | "# Misformatted file 5 | def eponymous_name(): 6 | name = native.package_name() 7 | 8 | return name[name.rfind("/") + 1:] 9 | " 10 | `; 11 | -------------------------------------------------------------------------------- /linters/buildifier/test_data/buildifier_v7.3.1_no_config.test_data.basic.bzl.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | // trunk-upgrade-validation:RELEASE 3 | 4 | exports[`Testing formatter buildifier test no_config 1`] = ` 5 | "# Misformatted file 6 | def eponymous_name(): 7 | name = native.package_name() 8 | 9 | return name[name.rfind("/") + 1:] 10 | " 11 | `; 12 | -------------------------------------------------------------------------------- /linters/buildifier/test_data/buildifier_v8.0.3_no_config.test_data.basic.bzl.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | // trunk-upgrade-validation:RELEASE 3 | 4 | exports[`Testing formatter buildifier test no_config 1`] = ` 5 | "# Misformatted file 6 | def eponymous_name(): 7 | name = native.package_name() 8 | 9 | return name[name.rfind("/") + 1:] 10 | " 11 | `; 12 | -------------------------------------------------------------------------------- /linters/cfnlint/cfnlint.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | 3 | linterCheckTest({ linterName: "cfnlint" }); 4 | -------------------------------------------------------------------------------- /linters/checkov/checkov.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | 3 | linterCheckTest({ linterName: "checkov" }); 4 | -------------------------------------------------------------------------------- /linters/checkov/test_data/basic_kubernetes.in.yaml: -------------------------------------------------------------------------------- 1 | # runAsNonRoot and runAsUser not set (pod or container) 2 | apiVersion: v1 3 | kind: Pod 4 | metadata: 5 | name: pod1 6 | annotations: 7 | checkov.io/skip1: CKV_K8S_37=suppress this issue 8 | spec: 9 | containers: 10 | - name: main 11 | image: alpine 12 | command: ["/bin/sleep", "999999"] 13 | -------------------------------------------------------------------------------- /linters/circleci/circleci.test.ts: -------------------------------------------------------------------------------- 1 | import { customLinterCheckTest } from "tests"; 2 | import { TEST_DATA } from "tests/utils"; 3 | 4 | customLinterCheckTest({ 5 | linterName: "circleci", 6 | args: TEST_DATA, 7 | }); 8 | -------------------------------------------------------------------------------- /linters/circleci/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | LINT_TARGET="${1}" 5 | 6 | circleci --skip-update-check config validate "${LINT_TARGET}" || exit 1 7 | -------------------------------------------------------------------------------- /linters/circleci/test_data/bad_version/.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | orbs: 4 | node: circleci/node@2.99 5 | 6 | jobs: 7 | install-node-example: 8 | docker: 9 | - image: cimg/base:stable 10 | steps: 11 | - checkout 12 | - node/install: 13 | install-yarn: true 14 | node-version: '16.13' 15 | - run: node --version 16 | workflows: 17 | test_my_app: 18 | jobs: 19 | - install-node-example 20 | -------------------------------------------------------------------------------- /linters/circleci/test_data/basic/.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | orbs: 4 | node: circleci/node@2.1 5 | 6 | jobs: 7 | install-node-example: 8 | docker: 9 | - image: cimg/base:stable 10 | steps: 11 | - checkout 12 | - node/install: 13 | install-yarn: true 14 | node-version: '16.13' 15 | - run: node --version 16 | workflows: 17 | test_my_app: 18 | jobs: 19 | - install-node-example 20 | -------------------------------------------------------------------------------- /linters/circleci/test_data/malformed/.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | orbs: 4 | node: circleci/node@2.1 5 | 6 | jobs: 7 | install-node-example: 8 | docker: 9 | - image: cimg/base:stable 10 | - foo: bar 11 | steps: 12 | - checkout 13 | - node/install: 14 | install-yarn: true 15 | node-version: '16.13' 16 | - run: node --version 17 | - rerun: [true] 18 | workflows: 19 | test_my_app: 20 | jobs: 21 | - install-node-example 22 | -------------------------------------------------------------------------------- /linters/clang-format/clang_format.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | // TODO(Tyler): Add .clang-format file from configs 5 | // TODO(Tyler): We will eventually need to add a couple more test cases involving failure modes and other autofixes. 6 | linterFmtTest({ linterName: "clang-format", skipTestIf: skipOS(["win32"]) }); 7 | -------------------------------------------------------------------------------- /linters/clang-format/test_data/basic.in.hh: -------------------------------------------------------------------------------- 1 | int foo() { 2 | } 3 | 4 | inline int bar() {} 5 | 6 | inline int baz() { 7 | int a = 1; 8 | int b=a*2; 9 | return b; 10 | } 11 | -------------------------------------------------------------------------------- /linters/clang-format/test_data/clang_format_v16.0.3_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter clang-format test basic 1`] = ` 4 | "int foo() {} 5 | 6 | inline int bar() {} 7 | 8 | inline int baz() { 9 | int a = 1; 10 | int b = a * 2; 11 | return b; 12 | } 13 | " 14 | `; 15 | -------------------------------------------------------------------------------- /linters/clang-format/test_data/clang_format_v16.0.3_cuda.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter clang-format test cuda 1`] = ` 4 | "__global__ void cuda_hello() { printf("Hello World from GPU!\\n"); } 5 | 6 | int main() { 7 | cuda_hello<<<1, 1>>>(); 8 | return 0; 9 | } 10 | " 11 | `; 12 | -------------------------------------------------------------------------------- /linters/clang-format/test_data/clang_format_v16.0.3_proto.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter clang-format test proto 1`] = ` 4 | "syntax = "proto3"; 5 | 6 | message MyMessage { 7 | int32 a = 1; 8 | repeated string b = 2; 9 | optional string c = 3; 10 | } 11 | " 12 | `; 13 | -------------------------------------------------------------------------------- /linters/clang-format/test_data/cuda.in.cu: -------------------------------------------------------------------------------- 1 | __global__ void cuda_hello(){ 2 | printf("Hello World from GPU!\n"); 3 | } 4 | 5 | int main() { 6 | cuda_hello<<<1,1>>>( ); 7 | return 0 ; 8 | } 9 | -------------------------------------------------------------------------------- /linters/clang-format/test_data/proto.in.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message MyMessage { 4 | int32 a = 1; 5 | repeated string b = 2; 6 | optional string c=3; 7 | } 8 | -------------------------------------------------------------------------------- /linters/clang-tidy/test_data/a_includes.cc: -------------------------------------------------------------------------------- 1 | #include "invalid_case_style.hh" 2 | -------------------------------------------------------------------------------- /linters/clang-tidy/test_data/b_includes.cc: -------------------------------------------------------------------------------- 1 | #include "invalid_case_style.hh" 2 | -------------------------------------------------------------------------------- /linters/clang-tidy/test_data/basic.cc: -------------------------------------------------------------------------------- 1 | static constexpr const char* unused = ""; 2 | -------------------------------------------------------------------------------- /linters/clang-tidy/test_data/invalid_case_style.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class invalidCaseStyle {}; 4 | -------------------------------------------------------------------------------- /linters/clang-tidy/test_data/test.hh: -------------------------------------------------------------------------------- 1 | class Foo { 2 | inline void Bar() { (void)nullptr; } 3 | }; 4 | -------------------------------------------------------------------------------- /linters/clippy/test_data/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "test" 7 | version = "0.0.1" 8 | -------------------------------------------------------------------------------- /linters/clippy/test_data/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test" 3 | version = "0.0.1" 4 | authors = ["test "] 5 | license = "MIT" 6 | description = "trunk plugin test" 7 | edition = "2018" 8 | -------------------------------------------------------------------------------- /linters/clippy/test_data/complex/high.rs: -------------------------------------------------------------------------------- 1 | fn do_bad_math() { 2 | 100u8 << 10; 3 | } 4 | -------------------------------------------------------------------------------- /linters/clippy/test_data/complex/main.rs: -------------------------------------------------------------------------------- 1 | mod high; 2 | 3 | fn main() { 4 | let x = 1; 5 | let y = 2; 6 | if x == y || x < y {} 7 | println!("Hello World"); 8 | } 9 | -------------------------------------------------------------------------------- /linters/clippy/test_data/complex/wont_compile.rs: -------------------------------------------------------------------------------- 1 | // A version of main.rs that wont compile because its missing ; after mod. 2 | // Used to verify compile errors are properly reported as linter failures. 3 | mod high 4 | 5 | fn main() { 6 | let x = 1; 7 | let y = 2; 8 | if x == y || x < y {} 9 | println!("Hello World"); 10 | } 11 | -------------------------------------------------------------------------------- /linters/clippy/test_data/complex_subdir/src/high.rs: -------------------------------------------------------------------------------- 1 | fn do_bad_math() { 2 | 100u8 << 10; 3 | } 4 | -------------------------------------------------------------------------------- /linters/clippy/test_data/complex_subdir/src/main.rs: -------------------------------------------------------------------------------- 1 | mod high; 2 | 3 | fn main() { 4 | let x = 1; 5 | let y = 2; 6 | if x == y || x < y {} 7 | println!("Hello World"); 8 | } 9 | -------------------------------------------------------------------------------- /linters/clippy/test_data/complex_subdir/src/wont_compile.rs: -------------------------------------------------------------------------------- 1 | // A version of main.rs that wont compile because its missing ; after mod. 2 | // Used to verify compile errors are properly reported as linter failures. 3 | mod high 4 | 5 | fn main() { 6 | let x = 1; 7 | let y = 2; 8 | if x == y || x < y {} 9 | println!("Hello World"); 10 | } 11 | -------------------------------------------------------------------------------- /linters/clippy/test_data/malformed/main.rs: -------------------------------------------------------------------------------- 1 | // A version of main.rs that requires a semicolon, and should be autofixed rather than returning a 2 | // linter failure. 3 | mod high 4 | 5 | fn main() { 6 | let x = 1; 7 | let y = 2; 8 | if x == y || x < y {} 9 | println!("Hello World"); 10 | } 11 | -------------------------------------------------------------------------------- /linters/clippy/test_data/malformed_subdir/src/main.rs: -------------------------------------------------------------------------------- 1 | // A version of main.rs that requires a semicolon, and should be autofixed rather than returning a 2 | // linter failure. 3 | mod high 4 | 5 | fn main() { 6 | let x = 1; 7 | let y = 2; 8 | if x == y || x < y {} 9 | println!("Hello World"); 10 | } 11 | -------------------------------------------------------------------------------- /linters/cmake-format/cmake-format.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | linterFmtTest({ linterName: "cmake-format" }); 4 | -------------------------------------------------------------------------------- /linters/cmake-format/test_data/cmake_format_v0.6.13_test1.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter cmake-format test test1 1`] = ` 4 | "cmake_minimum_required(VERSION 3.22) 5 | 6 | project( 7 | myproject 8 | VERSION 1.0 9 | DESCRIPTION "Testing if cmake-format works" 10 | LANGUAGES C CXX) 11 | 12 | add_executable(myproject \${PROJECT_SOURCE_DIR}/src/main.cpp) 13 | " 14 | `; 15 | -------------------------------------------------------------------------------- /linters/cmake-format/test_data/test1.in.cmake: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.22) 2 | 3 | project( 4 | myproject 5 | VERSION 1.0 6 | DESCRIPTION "Testing if cmake-format works" 7 | LANGUAGES C CXX 8 | ) 9 | 10 | add_executable( 11 | 12 | myproject 13 | 14 | ${PROJECT_SOURCE_DIR}/src/main.cpp 15 | ) 16 | -------------------------------------------------------------------------------- /linters/cmake-format/test_data/test2.in.cmake: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.22) 2 | 3 | project( myproject VERSION 1.0 DESCRIPTION "Testing if cmake-format works" LANGUAGES C CXX) 4 | 5 | add_library( 6 | 7 | myproject 8 | 9 | ${PROJECT_SOURCE_DIR}/src/a_file.cpp 10 | 11 | ${PROJECT_SOURCE_DIR}/src/b_file.cpp 12 | ${PROJECT_SOURCE_DIR}/src/c_file.cpp 13 | ${PROJECT_SOURCE_DIR}/src/e_file.cpp 14 | 15 | ${PROJECT_SOURCE_DIR}/src/d_file.cpp 16 | ) 17 | -------------------------------------------------------------------------------- /linters/codespell/codespell.test.ts: -------------------------------------------------------------------------------- 1 | import { customLinterCheckTest } from "tests"; 2 | import { TrunkLintDriver } from "tests/driver"; 3 | import { TEST_DATA } from "tests/utils"; 4 | 5 | customLinterCheckTest({ linterName: "codespell", testName: "basic", args: TEST_DATA }); 6 | 7 | const preCheck = (driver: TrunkLintDriver) => { 8 | driver.writeFile(".codespellrc", "[codespell]\nignore-words-list = callbak,realy"); 9 | }; 10 | 11 | customLinterCheckTest({ 12 | linterName: "codespell", 13 | testName: "dictionary", 14 | args: TEST_DATA, 15 | preCheck, 16 | }); 17 | -------------------------------------------------------------------------------- /linters/codespell/test_data/basic_md.in.md: -------------------------------------------------------------------------------- 1 | # bad.md 2 | 3 | # This file has reallly long lines 4 | 5 | Line is OK- Make a realy long line that breaks the layout rules completely. Make a realy long line 6 | that breaks 7 | But this should be ignored because of config 8 | 9 | 10 | Line is to long (over 120) A B C D E F G A B C D E F G A B C D E F G A B C D E F G A B C D E F G A B C D E F G A B C D E F G A B C D E F G 11 | -------------------------------------------------------------------------------- /linters/codespell/test_data/basic_py.in.py: -------------------------------------------------------------------------------- 1 | def main(): 2 | try: 3 | pass 4 | except (Exception, TypeError): 5 | pass 6 | 7 | import sys 8 | import pands 9 | 10 | class NoDocstring(object): 11 | def __init__(self, arg1): 12 | self._attr1 = arg1 13 | 14 | class Globe(object): 15 | def __init__(self): 16 | self.shape = 'spheroid' 17 | 18 | def __inti__(self): 19 | prit("this is not a valid method") 20 | callbak = lamda x: x * 2 21 | 22 | varName1 = "helol ym anme is var" 23 | 24 | cachedir = "/tmp" 25 | -------------------------------------------------------------------------------- /linters/codespell/test_data/basic_ts.in.ts: -------------------------------------------------------------------------------- 1 | const foobar = () => { } 2 | const barfoo = () => { } 3 | 4 | enum Bar { Baz }; 5 | 6 | const foo = (bar: Bar) => { 7 | switch (bar) { 8 | case Bar.Baz: 9 | foobar(); 10 | barfoo(); 11 | break; 12 | } 13 | { !foo ? null : 1 } 14 | } 15 | 16 | const callback = "callback"; 17 | const callbakc = "callbakc" 18 | const callbakk = "callbak" 19 | const asnyc = "awiat" 20 | -------------------------------------------------------------------------------- /linters/codespell/test_data/empty.in.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/codespell/test_data/empty.in.txt -------------------------------------------------------------------------------- /linters/cspell/cspell.yaml: -------------------------------------------------------------------------------- 1 | version: "0.2" 2 | # Suggestions can sometimes take longer on CI machines, 3 | # leading to inconsistent results. 4 | suggestionsTimeout: 5000 # ms 5 | -------------------------------------------------------------------------------- /linters/cspell/test_data/basic_md.in.md: -------------------------------------------------------------------------------- 1 | # bad.md 2 | 3 | # This file has reallly long lines 4 | 5 | Line is OK- Make a realy long line that breaks the layout rules completely. Make a realy long line 6 | that breaks 7 | But this should be ignored because of config 8 | 9 | 10 | Line is to long (over 120) A B C D E F G A B C D E F G A B C D E F G A B C D E F G A B C D E F G A B C D E F G A B C D E F G A B C D E F G 11 | -------------------------------------------------------------------------------- /linters/cspell/test_data/basic_py.in.py: -------------------------------------------------------------------------------- 1 | def main(): 2 | try: 3 | pass 4 | except (Exception, TypeError): 5 | pass 6 | 7 | import sys 8 | import pands 9 | 10 | class NoDocstring(object): 11 | def __init__(self, arg1): 12 | self._attr1 = arg1 13 | 14 | class Globe(object): 15 | def __init__(self): 16 | self.shape = 'spheroid' 17 | 18 | def __inti__(self): 19 | prit("this is not a valid method") 20 | callbak = lamda x: x * 2 21 | 22 | varName1 = "helol ym anme is var" 23 | 24 | cachedir = "/tmp" 25 | -------------------------------------------------------------------------------- /linters/cspell/test_data/basic_ts.in.ts: -------------------------------------------------------------------------------- 1 | const foobar = () => { } 2 | const barfoo = () => { } 3 | 4 | enum Bar { Baz }; 5 | 6 | const foo = (bar: Bar) => { 7 | switch (bar) { 8 | case Bar.Baz: 9 | foobar(); 10 | barfoo(); 11 | break; 12 | } 13 | { !foo ? null : 1 } 14 | } 15 | 16 | const callback = "callback"; 17 | const callbakc = "callbakc" 18 | const callbakk = "callbak" 19 | const asnyc = "awiat" 20 | -------------------------------------------------------------------------------- /linters/cspell/test_data/empty.in.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/cspell/test_data/empty.in.txt -------------------------------------------------------------------------------- /linters/cue-fmt/cue_fmt.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | // TODO(Tyler): We will eventually need to add a couple more test cases involving failure modes and other autofixes. 4 | linterFmtTest({ linterName: "cue-fmt" }); 5 | -------------------------------------------------------------------------------- /linters/cue-fmt/test_data/basic.in.cue: -------------------------------------------------------------------------------- 1 | #Bar: { 2 | a: string 3 | b?: int // a useful comment 4 | } 5 | foo: #Bar 6 | foo: { a: "a"} 7 | -------------------------------------------------------------------------------- /linters/cue-fmt/test_data/cue_fmt_v0.5.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter cue-fmt test basic 1`] = ` 4 | "#Bar: { 5 | a: string 6 | b?: int // a useful comment 7 | } 8 | foo: #Bar 9 | foo: {a: "a"} 10 | " 11 | `; 12 | -------------------------------------------------------------------------------- /linters/dart/test_data/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | linter: 2 | rules: 3 | - use_super_parameters 4 | -------------------------------------------------------------------------------- /linters/dart/test_data/basic.in.dart: -------------------------------------------------------------------------------- 1 | library; 2 | import 'dart:io'; 3 | class Vector2d { 4 | final double x, y; 5 | Vector2d(this.x, this.y); 6 | } 7 | class Vector3d extends Vector2d { 8 | final double z; 9 | Vector3d(final double x, final double y, this.z) : super(x, y); 10 | } 11 | 12 | void main() { 13 | expect(find.text(''), empty); 14 | } 15 | -------------------------------------------------------------------------------- /linters/dart/test_data/dart_v3.2.6_test_data.basic.in.dart.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter dart test basic 1`] = ` 4 | "library; 5 | 6 | class Vector2d { 7 | final double x, y; 8 | Vector2d(this.x, this.y); 9 | } 10 | 11 | class Vector3d extends Vector2d { 12 | final double z; 13 | Vector3d(super.x, super.y, this.z); 14 | } 15 | 16 | void main() { 17 | expect(find.text(''), empty); 18 | } 19 | " 20 | `; 21 | -------------------------------------------------------------------------------- /linters/dart/test_data/pubspec.yaml: -------------------------------------------------------------------------------- 1 | environment: 2 | sdk: ">=2.17.0 <4.0.0" 3 | -------------------------------------------------------------------------------- /linters/deno/deno.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | import { skipCPUOS } from "tests/utils"; 3 | 4 | linterFmtTest({ linterName: "deno", skipTestIf: skipCPUOS([{ os: "linux", cpu: "arm64" }]) }); 5 | -------------------------------------------------------------------------------- /linters/deno/test_data/basic.in.js: -------------------------------------------------------------------------------- 1 | export const identity = [ 2 | 1, 0, 0, 3 | 0, 1, 0, 4 | 0, 0, 1, 5 | ]; 6 | -------------------------------------------------------------------------------- /linters/deno/test_data/deno_v1.36.4_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter deno test basic 1`] = ` 4 | "export const identity = [ 5 | 1, 6 | 0, 7 | 0, 8 | 0, 9 | 1, 10 | 0, 11 | 0, 12 | 0, 13 | 1, 14 | ]; 15 | " 16 | `; 17 | -------------------------------------------------------------------------------- /linters/detekt/test_data/basic_detekt.in.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("unused", "UNUSED_PARAMETER") 2 | 3 | package cases 4 | 5 | fun constantInt(): Int { 6 | return 42 7 | } 8 | 9 | open class BrokenHashCode { 10 | override fun hashCode() = 1 11 | } 12 | 13 | fun badWhitespace() { 14 | val i = 1 15 | if (i > 0) { 16 | if (i < 5) { 17 | println(i) 18 | } 19 | } 20 | 21 | 22 | return 23 | 91 24 | } 25 | -------------------------------------------------------------------------------- /linters/detekt/test_data/basic_explicit.in.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("unused", "UNUSED_PARAMETER") 2 | 3 | package cases 4 | 5 | fun constantInt(): Int { 6 | return 42 7 | } 8 | 9 | open class BrokenHashCode { 10 | override fun hashCode() = 1 11 | } 12 | 13 | fun badWhitespace() { 14 | val i = 1 15 | if (i > 0) { 16 | if (i < 5) { 17 | println(i) 18 | } 19 | } 20 | 21 | 22 | return 23 | 91 24 | } 25 | -------------------------------------------------------------------------------- /linters/detekt/test_data/detekt_gradle/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore Gradle project-specific cache directory 2 | .gradle 3 | 4 | # Ignore Gradle build output directory 5 | build 6 | -------------------------------------------------------------------------------- /linters/detekt/test_data/detekt_gradle/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/detekt/test_data/detekt_gradle/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /linters/detekt/test_data/detekt_gradle/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /linters/detekt/test_data/detekt_gradle/lib/no-potential-bugs.detekt.yaml: -------------------------------------------------------------------------------- 1 | potential-bugs: 2 | active: false 3 | -------------------------------------------------------------------------------- /linters/detekt/test_data/detekt_gradle/lib/potential-bugs.detekt.yaml: -------------------------------------------------------------------------------- 1 | potential-bugs: 2 | active: true 3 | EqualsWithHashCodeExist: 4 | active: true 5 | -------------------------------------------------------------------------------- /linters/detekt/test_data/detekt_gradle/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * 6 | * Detailed information about configuring a multi-project build in Gradle can be found 7 | * in the user manual at https://docs.gradle.org/7.4.1/userguide/multi_project_builds.html 8 | * This project uses @Incubating APIs which are subject to change. 9 | */ 10 | 11 | rootProject.name = "detekt_gradle" 12 | include("lib") 13 | -------------------------------------------------------------------------------- /linters/djlint/.djlintrc: -------------------------------------------------------------------------------- 1 | { 2 | "linter_output_format": "{filename}:{line} - {code} - {message} :: {match}" 3 | } 4 | -------------------------------------------------------------------------------- /linters/djlint/djlint.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest, linterFmtTest } from "tests"; 2 | 3 | // TODO(Tyler): We will eventually need to add a couple more test cases involving failure modes and other packages. 4 | linterCheckTest({ linterName: "djlint" }); 5 | linterFmtTest({ linterName: "djlint" }); 6 | -------------------------------------------------------------------------------- /linters/djlint/test_data/djlint_v1.19.16_logout.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter djlint test logout 1`] = ` 4 | "{% extends "base.html" %} 5 | {% load i18n %} 6 | {% block contentLoggedIn %}You are currently logged in.{% endblock %} 7 | {% block content %} 8 | 9 |

You are currently logged out.

10 | 11 | {% trans "Log in" %} 12 | {% endblock %} 13 | " 14 | `; 15 | -------------------------------------------------------------------------------- /linters/djlint/test_data/djlint_v1.19.17_logout.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter djlint test logout 1`] = ` 4 | "{% extends "base.html" %} 5 | {% load i18n %} 6 | {% block contentLoggedIn %}You are currently logged in.{% endblock %} 7 | {% block content %} 8 | 9 |

You are currently logged out.

10 | 11 | {% trans "Log in" %} 12 | {% endblock %} 13 | " 14 | `; 15 | -------------------------------------------------------------------------------- /linters/djlint/test_data/djlint_v1.22.0_logout.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter djlint test logout 1`] = ` 4 | "{% extends "base.html" %} 5 | {% load i18n %} 6 | {% block contentLoggedIn %}You are currently logged in.{% endblock %} 7 | {% block content %} 8 | 9 |

You are currently logged out.

10 | 11 | {% trans "Log in" %} 12 | {% endblock %} 13 | " 14 | `; 15 | -------------------------------------------------------------------------------- /linters/djlint/test_data/logout.in.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %}{% load i18n %}{% block contentLoggedIn %}You are currently logged in.{% endblock %}{% block content %} 2 | 3 |

You are currently logged out.

4 | 5 | {% trans "Log in" %} 6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /linters/dotenv-linter/dotenv_linter.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | // TODO(Tyler): We will eventually need to add a couple more test cases involving failure modes. 4 | linterFmtTest({ linterName: "dotenv-linter" }); 5 | -------------------------------------------------------------------------------- /linters/dotenv-linter/test_data/basic.in.env: -------------------------------------------------------------------------------- 1 | 1ABC=2345 2 | asFD=123 3 | FOO=BAR 4 | FOO=BAZ 5 | -------------------------------------------------------------------------------- /linters/dotenv-linter/test_data/dotenv_linter_v3.3.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter dotenv-linter test basic 1`] = ` 4 | "ABC=2345 5 | ASFD=123 6 | FOO=BAR 7 | # FOO=BAZ 8 | " 9 | `; 10 | -------------------------------------------------------------------------------- /linters/dotnet-format/test_data/basic/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | Console.WriteLine("Hello, World!"); 3 | -------------------------------------------------------------------------------- /linters/dotnet-format/test_data/basic/basic.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net7.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /linters/dotnet-format/test_data/basic/basic.in.cs: -------------------------------------------------------------------------------- 1 | // Hello World! program 2 | namespace HelloWorld 3 | { 4 | class Hello 5 | { 6 | static void Main(string[] args) 7 | { 8 | System.Console.WriteLine("Hello World!"); 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /linters/dotnet-format/test_data/basic/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")] 5 | -------------------------------------------------------------------------------- /linters/dotnet-format/test_data/basic/obj/Debug/net7.0/basic.GlobalUsings.g.cs: -------------------------------------------------------------------------------- 1 | // 2 | global using global::System; 3 | global using global::System.Collections.Generic; 4 | global using global::System.IO; 5 | global using global::System.Linq; 6 | global using global::System.Net.Http; 7 | global using global::System.Threading; 8 | global using global::System.Threading.Tasks; 9 | -------------------------------------------------------------------------------- /linters/dotnet-format/test_data/basic/obj/basic.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 |  2 | -------------------------------------------------------------------------------- /linters/dotnet-format/test_data/dotnet_format_v7.0.400_CUSTOM.test_data.basic.Program.cs.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter dotnet-format test CUSTOM 1`] = ` 4 | "// See https://aka.ms/new-console-template for more information 5 | Console.WriteLine("Hello, World!"); 6 | " 7 | `; 8 | -------------------------------------------------------------------------------- /linters/dotnet-format/test_data/dotnet_format_v7.0.400_CUSTOM.test_data.basic.basic.in.cs.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter dotnet-format test CUSTOM 1`] = ` 4 | "// Hello World! program 5 | namespace HelloWorld 6 | { 7 | class Hello 8 | { 9 | static void Main(string[] args) 10 | { 11 | System.Console.WriteLine("Hello World!"); 12 | } 13 | } 14 | } 15 | " 16 | `; 17 | -------------------------------------------------------------------------------- /linters/dotnet-format/test_data/dotnet_format_v7.0.400_CUSTOM.test_data.second_one.Program.cs.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter dotnet-format test CUSTOM 1`] = ` 4 | "// See https://aka.ms/new-console-template for more information 5 | Console.WriteLine("Hello, World!"); 6 | " 7 | `; 8 | -------------------------------------------------------------------------------- /linters/dotnet-format/test_data/second_one/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | Console.WriteLine("Hello, World!"); 3 | -------------------------------------------------------------------------------- /linters/dotnet-format/test_data/second_one/second_one.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net7.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /linters/dustilock/dustilock.test.ts: -------------------------------------------------------------------------------- 1 | import { customLinterCheckTest } from "tests"; 2 | import { TEST_DATA } from "tests/utils"; 3 | 4 | customLinterCheckTest({ linterName: "dustilock", args: TEST_DATA }); 5 | -------------------------------------------------------------------------------- /linters/dustilock/test_data/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "parse": "ts-node tests/parse/index.ts", 5 | "test": "jest", 6 | "trunk": "trunk" 7 | }, 8 | "devDependencies": { 9 | "corporateInternalTool": "^2.2.0", 10 | "someDefinitelyNotPublicUtility": "^13.37" 11 | }, 12 | "bundleDependencies": [ 13 | "tests" 14 | ], 15 | "engines": { 16 | "node": ">=16" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /linters/dustilock/test_data/requirements.txt: -------------------------------------------------------------------------------- 1 | myNonPublicInternalTool==1.2.3 2 | yetAnotherInternalTool==4.5.6 3 | -------------------------------------------------------------------------------- /linters/eslint/test_data/eof_autofix.ts: -------------------------------------------------------------------------------- 1 | /* eslint "eol-last": "error" */ 2 | "perfectly normal ascii string"; -------------------------------------------------------------------------------- /linters/eslint/test_data/eslint_v8.10.0_test_data.eof_autofix.ts.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter eslint test CUSTOM 1`] = ` 4 | "/* eslint "eol-last": "error" */ 5 | "perfectly normal ascii string"; 6 | " 7 | `; 8 | -------------------------------------------------------------------------------- /linters/eslint/test_data/eslint_v8.10.0_test_data.format_imports.ts.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter eslint test CUSTOM 1`] = ` 4 | "/* eslint "import/first": "error" */ 5 | import { zaphod } from "beetlebrox"; 6 | import { arthur } from "dent"; 7 | import { ford } from "prefect"; 8 | 9 | export interface Marvin { 10 | paranoid: boolean; 11 | } 12 | " 13 | `; 14 | -------------------------------------------------------------------------------- /linters/eslint/test_data/eslint_v8.10.0_test_data.non_ascii.ts.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter eslint test CUSTOM 1`] = ` 4 | "!false; 5 | // some of these non-ascii chars (✔, », ✖) trigger wrong offsets 6 | " 7 | `; 8 | -------------------------------------------------------------------------------- /linters/eslint/test_data/eslint_v9.0.0_test_data.eof_autofix.ts.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter eslint test CUSTOM 1`] = ` 4 | "/* eslint "eol-last": "error" */ 5 | "perfectly normal ascii string"; 6 | " 7 | `; 8 | -------------------------------------------------------------------------------- /linters/eslint/test_data/eslint_v9.0.0_test_data.format_imports.ts.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter eslint test CUSTOM 1`] = ` 4 | "/* eslint "import/first": "error" */ 5 | import { zaphod } from "beetlebrox"; 6 | import { arthur } from "dent"; 7 | import { ford } from "prefect"; 8 | 9 | export interface Marvin { 10 | paranoid: boolean; 11 | } 12 | " 13 | `; 14 | -------------------------------------------------------------------------------- /linters/eslint/test_data/eslint_v9.0.0_test_data.non_ascii.ts.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter eslint test CUSTOM 1`] = ` 4 | "!false; 5 | // some of these non-ascii chars (✔, », ✖) trigger wrong offsets 6 | " 7 | `; 8 | -------------------------------------------------------------------------------- /linters/eslint/test_data/format_imports.ts: -------------------------------------------------------------------------------- 1 | /* eslint "import/first": "error" */ 2 | import { zaphod } from "beetlebrox"; 3 | import { arthur } from "dent"; 4 | 5 | export interface Marvin { 6 | paranoid: boolean; 7 | } 8 | import { ford } from "prefect"; 9 | -------------------------------------------------------------------------------- /linters/eslint/test_data/non_ascii.ts: -------------------------------------------------------------------------------- 1 | !!!false; 2 | // some of these non-ascii chars (✔, », ✖) trigger wrong offsets 3 | -------------------------------------------------------------------------------- /linters/eslint/test_data/package-new.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "devDependencies": { 4 | "@eslint/js": "^9.0.0", 5 | "@typescript-eslint/parser": "^6.12.0", 6 | "eslint": "^8.10.0", 7 | "eslint-config-prettier": "^9.0.0", 8 | "eslint-plugin-import-x": "^0.5.0", 9 | "eslint-plugin-n": "^17.1.0", 10 | "eslint-plugin-prettier": "^4.2.1", 11 | "prettier": "^2.8.0", 12 | "tslib": "^2.6.2", 13 | "typescript": "4.9.5" 14 | }, 15 | "dependencies": { 16 | "typescript-eslint": "^7.6.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /linters/eslint/test_data/package-old.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "devDependencies": { 4 | "@typescript-eslint/eslint-plugin": "^6.12.0", 5 | "@typescript-eslint/parser": "^6.12.0", 6 | "eslint": "^8.10.0", 7 | "eslint-config-prettier": "^9.0.0", 8 | "eslint-plugin-import": "^2.27.5", 9 | "eslint-plugin-node": "^11.1.0", 10 | "eslint-plugin-prettier": "^4.2.1", 11 | "prettier": "^2.8.0", 12 | "typescript": "4.9.5" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /linters/flake8/.flake8: -------------------------------------------------------------------------------- 1 | # Autoformatter friendly flake8 config (all formatting rules disabled) 2 | [flake8] 3 | extend-ignore = D1, D2, E1, E2, E3, E501, W1, W2, W3, W5 4 | -------------------------------------------------------------------------------- /linters/flake8/flake8.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | 3 | // TODO(Tyler): We will eventually need to add a couple more test cases involving failure modes and other packages. 4 | linterCheckTest({ linterName: "flake8" }); 5 | -------------------------------------------------------------------------------- /linters/flake8/test_data/basic.in.py: -------------------------------------------------------------------------------- 1 | def main(): 2 | try: 3 | pass 4 | except (Exception, TypeError): 5 | pass 6 | 7 | import sys 8 | 9 | # trunk-ignore(flake8/F401): this will trigger a warning to verify that the config is applied 10 | class NoDocstring(object): 11 | def __init__(self, arg1): 12 | self._attr1 = arg1 13 | 14 | class Globe(object): 15 | def __init__(self): 16 | self.shape = 'spheroid' 17 | -------------------------------------------------------------------------------- /linters/git-diff-check/test_data/basic.in.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/git-diff-check/test_data/basic.in.txt -------------------------------------------------------------------------------- /linters/git-diff-check/test_data/conflict.in.txt: -------------------------------------------------------------------------------- 1 | <<<<<<< HEAD 2 | Baz. 3 | ======= 4 | Bar. 5 | >>>>>>> master 6 | -------------------------------------------------------------------------------- /linters/gitleaks/gitleaks.test.ts: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import { customLinterCheckTest } from "tests"; 3 | import { TEST_DATA } from "tests/utils"; 4 | 5 | // gitleaks version 7.0.0 only had an amd64 release asset for darwin, and our runners are x86_64. 6 | const skipTestIf = (version?: string) => version === "7.0.0" && process.platform == "darwin"; 7 | 8 | customLinterCheckTest({ 9 | linterName: "gitleaks", 10 | testName: "basic", 11 | args: path.join(TEST_DATA, "basic.py"), 12 | skipTestIf, 13 | }); 14 | -------------------------------------------------------------------------------- /linters/gofmt/gofmt.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest, linterFmtTest } from "tests"; 2 | 3 | // gofmt generates a failure on an empty file 4 | linterCheckTest({ linterName: "gofmt", namedTestPrefixes: ["empty"] }); 5 | 6 | linterFmtTest({ linterName: "gofmt", namedTestPrefixes: ["basic"] }); 7 | -------------------------------------------------------------------------------- /linters/gofmt/test_data/basic.in.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // 🧗. 4 | func main() { 5 | 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /linters/gofmt/test_data/empty.in.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/gofmt/test_data/empty.in.go -------------------------------------------------------------------------------- /linters/gofmt/test_data/gofmt_v1.20.4_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter gofmt test basic 1`] = ` 4 | "package main 5 | 6 | // 🧗. 7 | func main() { 8 | 9 | } 10 | " 11 | `; 12 | -------------------------------------------------------------------------------- /linters/gofmt/test_data/gofmt_v1.20.4_empty.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter gofmt test empty 1`] = ` 4 | { 5 | "issues": [], 6 | "lintActions": [], 7 | "taskFailures": [ 8 | { 9 | "details": StringMatching /\\.\\*\\$/m, 10 | "message": "test_data/empty.in.go", 11 | "name": "gofmt", 12 | }, 13 | ], 14 | "unformattedFiles": [], 15 | } 16 | `; 17 | -------------------------------------------------------------------------------- /linters/gofumpt/gofumpt.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest, linterFmtTest } from "tests"; 2 | 3 | // gofumpt generates a failure on an empty file 4 | linterCheckTest({ linterName: "gofumpt", namedTestPrefixes: ["empty"] }); 5 | 6 | linterFmtTest({ linterName: "gofumpt", namedTestPrefixes: ["basic", "gofumpt"] }); 7 | -------------------------------------------------------------------------------- /linters/gofumpt/test_data/basic.in.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // 🧗. 4 | func main() { 5 | 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /linters/gofumpt/test_data/empty.in.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/gofumpt/test_data/empty.in.go -------------------------------------------------------------------------------- /linters/gofumpt/test_data/gofumpt.in.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func foo() string { 4 | foo := 5 | "bar" 6 | return foo 7 | } 8 | -------------------------------------------------------------------------------- /linters/gofumpt/test_data/gofumpt_v0.5.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter gofumpt test basic 1`] = ` 4 | "package main 5 | 6 | // 🧗. 7 | func main() { 8 | } 9 | " 10 | `; 11 | -------------------------------------------------------------------------------- /linters/gofumpt/test_data/gofumpt_v0.5.0_empty.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter gofumpt test empty 1`] = ` 4 | { 5 | "issues": [], 6 | "lintActions": [], 7 | "taskFailures": [ 8 | { 9 | "details": StringMatching /\\.\\*\\$/m, 10 | "message": "test_data/empty.in.go", 11 | "name": "gofumpt", 12 | }, 13 | ], 14 | "unformattedFiles": [], 15 | } 16 | `; 17 | -------------------------------------------------------------------------------- /linters/gofumpt/test_data/gofumpt_v0.5.0_gofumpt.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter gofumpt test gofumpt 1`] = ` 4 | "package main 5 | 6 | func foo() string { 7 | foo := "bar" 8 | return foo 9 | } 10 | " 11 | `; 12 | -------------------------------------------------------------------------------- /linters/goimports/goimports.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest, linterFmtTest } from "tests"; 2 | 3 | // goimports generates a failure on an empty file 4 | linterCheckTest({ linterName: "goimports", namedTestPrefixes: ["empty"] }); 5 | 6 | linterFmtTest({ linterName: "goimports", namedTestPrefixes: ["basic"] }); 7 | -------------------------------------------------------------------------------- /linters/goimports/test_data/basic.in.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // 🧗. 4 | func main() { 5 | fmt.Println("Hello world"); 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /linters/goimports/test_data/empty.in.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/goimports/test_data/empty.in.go -------------------------------------------------------------------------------- /linters/goimports/test_data/goimports_v0.9.1_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter goimports test basic 1`] = ` 4 | "package main 5 | 6 | import "fmt" 7 | 8 | // 🧗. 9 | func main() { 10 | fmt.Println("Hello world") 11 | 12 | } 13 | " 14 | `; 15 | -------------------------------------------------------------------------------- /linters/goimports/test_data/goimports_v0.9.1_empty.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter goimports test empty 1`] = ` 4 | { 5 | "issues": [], 6 | "lintActions": [ 7 | { 8 | "command": "format", 9 | "fileGroupName": "go", 10 | "linter": "goimports", 11 | "paths": [ 12 | "test_data/empty.in.go", 13 | ], 14 | "verb": "TRUNK_VERB_FMT", 15 | }, 16 | ], 17 | "taskFailures": [], 18 | "unformattedFiles": [], 19 | } 20 | `; 21 | -------------------------------------------------------------------------------- /linters/gokart/gokart.test.ts: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import { customLinterCheckTest, TestCallback } from "tests"; 3 | import { TEST_DATA } from "tests/utils"; 4 | 5 | const preCheck: TestCallback = (driver) => { 6 | driver.moveFile(path.join(TEST_DATA, "go.mod"), "go.mod"); 7 | }; 8 | 9 | customLinterCheckTest({ linterName: "gokart", args: `${TEST_DATA} -y`, preCheck }); 10 | -------------------------------------------------------------------------------- /linters/gokart/test_data/go.mod: -------------------------------------------------------------------------------- 1 | module gokart_linter_test 2 | 3 | go 1.21.1 4 | -------------------------------------------------------------------------------- /linters/golangci-lint/test_data/.golangci2.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | linters: 3 | enable: 4 | - govet 5 | - asciicheck 6 | - bodyclose 7 | - depguard 8 | - dogsled 9 | - errcheck 10 | - gochecknoinits 11 | - godot 12 | - goheader 13 | - goprintffuncname 14 | - gosec 15 | - govet 16 | - ineffassign 17 | - misspell 18 | - nakedret 19 | - nolintlint 20 | - rowserrcheck 21 | - staticcheck 22 | - unconvert 23 | - unused 24 | - whitespace 25 | -------------------------------------------------------------------------------- /linters/golangci-lint/test_data/basic.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "time" 4 | 5 | // ✋✋✋✋ 6 | // this is the main function 🏃 7 | func main() { 8 | time.Parse("asdf", "") 9 | } 10 | -------------------------------------------------------------------------------- /linters/golangci-lint/test_data/go.mod: -------------------------------------------------------------------------------- 1 | module golangcilint_linter_test 2 | 3 | go 1.18 4 | -------------------------------------------------------------------------------- /linters/golangci-lint/test_data/golangci_lint2_v2.0.0_unbuildable.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter golangci-lint2 test unbuildable 1`] = ` 4 | { 5 | "issues": [], 6 | "lintActions": [ 7 | { 8 | "command": "lint", 9 | "fileGroupName": "go", 10 | "linter": "golangci-lint2", 11 | "paths": [ 12 | ".", 13 | ], 14 | "verb": "TRUNK_VERB_CHECK", 15 | }, 16 | ], 17 | "taskFailures": [], 18 | "unformattedFiles": [], 19 | } 20 | `; 21 | -------------------------------------------------------------------------------- /linters/golangci-lint/test_data/unbuildable.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | // The above build constraint forces this package to have no buildable Go files to produce an error in golangci-lint. 4 | 5 | package main 6 | 7 | func main() { 8 | } 9 | -------------------------------------------------------------------------------- /linters/golangci-lint/test_data/unused_func.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func helper() { 6 | fmt.Println("✋ World!") 7 | } 8 | -------------------------------------------------------------------------------- /linters/golangci-lint/test_data/wrapper/printer.go: -------------------------------------------------------------------------------- 1 | package wrapper 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func PrintContents(w Wrapper) { 8 | fmt.Println(w.Str) 9 | } 10 | 11 | // Wrapper2 is missing a type definition that would be imported from another file 12 | func PrintContents2(w Wrapper2) { 13 | fmt.Println(w.Str) 14 | } 15 | -------------------------------------------------------------------------------- /linters/golangci-lint/test_data/wrapper/wrapper.go: -------------------------------------------------------------------------------- 1 | package wrapper 2 | 3 | type Wrapper struct { 4 | Str string 5 | } 6 | -------------------------------------------------------------------------------- /linters/golines/golines.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest, linterFmtTest } from "tests"; 2 | 3 | linterCheckTest({ linterName: "golines", namedTestPrefixes: ["empty"] }); 4 | 5 | linterFmtTest({ linterName: "golines", namedTestPrefixes: ["basic"] }); 6 | -------------------------------------------------------------------------------- /linters/golines/test_data/basic.in.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // 🧗. 4 | func somethingTooLong(ctx context.Context, longArgument string, anotherOne func(time.Duration) bool) (int, error) { 5 | // foo 6 | } 7 | -------------------------------------------------------------------------------- /linters/golines/test_data/empty.in.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/golines/test_data/empty.in.go -------------------------------------------------------------------------------- /linters/golines/test_data/golines_v0.11.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter golines test basic 1`] = ` 4 | "package main 5 | 6 | // 🧗. 7 | func somethingTooLong( 8 | ctx context.Context, 9 | longArgument string, 10 | anotherOne func(time.Duration) bool, 11 | ) (int, error) { 12 | // foo 13 | } 14 | " 15 | `; 16 | -------------------------------------------------------------------------------- /linters/golines/test_data/golines_v0.11.0_empty.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter golines test empty 1`] = ` 4 | { 5 | "issues": [], 6 | "lintActions": [ 7 | { 8 | "command": "format", 9 | "fileGroupName": "go", 10 | "linter": "golines", 11 | "paths": [ 12 | "test_data/empty.in.go", 13 | ], 14 | "verb": "TRUNK_VERB_FMT", 15 | }, 16 | ], 17 | "taskFailures": [], 18 | "unformattedFiles": [], 19 | } 20 | `; 21 | -------------------------------------------------------------------------------- /linters/google-java-format/google-java-format.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | linterFmtTest({ linterName: "google-java-format" }); 4 | -------------------------------------------------------------------------------- /linters/graphql-schema-linter/graphql_schema_linter.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | 3 | linterCheckTest({ linterName: "graphql-schema-linter" }); 4 | -------------------------------------------------------------------------------- /linters/graphql-schema-linter/test_data/comment.in.graphqls: -------------------------------------------------------------------------------- 1 | type Comment { 2 | body: String! 3 | author: User! 4 | } 5 | -------------------------------------------------------------------------------- /linters/graphql-schema-linter/test_data/invalid-ast.in.graphqls: -------------------------------------------------------------------------------- 1 | type Query { 2 | a: String 3 | } 4 | 5 | schema { 6 | query: Query 7 | } 8 | 9 | schema { 10 | mutation: Query 11 | } 12 | -------------------------------------------------------------------------------- /linters/graphql-schema-linter/test_data/user.in.graphqls: -------------------------------------------------------------------------------- 1 | type User { 2 | username: String! 3 | email: String! 4 | } 5 | 6 | extend type Query { 7 | viewer: User! 8 | } 9 | -------------------------------------------------------------------------------- /linters/hadolint/.hadolint.yaml: -------------------------------------------------------------------------------- 1 | # Following source doesn't work in most setups 2 | ignored: 3 | - SC1090 4 | - SC1091 5 | -------------------------------------------------------------------------------- /linters/hadolint/test_data/Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/hadolint/test_data/Dockerfile -------------------------------------------------------------------------------- /linters/hadolint/test_data/Dockerfile.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/hadolint/test_data/Dockerfile.empty -------------------------------------------------------------------------------- /linters/hadolint/test_data/basic.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | RUN true 4 | RUN true 5 | -------------------------------------------------------------------------------- /linters/hadolint/test_data/empty.Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/hadolint/test_data/empty.Dockerfile -------------------------------------------------------------------------------- /linters/hadolint/test_data/nested/Dockerfile.debug: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/hadolint/test_data/nested/Dockerfile.debug -------------------------------------------------------------------------------- /linters/hadolint/test_data/nested/dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/hadolint/test_data/nested/dockerfile -------------------------------------------------------------------------------- /linters/hadolint/test_data/nested/not-dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/hadolint/test_data/nested/not-dockerfile -------------------------------------------------------------------------------- /linters/hadolint/test_data/nested/prefix.Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/hadolint/test_data/nested/prefix.Dockerfile -------------------------------------------------------------------------------- /linters/hadolint/test_data/nested/prefix.Dockerfile.debug: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/hadolint/test_data/nested/prefix.Dockerfile.debug -------------------------------------------------------------------------------- /linters/haml-lint/test_data/basic.haml: -------------------------------------------------------------------------------- 1 | -# Should report issues on line 2 and 3 2 | #PascalCase 3 | %img{ alt: 'A relevant description' } 4 | 5 | - 6 | -------------------------------------------------------------------------------- /linters/haml-lint/test_data/empty.haml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/haml-lint/test_data/empty.haml -------------------------------------------------------------------------------- /linters/isort/.isort.cfg: -------------------------------------------------------------------------------- 1 | [settings] 2 | profile=black 3 | -------------------------------------------------------------------------------- /linters/isort/isort.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | // TODO(Tyler): We will eventually need to add a couple more test cases involving failure modes and other autofixes. 4 | linterFmtTest({ linterName: "isort" }); 5 | -------------------------------------------------------------------------------- /linters/isort/test_data/basic.in.py: -------------------------------------------------------------------------------- 1 | # Sourced from isort docs 2 | from my_lib import Object 3 | 4 | import os 5 | 6 | from my_lib import Object3 7 | 8 | from my_lib import Object2 9 | 10 | import sys 11 | 12 | from third_party import lib15, lib1, lib2, lib3, lib4, lib5, lib6, lib7, lib8, lib9, lib10, lib11, lib12, lib13, lib14 13 | 14 | import sys 15 | 16 | from __future__ import absolute_import 17 | 18 | from third_party import lib3 19 | 20 | print("Hey") 21 | print("yo") 22 | -------------------------------------------------------------------------------- /linters/iwyu/test_data/a.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | void A() {} 3 | -------------------------------------------------------------------------------- /linters/iwyu/test_data/b.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "a.hh" 3 | void B() {} 4 | -------------------------------------------------------------------------------- /linters/iwyu/test_data/c.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "b.hh" 3 | void C() {} 4 | -------------------------------------------------------------------------------- /linters/iwyu/test_data/compile_commands.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "clang -c test.cc", 4 | "file": "test.cc", 5 | "directory": "${EXECUTION_ROOT}" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /linters/iwyu/test_data/include_what_you_use_v0.20_CUSTOM.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter include-what-you-use test CUSTOM 1`] = ` 4 | { 5 | "issues": [], 6 | "lintActions": [ 7 | { 8 | "command": "lint", 9 | "fileGroupName": "c++-source", 10 | "linter": "include-what-you-use", 11 | "paths": [ 12 | "test_data/test.cc", 13 | ], 14 | "verb": "TRUNK_VERB_CHECK", 15 | }, 16 | ], 17 | "taskFailures": [], 18 | "unformattedFiles": [], 19 | } 20 | `; 21 | -------------------------------------------------------------------------------- /linters/iwyu/test_data/include_what_you_use_v0.20_test_data.test.cc.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter include-what-you-use test CUSTOM 1`] = ` 4 | "#include "a.hh" 5 | #include "c.hh" 6 | 7 | inline void F() { 8 | A(); 9 | C(); 10 | } 11 | " 12 | `; 13 | -------------------------------------------------------------------------------- /linters/iwyu/test_data/test.cc: -------------------------------------------------------------------------------- 1 | #include "b.hh" 2 | #include "c.hh" 3 | 4 | inline void F() { 5 | A(); 6 | C(); 7 | } 8 | -------------------------------------------------------------------------------- /linters/ktlint/test_data/basic.in.kt: -------------------------------------------------------------------------------- 1 | class MainActivity : AppCompatActivity() { 2 | 3 | override fun onCreate(savedInstanceState: Bundle?) { 4 | super.onCreate(savedInstanceState) // note the spacing 5 | setContentView(R.layout.activity_main) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /linters/ktlint/test_data/complex.in.kt: -------------------------------------------------------------------------------- 1 | class TestBaselineExtraErrorFile { 2 | { }} 3 | } 4 | -------------------------------------------------------------------------------- /linters/ktlint/test_data/ktlint_v0.43.2_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter ktlint test basic 1`] = ` 4 | "class MainActivity : AppCompatActivity() { 5 | 6 | override fun onCreate(savedInstanceState: Bundle?) { 7 | super.onCreate(savedInstanceState) // note the spacing 8 | setContentView(R.layout.activity_main) 9 | } 10 | } 11 | " 12 | `; 13 | -------------------------------------------------------------------------------- /linters/ktlint/test_data/ktlint_v0.43.2_complex.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter ktlint test complex 1`] = ` 4 | "class TestBaselineExtraErrorFile { 5 | { }} 6 | } 7 | " 8 | `; 9 | -------------------------------------------------------------------------------- /linters/ktlint/test_data/ktlint_v0.48.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter ktlint test basic 1`] = ` 4 | "class MainActivity : AppCompatActivity() { 5 | 6 | override fun onCreate(savedInstanceState: Bundle?) { 7 | super.onCreate(savedInstanceState) // note the spacing 8 | setContentView(R.layout.activity_main) 9 | } 10 | } 11 | " 12 | `; 13 | -------------------------------------------------------------------------------- /linters/ktlint/test_data/ktlint_v0.48.0_complex.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter ktlint test complex 1`] = ` 4 | "class TestBaselineExtraErrorFile { 5 | { }} 6 | } 7 | " 8 | `; 9 | -------------------------------------------------------------------------------- /linters/ktlint/test_data/ktlint_v1.0.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter ktlint test basic 1`] = ` 4 | "class MainActivity : AppCompatActivity() { 5 | override fun onCreate(savedInstanceState: Bundle?) { 6 | super.onCreate(savedInstanceState) // note the spacing 7 | setContentView(R.layout.activity_main) 8 | } 9 | } 10 | " 11 | `; 12 | -------------------------------------------------------------------------------- /linters/ktlint/test_data/ktlint_v1.0.0_complex.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter ktlint test complex 1`] = ` 4 | "class TestBaselineExtraErrorFile { 5 | { }} 6 | } 7 | " 8 | `; 9 | -------------------------------------------------------------------------------- /linters/ktlint/test_data/utf8.in.kt: -------------------------------------------------------------------------------- 1 | package demo 2 | 3 | fun main(args: Array) { 4 | println( 5 | """ 6 | ┌───────────┬───────────┬────────────┐ 7 | │ BLOCK │ FORM │ ADDED_DATE │ 8 | ├───────────┼───────────┼────────────┤ 9 | │ 1.1.1.1/1 │ trunca… │ 1111-01-01 │ 10 | │ 2.2.2.2/2 │ OtherForm │ 1212-12-12 │ 11 | └───────────┴───────────┴────────────┘ 12 | """.trimIndent() 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /linters/kube-linter/kube_linter.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | import { osTimeoutMultiplier } from "tests/utils"; 3 | 4 | jest.setTimeout(900000 * osTimeoutMultiplier); 5 | 6 | // TODO(Tyler): We will eventually need to add a couple more test cases involving failure modes. 7 | linterCheckTest({ linterName: "kube-linter" }); 8 | -------------------------------------------------------------------------------- /linters/markdown-link-check/markdown-link-check.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | 3 | const manualVersionReplacer = (version: string) => { 4 | if (version === "3.12.1") { 5 | // As of 3/19, 3.12.1 cannot check for anchors, so we view it as a bad version. 6 | return "3.11.2"; 7 | } 8 | return version; 9 | }; 10 | 11 | linterCheckTest({ linterName: "markdown-link-check", manualVersionReplacer }); 12 | -------------------------------------------------------------------------------- /linters/markdown-link-check/test_data/basic.in.md: -------------------------------------------------------------------------------- 1 | [Good link](#test-header) 2 | [Good link](https://www.google.com) 3 | [Bad link](#bad-header) 4 | [Bad link](https://nowhere.com/bad-link) 5 | 6 | 7 | ## test-header 8 | -------------------------------------------------------------------------------- /linters/markdown-table-prettify/markdown_table_prettify.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | linterFmtTest({ linterName: "markdown-table-prettify" }); 4 | -------------------------------------------------------------------------------- /linters/markdown-table-prettify/test_data/basic.in.md: -------------------------------------------------------------------------------- 1 | # Hello world 2 | 3 | Type|Size(bit)|Wrapper Class 4 | -|-|- 5 | byte|8|Byte 6 | char|16|Character 7 | -------------------------------------------------------------------------------- /linters/markdown-table-prettify/test_data/markdown_table_prettify_v3.6.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter markdown-table-prettify test basic 1`] = ` 4 | "# Hello world 5 | 6 | Type | Size(bit) | Wrapper Class 7 | -----|-----------|-------------- 8 | byte | 8 | Byte 9 | char | 16 | Character" 10 | `; 11 | -------------------------------------------------------------------------------- /linters/markdownlint-cli2/markdownlint.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | 3 | linterCheckTest({ linterName: "markdownlint-cli2" }); 4 | -------------------------------------------------------------------------------- /linters/markdownlint-cli2/test_data/.markdownlint-cli2.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "extends": "markdownlint/style/prettier" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /linters/markdownlint-cli2/test_data/basic.in.md: -------------------------------------------------------------------------------- 1 | # bad.md 2 | 3 | # This file fails some rules 4 | 5 | Line is OK- Make a realy long line that breaks the layout rules completely. Make a realy long line 6 | that breaks 7 | But this should be ignored because of config 8 | 9 | 10 | Line is too long (over 120) A B C D E F G A B C D E F G A B C D E F G A B C D E F G A B C D E F G A 11 | B C D E F G A B C D E F G A B C D E F G 12 | -------------------------------------------------------------------------------- /linters/markdownlint/.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | # Prettier friendly markdownlint config (all formatting rules disabled) 2 | extends: markdownlint/style/prettier 3 | -------------------------------------------------------------------------------- /linters/markdownlint/markdownlint.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | 3 | linterCheckTest({ linterName: "markdownlint" }); 4 | -------------------------------------------------------------------------------- /linters/markdownlint/test_data/basic.in.md: -------------------------------------------------------------------------------- 1 | # bad.md 2 | 3 | # This file fails some rules 4 | 5 | Line is OK- Make a realy long line that breaks the layout rules completely. Make a realy long line 6 | that breaks 7 | But this should be ignored because of config 8 | 9 | 10 | Line is too long (over 120) A B C D E F G A B C D E F G A B C D E F G A B C D E F G A B C D E F G A 11 | B C D E F G A B C D E F G A B C D E F G 12 | -------------------------------------------------------------------------------- /linters/mypy/mypy.test.ts: -------------------------------------------------------------------------------- 1 | import { customLinterCheckTest } from "tests"; 2 | import { TEST_DATA } from "tests/utils"; 3 | 4 | // mypy doesn't use semver versioning, so we need to pass a custom callback. 5 | // Examples of mypy versions include 0.4, 0.4.4, 0.470, 0.991, but only the one-decimal ones are released through pip 6 | const versionGreaterThanOrEqual = (a: string, b: string) => [a.split(".")] >= [b.split(".")]; 7 | 8 | customLinterCheckTest({ 9 | linterName: "mypy", 10 | args: TEST_DATA, 11 | versionGreaterThanOrEqual, 12 | }); 13 | -------------------------------------------------------------------------------- /linters/mypy/test_data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/mypy/test_data/__init__.py -------------------------------------------------------------------------------- /linters/mypy/test_data/basic.py: -------------------------------------------------------------------------------- 1 | import google.protobuf.descriptor_pb2 as d 2 | 3 | from . import mypy_import2 4 | 5 | def greeting(name: str) -> str: 6 | return "Hello " + name 7 | 8 | 9 | def printer() -> None: 10 | print("Hello") 11 | 12 | 13 | greeting(3) 14 | greeting(b"Alice") 15 | a = printer() 16 | c: str = 4 17 | 18 | from source import Bar 19 | 20 | def bad_foo(bar: Bar) -> str: 21 | return bar.a + bar.b 22 | -------------------------------------------------------------------------------- /linters/mypy/test_data/source.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | @dataclass 4 | class Bar: 5 | a: int 6 | b: int 7 | 8 | def bad_function() -> int: 9 | print("returns nothing") 10 | -------------------------------------------------------------------------------- /linters/nancy/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eux 4 | 5 | go list -json -deps ./... | nancy sleuth --output=json --skip-update-check 6 | -------------------------------------------------------------------------------- /linters/nancy/test_data/README.md: -------------------------------------------------------------------------------- 1 | # Testing 2 | 3 | Ported directly from [intentionally-vulnerable-golang-project](https://github.com/sonatype-nexus-community/intentionally-vulnerable-golang-project/tree/master) for testing. 4 | -------------------------------------------------------------------------------- /linters/nancy/test_data/nancy_v1.0.41_CUSTOM.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter nancy test CUSTOM 1`] = ` 4 | { 5 | "issues": [], 6 | "lintActions": [ 7 | { 8 | "command": "lint", 9 | "fileGroupName": "go-lockfile", 10 | "linter": "nancy", 11 | "paths": [ 12 | ".", 13 | ], 14 | "verb": "TRUNK_VERB_CHECK", 15 | }, 16 | ], 17 | "taskFailures": [], 18 | "unformattedFiles": [], 19 | } 20 | `; 21 | -------------------------------------------------------------------------------- /linters/nixpkgs-fmt/nixpkgs_fmt.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | import { osTimeoutMultiplier, skipOS } from "tests/utils"; 3 | 4 | jest.setTimeout(600000 * osTimeoutMultiplier); 5 | 6 | linterFmtTest({ linterName: "nixpkgs-fmt", skipTestIf: skipOS(["win32"]) }); 7 | -------------------------------------------------------------------------------- /linters/nixpkgs-fmt/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | lint: 3 | definitions: 4 | - name: nixpkgs-fmt 5 | supported_platforms: [linux, macos] 6 | package: nixpkgs-fmt 7 | runtime: rust 8 | files: [nix] 9 | description: Formatter for Nix 10 | commands: 11 | - output: rewrite 12 | run: nixpkgs-fmt ${target} 13 | success_codes: [0] 14 | in_place: true 15 | batch: true 16 | formatter: true 17 | 18 | suggest_if: files_present 19 | known_good_version: 1.3.0 20 | -------------------------------------------------------------------------------- /linters/nixpkgs-fmt/test_data/nixpkgs_fmt_v1.3.0_test.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter nixpkgs-fmt test test 1`] = ` 4 | "{ 5 | f = 6 | { x 7 | , y 8 | }: body; 9 | 10 | testAllTrue = expr: { inherit expr; expected = map (x: true) expr; }; 11 | } 12 | " 13 | `; 14 | -------------------------------------------------------------------------------- /linters/nixpkgs-fmt/test_data/test.in.nix: -------------------------------------------------------------------------------- 1 | { 2 | f = { x 3 | , y 4 | }: body; 5 | 6 | testAllTrue = expr: {inherit expr;expected=map (x: true) expr; }; 7 | } 8 | -------------------------------------------------------------------------------- /linters/opa/opa.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | linterFmtTest({ linterName: "opa" }); 4 | -------------------------------------------------------------------------------- /linters/opa/test_data/basic.in.rego: -------------------------------------------------------------------------------- 1 | package authz 2 | 3 | import rego.v1 4 | 5 | default allow=false 6 | 7 | allow if { 8 | isEmployee 9 | "developer" in input.user.roles 10 | } 11 | 12 | isEmployee if regex.match("@acmecorp\\.com$", input.user.email) 13 | -------------------------------------------------------------------------------- /linters/opa/test_data/opa_v0.62.1_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter opa test basic 1`] = ` 4 | "package authz 5 | 6 | import rego.v1 7 | 8 | default allow = false 9 | 10 | allow if { 11 | isEmployee 12 | "developer" in input.user.roles 13 | } 14 | 15 | isEmployee if regex.match("@acmecorp\\\\.com$", input.user.email) 16 | " 17 | `; 18 | -------------------------------------------------------------------------------- /linters/opa/test_data/opa_v1.0.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | // trunk-upgrade-validation:RELEASE 3 | 4 | exports[`Testing formatter opa test basic 1`] = ` 5 | "package authz 6 | 7 | import rego.v1 8 | 9 | default allow := false 10 | 11 | allow if { 12 | isEmployee 13 | "developer" in input.user.roles 14 | } 15 | 16 | isEmployee if regex.match("@acmecorp\\\\.com$", input.user.email) 17 | " 18 | `; 19 | -------------------------------------------------------------------------------- /linters/osv-scanner/test_data/Cargo.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "mio" 3 | version = "0.8.10" 4 | source = "registry+https://github.com/rust-lang/crates.io-index" 5 | checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" 6 | dependencies = [ 7 | "libc", 8 | "wasi", 9 | "windows-sys 0.48.0", 10 | ] 11 | -------------------------------------------------------------------------------- /linters/osv-scanner/test_data/requirements.txt: -------------------------------------------------------------------------------- 1 | pillow==9.1.1 2 | langchain==0.0.171 3 | -------------------------------------------------------------------------------- /linters/osv-scanner/test_data/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | balanced-match@^1.0.0: 5 | version "1.0.2" 6 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" 7 | integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== 8 | -------------------------------------------------------------------------------- /linters/oxipng/test_data/bad.png: -------------------------------------------------------------------------------- 1 | abcdefghijk -------------------------------------------------------------------------------- /linters/oxipng/test_data/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/oxipng/test_data/empty.txt -------------------------------------------------------------------------------- /linters/oxipng/test_data/good.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/oxipng/test_data/good.png -------------------------------------------------------------------------------- /linters/oxipng/test_data/oxipng_v7.0.0_basic.test_data.empty.txt.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter oxipng test basic 1`] = `""`; 4 | -------------------------------------------------------------------------------- /linters/oxipng/test_data/oxipng_v7.0.0_malformed.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter oxipng test malformed 1`] = ` 4 | { 5 | "issues": [], 6 | "lintActions": [], 7 | "taskFailures": [ 8 | { 9 | "details": StringMatching /\\.\\*\\$/m, 10 | "message": "test_data/bad.png", 11 | "name": "oxipng", 12 | }, 13 | ], 14 | "unformattedFiles": [], 15 | } 16 | `; 17 | -------------------------------------------------------------------------------- /linters/perlcritic/.perlcriticrc: -------------------------------------------------------------------------------- 1 | severity = 3 2 | verbose = [%s %p] %m at %f:%l:%c, near '%r'\n 3 | -------------------------------------------------------------------------------- /linters/perlcritic/perlcritic.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | linterCheckTest({ 5 | linterName: "perlcritic", 6 | namedTestPrefixes: ["basic"], 7 | skipTestIf: skipOS(["win32"]), 8 | }); 9 | -------------------------------------------------------------------------------- /linters/perlcritic/test_data/basic.in.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | print "Hello, World!\n" 4 | -------------------------------------------------------------------------------- /linters/perltidy/.perltidyrc: -------------------------------------------------------------------------------- 1 | --perl-best-practices 2 | -------------------------------------------------------------------------------- /linters/perltidy/perltidy.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | linterFmtTest({ 5 | linterName: "perltidy", 6 | namedTestPrefixes: ["basic"], 7 | skipTestIf: skipOS(["win32"]), 8 | }); 9 | -------------------------------------------------------------------------------- /linters/perltidy/test_data/basic.in.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | print "Hello, World!\n" 4 | -------------------------------------------------------------------------------- /linters/perltidy/test_data/perltidy_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter perltidy test basic 1`] = ` 4 | "#!/usr/bin/perl 5 | 6 | print "Hello, World!\\n" 7 | " 8 | `; 9 | -------------------------------------------------------------------------------- /linters/php-cs-fixer/php-cs-fixer.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | linterFmtTest({ 4 | linterName: "php-cs-fixer", 5 | // Next release will include support for php@8.4 6 | // https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/tag/v3.65.0 7 | skipTestIf: () => true, 8 | // skipTestIf: skipOS(["win32"]), 9 | }); 10 | -------------------------------------------------------------------------------- /linters/php-cs-fixer/test_data/basic.in.php: -------------------------------------------------------------------------------- 1 | format('j. n. Y'); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /linters/php-cs-fixer/test_data/php_cs_fixer_v3.54.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter php-cs-fixer test basic 1`] = ` 4 | "format('j. n. Y'); 19 | } 20 | } 21 | " 22 | `; 23 | -------------------------------------------------------------------------------- /linters/phpstan/phpstan.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | linterCheckTest({ linterName: "phpstan", skipTestIf: skipOS(["win32"]) }); 5 | -------------------------------------------------------------------------------- /linters/phpstan/test_data/basic.in.php: -------------------------------------------------------------------------------- 1 | format('j. n. Y'); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /linters/pmd/pmd.test.ts: -------------------------------------------------------------------------------- 1 | import semver from "semver"; 2 | import { customLinterCheckTest } from "tests"; 3 | import { TEST_DATA } from "tests/utils"; 4 | 5 | const versionGreaterThanOrEqual = (a: string, b: string) => { 6 | const normalizedA = a.replace("pmd_releases/", ""); 7 | const normalizedB = b.replace("pmd_releases/", ""); 8 | return semver.gte(normalizedA, normalizedB); 9 | }; 10 | 11 | customLinterCheckTest({ 12 | linterName: "pmd", 13 | args: TEST_DATA, 14 | versionGreaterThanOrEqual, 15 | }); 16 | -------------------------------------------------------------------------------- /linters/pmd/test_data/apex.in.cls: -------------------------------------------------------------------------------- 1 | global class HelloWorld { 2 | public String hello() { 3 | return 'Hello World!'; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /linters/pmd/test_data/hello.in.java: -------------------------------------------------------------------------------- 1 | // Your First Program 2 | 3 | class HelloWorld { 4 | public static void main(String[] args) { 5 | System.out.println("Hello, World!"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /linters/pragma-once/README.md: -------------------------------------------------------------------------------- 1 | # pragma-once 2 | 3 | Formatter that ensures every header file begins with `#pragma once` 4 | -------------------------------------------------------------------------------- /linters/pragma-once/fix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | LINT_TARGET="${1}" 5 | 6 | # NOTE(sam): implementing this with `batch: true` is a bit non-trivial (impl would be a 7 | # slightly-more-than-trivial awk program that modifies files in place). 8 | if ! grep --quiet '^#pragma once$' "${LINT_TARGET}"; then 9 | echo "#pragma once" 10 | fi 11 | 12 | cat "${LINT_TARGET}" 13 | -------------------------------------------------------------------------------- /linters/pragma-once/pragma_once.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | // A simple formatter test to run 'pragma-once' on 'test_data/basic.in.hh' 4 | linterFmtTest({ linterName: "pragma-once" }); 5 | -------------------------------------------------------------------------------- /linters/pragma-once/test_data/basic.in.hh: -------------------------------------------------------------------------------- 1 | void myFunc(); 2 | -------------------------------------------------------------------------------- /linters/pragma-once/test_data/pragma_once_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter pragma-once test basic 1`] = ` 4 | "#pragma once 5 | void myFunc(); 6 | " 7 | `; 8 | -------------------------------------------------------------------------------- /linters/pre-commit-hooks/README.md: -------------------------------------------------------------------------------- 1 | # Pre-Commit-Hooks 2 | 3 | The set of formatter and linters in this suite are disabled by default. Some of the 4 | linters/formatters have different conflicting outputs. 5 | 6 | To enabled, add the list of checks you want in your trunk.yaml as such: 7 | 8 | ```yaml 9 | lint: 10 | enabled: 11 | - pre-commit-hooks@4.4.0: 12 | commands: 13 | - end-of-file-fixer 14 | ``` 15 | -------------------------------------------------------------------------------- /linters/pre-commit-hooks/test_data/end-of-file-fixer.in.txt: -------------------------------------------------------------------------------- 1 | This is a file without a new line 2 | -------------------------------------------------------------------------------- /linters/pre-commit-hooks/test_data/pre_commit_hooks_v4.4.0_end-of-file-fixer.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter pre-commit-hooks test end-of-file-fixer 1`] = ` 4 | "This is a file without a new line 5 | " 6 | `; 7 | -------------------------------------------------------------------------------- /linters/prisma/prisma.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | linterFmtTest({ linterName: "prisma" }); 4 | -------------------------------------------------------------------------------- /linters/psscriptanalyzer/test_data/check.in.ps1: -------------------------------------------------------------------------------- 1 | Write-Host "Hello" 2 | -------------------------------------------------------------------------------- /linters/psscriptanalyzer/test_data/format.in.ps1: -------------------------------------------------------------------------------- 1 | Write-Host "Hello"; 2 | -------------------------------------------------------------------------------- /linters/psscriptanalyzer/test_data/psscriptanalyzer_v1.21.0_format.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter psscriptanalyzer test format 1`] = ` 4 | "Write-Host "Hello"; 5 | " 6 | `; 7 | 8 | exports[`Testing formatter psscriptanalyzer test format 2`] = ` 9 | "Write-Host "Hello" 10 | " 11 | `; 12 | -------------------------------------------------------------------------------- /linters/pylint/test_data/.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | disable= 3 | format, # Handled by Black autoformatter 4 | enable=I0010 5 | 6 | [MESSAGES CONTROL] 7 | -------------------------------------------------------------------------------- /linters/pylint/test_data/basic.in.py: -------------------------------------------------------------------------------- 1 | import string 2 | 3 | shift = 3 4 | choice = raw_input("would you like to encode or decode?") 5 | word = raw_input("Please enter text") 6 | letters = string.ascii_letters + string.punctuation + string.digits 7 | encoded = "" 8 | -------------------------------------------------------------------------------- /linters/pylint/test_data/empty.in.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/pylint/test_data/empty.in.py -------------------------------------------------------------------------------- /linters/pylint/test_data/severity.py: -------------------------------------------------------------------------------- 1 | 2 | # This should only raise a diagnostic because of .pylintrc, 3 | # and it should have a level of INFO, which must be correctly parsed. 4 | # 2:[bad-inline-option] 5 | # pylint: disable line-too-long 6 | 7 | def foo(): 8 | return "bar" 9 | -------------------------------------------------------------------------------- /linters/pyright/pyright.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | 3 | linterCheckTest({ linterName: "pyright" }); 4 | -------------------------------------------------------------------------------- /linters/regal/regal.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | 3 | linterCheckTest({ linterName: "regal" }); 4 | -------------------------------------------------------------------------------- /linters/regal/test_data/basic.in.rego: -------------------------------------------------------------------------------- 1 | package authz 2 | 3 | import rego.v1 4 | 5 | default allow = false 6 | 7 | allow if { 8 | isEmployee 9 | "developer" in input.user.roles 10 | } 11 | 12 | isEmployee if regex.match("@acmecorp\\.com$", input.user.email) 13 | -------------------------------------------------------------------------------- /linters/remark-lint/.remarkrc.yaml: -------------------------------------------------------------------------------- 1 | plugins: 2 | remark-preset-lint-consistent: true 3 | remark-preset-lint-recommended: true 4 | remark-lint-list-item-indent: true 5 | -------------------------------------------------------------------------------- /linters/remark-lint/remark_lint.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest, linterFmtTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | linterFmtTest({ linterName: "remark-lint", skipTestIf: skipOS(["win32"]) }); 5 | 6 | linterCheckTest({ linterName: "remark-lint", skipTestIf: skipOS(["win32"]) }); 7 | -------------------------------------------------------------------------------- /linters/remark-lint/test_data/basic.in.md: -------------------------------------------------------------------------------- 1 | * this is a list item 2 | indented with tabs 3 | 4 | * this is a list item 5 | indented with spaces 6 | 7 | Code: 8 | 9 | this code block is indented by one tab 10 | 11 | And: 12 | 13 | this code block is indented by two tabs 14 | 15 | And: 16 | 17 | + this is an example list item 18 | indented with tabs 19 | 20 | + this is an example list item 21 | indented with spaces 22 | -------------------------------------------------------------------------------- /linters/renovate/renovate.test.ts: -------------------------------------------------------------------------------- 1 | import { customLinterCheckTest } from "tests"; 2 | import { osTimeoutMultiplier, TEST_DATA } from "tests/utils"; 3 | 4 | jest.setTimeout(600000 * osTimeoutMultiplier); 5 | 6 | customLinterCheckTest({ 7 | linterName: "renovate", 8 | args: TEST_DATA, 9 | }); 10 | -------------------------------------------------------------------------------- /linters/renovate/test_data/.renovaterc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:base"], 4 | "prConcurrentLimit": 3, 5 | "packageRules": [ 6 | { 7 | "groupName": "all non-major dependencies", 8 | "groupSlug": "all-minor-patch", 9 | "matchPackagePatterns": ["*"], 10 | "matchUpdateTypes": ["minor", "patch"] 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /linters/renovate/test_data/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:base"], 4 | "packageRules": [ 5 | { 6 | "groupName": "all non-major dependencies", 7 | "groupSlug": "all-minor-patch", 8 | "matchPackagePatterns": ["*"], 9 | "matchUpdateTyped_badInfo": ["minor", "patch"] 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /linters/renovate/test_data/renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:base"], 4 | "packageRules": [ 5 | { 6 | "groupName": "all non-major dependencies", 7 | "groupSlug": "all-minor-patch", 8 | "matchPackagePatterns": ["*"], 9 | "matchUpdateTyped_badInfo": ["minor", "patch"] 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /linters/rome/rome.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest, linterFmtTest } from "tests"; 2 | 3 | // TODO(Tyler): We will eventually need to add a couple more test cases involving failure modes and other autofixes. 4 | linterCheckTest({ linterName: "rome", namedTestPrefixes: ["basic_check"] }); 5 | 6 | linterFmtTest({ linterName: "rome", namedTestPrefixes: ["basic_fmt"] }); 7 | -------------------------------------------------------------------------------- /linters/rome/test_data/basic_check.in.ts: -------------------------------------------------------------------------------- 1 | const foobar = () => { } 2 | const barfoo = () => { } 3 | 4 | enum Bar { Baz }; 5 | 6 | const foo = (bar: Bar) => { 7 | switch (bar) { 8 | case Bar.Baz: 9 | foobar(); 10 | barfoo(); 11 | break; 12 | } 13 | { !foo ? null : 1 } 14 | } 15 | -------------------------------------------------------------------------------- /linters/rome/test_data/basic_fmt.in.ts: -------------------------------------------------------------------------------- 1 | const foobar = () => { } 2 | const barfoo = () => { } 3 | 4 | enum Bar { Baz }; 5 | 6 | const foo = (bar: Bar) => { 7 | switch (bar) { 8 | case Bar.Baz: 9 | foobar(); 10 | barfoo(); 11 | break; 12 | } 13 | { !foo ? null : 1 } 14 | } 15 | -------------------------------------------------------------------------------- /linters/rome/test_data/rome_v10.0.1_basic_fmt.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter rome test basic_fmt 1`] = ` 4 | "const foobar = () => {}; 5 | const barfoo = () => {}; 6 | 7 | enum Bar { 8 | Baz, 9 | } 10 | 11 | const foo = (bar: Bar) => { 12 | switch (bar) { 13 | case Bar.Baz: 14 | foobar(); 15 | barfoo(); 16 | break; 17 | } 18 | { 19 | !foo ? null : 1; 20 | } 21 | }; 22 | " 23 | `; 24 | -------------------------------------------------------------------------------- /linters/rome/test_data/rome_v11.0.0_basic_fmt.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter rome test basic_fmt 1`] = ` 4 | "const foobar = () => {}; 5 | const barfoo = () => {}; 6 | 7 | enum Bar { 8 | Baz, 9 | } 10 | 11 | const foo = (bar: Bar) => { 12 | switch (bar) { 13 | case Bar.Baz: 14 | foobar(); 15 | barfoo(); 16 | break; 17 | } 18 | { 19 | !foo ? null : 1; 20 | } 21 | }; 22 | " 23 | `; 24 | -------------------------------------------------------------------------------- /linters/rome/test_data/rome_v12.0.0_basic_fmt.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter rome test basic_fmt 1`] = ` 4 | "const foobar = () => {}; 5 | const barfoo = () => {}; 6 | 7 | enum Bar { 8 | Baz, 9 | } 10 | 11 | const foo = (bar: Bar) => { 12 | switch (bar) { 13 | case Bar.Baz: 14 | foobar(); 15 | barfoo(); 16 | break; 17 | } 18 | { 19 | !foo ? null : 1; 20 | } 21 | }; 22 | " 23 | `; 24 | -------------------------------------------------------------------------------- /linters/rome/test_data/rome_v12.1.0_basic_fmt.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter rome test basic_fmt 1`] = ` 4 | "const foobar = () => {}; 5 | const barfoo = () => {}; 6 | 7 | enum Bar { 8 | Baz, 9 | } 10 | 11 | const foo = (bar: Bar) => { 12 | switch (bar) { 13 | case Bar.Baz: 14 | foobar(); 15 | barfoo(); 16 | break; 17 | } 18 | { 19 | !foo ? null : 1; 20 | } 21 | }; 22 | " 23 | `; 24 | -------------------------------------------------------------------------------- /linters/rubocop/test_data/basic.rb: -------------------------------------------------------------------------------- 1 | class Plumbus 2 | private 3 | 4 | 5 | 6 | 7 | 8 | 9 | def smooth; end 10 | end 11 | 12 | Klass.( 13 | key_1: 'hello', 14 | key_2: 'world' 15 | ) 16 | -------------------------------------------------------------------------------- /linters/rubocop/test_data/rubocop_v1.39.0_basic.test_data.basic.rb.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter rubocop test basic 1`] = ` 4 | "class Plumbus 5 | private 6 | 7 | def smooth; end 8 | end 9 | 10 | Klass.( 11 | key_1: 'hello', 12 | key_2: 'world' 13 | ) 14 | " 15 | `; 16 | -------------------------------------------------------------------------------- /linters/ruff/ruff.toml: -------------------------------------------------------------------------------- 1 | # Generic, formatter-friendly config. 2 | select = ["B", "D3", "E", "F"] 3 | 4 | # Never enforce `E501` (line length violations). This should be handled by formatters. 5 | ignore = ["E501"] 6 | -------------------------------------------------------------------------------- /linters/ruff/test_data/basic.in.py: -------------------------------------------------------------------------------- 1 | def main(): 2 | try: 3 | pass 4 | except (Exception, TypeError): 5 | pass 6 | 7 | import sys 8 | # trunk-ignore(ruff/F401) 9 | import json 10 | 11 | class NoDocstring(object): 12 | def __init__(self, arg1): 13 | self._attr1 = arg1 14 | 15 | class Globe(object): 16 | def __init__(self): 17 | self.shape = 'spheroid' 18 | -------------------------------------------------------------------------------- /linters/ruff/test_data/format.in.py: -------------------------------------------------------------------------------- 1 | 2 | #whitespace below vvv 3 | 4 | #A malindented comment 5 | if __name__ == "__main__" : 6 | a=4+1 7 | b=( 2*7 ) 8 | c = [1, 9 | 2, 10 | 3 11 | ] 12 | print(a/b) 13 | -------------------------------------------------------------------------------- /linters/ruff/test_data/ruff_v0.2.1_basic_nb.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter ruff test basic_nb 1`] = ` 4 | { 5 | "issues": [], 6 | "lintActions": [], 7 | "taskFailures": [], 8 | "unformattedFiles": [], 9 | } 10 | `; 11 | -------------------------------------------------------------------------------- /linters/ruff/test_data/ruff_v0.2.1_format.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter ruff test format 1`] = ` 4 | "# whitespace below vvv 5 | 6 | # A malindented comment 7 | if __name__ == "__main__": 8 | a = 4 + 1 9 | b = 2 * 7 10 | c = [1, 2, 3] 11 | print(a / b) 12 | " 13 | `; 14 | -------------------------------------------------------------------------------- /linters/ruff/test_data/syntax.in.py: -------------------------------------------------------------------------------- 1 | def f(): { 2 | -------------------------------------------------------------------------------- /linters/rufo/test_data/basic.rb: -------------------------------------------------------------------------------- 1 | class Plumbus 2 | private 3 | 4 | 5 | 6 | 7 | 8 | 9 | def smooth; end 10 | end 11 | -------------------------------------------------------------------------------- /linters/rufo/test_data/empty.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/rufo/test_data/empty.rb -------------------------------------------------------------------------------- /linters/rufo/test_data/rufo_v0.13.0_basic.test_data.basic.rb.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter rufo test basic 1`] = ` 4 | "class Plumbus 5 | private 6 | 7 | def smooth; end 8 | end 9 | " 10 | `; 11 | -------------------------------------------------------------------------------- /linters/rustfmt/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | edition = "2021" 2 | -------------------------------------------------------------------------------- /linters/rustfmt/rustfmt.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest, linterFmtTest } from "tests"; 2 | 3 | // rustfmt succeeds on empty files 4 | linterCheckTest({ linterName: "rustfmt", namedTestPrefixes: ["empty"] }); 5 | 6 | linterFmtTest({ linterName: "rustfmt", namedTestPrefixes: ["basic"] }); 7 | -------------------------------------------------------------------------------- /linters/rustfmt/test_data/basic.in.rs: -------------------------------------------------------------------------------- 1 | fn hey_now() { 2 | return "you're an all star"; 3 | } 4 | 5 | fn get_your_game_on() { 6 | return "go play"; 7 | } 8 | 9 | fn main() { 10 | println!("Hey now, you're a rock star, get the show on, get paid"); 11 | } 12 | -------------------------------------------------------------------------------- /linters/rustfmt/test_data/empty.in.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/rustfmt/test_data/empty.in.rs -------------------------------------------------------------------------------- /linters/rustfmt/test_data/rustfmt_v1.65.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter rustfmt test basic 1`] = ` 4 | "fn hey_now() { 5 | return "you're an all star"; 6 | } 7 | 8 | fn get_your_game_on() { 9 | return "go play"; 10 | } 11 | 12 | fn main() { 13 | println!("Hey now, you're a rock star, get the show on, get paid"); 14 | } 15 | " 16 | `; 17 | -------------------------------------------------------------------------------- /linters/scalafmt/test_data/basic.in.scala: -------------------------------------------------------------------------------- 1 | case class Demo(a: String, 2 | b: Int, 3 | c: Char 4 | ) 5 | -------------------------------------------------------------------------------- /linters/scalafmt/test_data/empty.in.scala: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/scalafmt/test_data/empty.in.scala -------------------------------------------------------------------------------- /linters/scalafmt/test_data/scalafmt_v3.4.3_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter scalafmt test basic 1`] = ` 4 | "case class Demo(a: String, b: Int, c: Char) 5 | " 6 | `; 7 | -------------------------------------------------------------------------------- /linters/scalafmt/test_data/scalafmt_v3.9.1_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | // trunk-upgrade-validation:RELEASE 3 | 4 | exports[`Testing formatter scalafmt test basic 1`] = ` 5 | "case class Demo(a: String, b: Int, c: Char) 6 | " 7 | `; 8 | -------------------------------------------------------------------------------- /linters/semgrep/test_data/basic.go: -------------------------------------------------------------------------------- 1 | package bad_code 2 | 3 | import ( 4 | "crypto/md5" 5 | ) 6 | 7 | func Md5Sum(text string) string { 8 | hasher := md5.New() 9 | return "" 10 | } 11 | 12 | func foo() { 13 | // Note that the Go parser parses this to a Cast of a ParenExpr 14 | x := f([]int("foo")) 15 | 16 | // ruleid: cast-symbol-prop 17 | sink(x) 18 | } 19 | -------------------------------------------------------------------------------- /linters/semgrep/test_data/element.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/jsx-props-no-spreading */ 2 | import React, { ReactElement } from "react"; 3 | 4 | export default function Bad(): ReactElement { 5 | return
; 6 | } 7 | -------------------------------------------------------------------------------- /linters/semgrep/test_data/empty_go.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/semgrep/test_data/empty_go.go -------------------------------------------------------------------------------- /linters/semgrep/test_data/empty_js.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/semgrep/test_data/empty_js.js -------------------------------------------------------------------------------- /linters/semgrep/test_data/empty_py.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/semgrep/test_data/empty_py.py -------------------------------------------------------------------------------- /linters/semgrep/test_data/request.py: -------------------------------------------------------------------------------- 1 | 2 | def unvalidated_value(request): 3 | value = request.GET.get('something') 4 | function = globals().get(value) 5 | 6 | if function: 7 | return function(request) 8 | -------------------------------------------------------------------------------- /linters/shellcheck/.shellcheckrc: -------------------------------------------------------------------------------- 1 | enable=all 2 | source-path=SCRIPTDIR 3 | disable=SC2154 4 | 5 | # If you're having issues with shellcheck following source, disable the errors via: 6 | # disable=SC1090 7 | # disable=SC1091 8 | -------------------------------------------------------------------------------- /linters/shellcheck/shellcheck.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | linterCheckTest({ linterName: "shellcheck", skipTestIf: skipOS(["win32"]) }); 5 | -------------------------------------------------------------------------------- /linters/shellcheck/test_data/basic.in.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | if [ "$(uname)" == "Darwin" ]; then 6 | platform="mac" 7 | elif [ "$(uname)" == "Linux" ]; then 8 | platform="linux" 9 | fi 10 | 11 | output=$(my current platform is $platform) 12 | echo $output 13 | -------------------------------------------------------------------------------- /linters/shellcheck/test_data/empty.in.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/shellcheck/test_data/empty.in.sh -------------------------------------------------------------------------------- /linters/shellcheck/test_data/unicode.in.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | greeting=$(✋ Hello! ✋) 5 | 6 | echo $greeting 7 | -------------------------------------------------------------------------------- /linters/shfmt/test_data/basic.in.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | num=`awk '{print $1}' $i` 3 | if (( $num >= 1000 )); then # potential CPU hogs? 4 | -------------------------------------------------------------------------------- /linters/shfmt/test_data/empty.in.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/shfmt/test_data/empty.in.sh -------------------------------------------------------------------------------- /linters/shfmt/test_data/shfmt_v3.6.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter shfmt test basic 1`] = ` 4 | "#!/bin/bash 5 | num=\`awk '{print $1}' $i\` 6 | if (( $num >= 1000 )); then # potential CPU hogs? 7 | " 8 | `; 9 | -------------------------------------------------------------------------------- /linters/snyk/snyk.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest } from "tests"; 2 | 3 | // Requires SNYK_TOKEN to run 4 | linterCheckTest({ linterName: "snyk" }); 5 | -------------------------------------------------------------------------------- /linters/sort-package-json/test_data/sort_package_json_v2.1.0_CUSTOM.check.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing linter sort-package-json test CUSTOM 1`] = ` 4 | { 5 | "issues": [], 6 | "lintActions": [], 7 | "taskFailures": [ 8 | { 9 | "details": StringMatching /\\.\\*\\$/m, 10 | "message": "test_data/package.json", 11 | "name": "sort-package-json", 12 | }, 13 | ], 14 | "unformattedFiles": [], 15 | } 16 | `; 17 | -------------------------------------------------------------------------------- /linters/sourcery/test_data/basic.in.py: -------------------------------------------------------------------------------- 1 | test = "world" 2 | 3 | def test(): 4 | substitution = "hello %s" % test 5 | 6 | my_list = List() 7 | try: 8 | pass 9 | except Exception: 10 | raise Exception("test") 11 | -------------------------------------------------------------------------------- /linters/sql-formatter/sql_formatter.test.ts: -------------------------------------------------------------------------------- 1 | import { linterCheckTest, linterFmtTest } from "tests"; 2 | 3 | // sql-formatter runs successfully on an empty file 4 | linterCheckTest({ linterName: "sql-formatter", namedTestPrefixes: ["empty"] }); 5 | 6 | linterFmtTest({ linterName: "sql-formatter", namedTestPrefixes: ["basic"] }); 7 | -------------------------------------------------------------------------------- /linters/sql-formatter/test_data/basic.in.sql: -------------------------------------------------------------------------------- 1 | select supplier_name,city from 2 | (select * from suppliers join addresses on suppliers.address_id=addresses.id) 3 | as suppliers 4 | where supplier_id>500 5 | order by supplier_name asc,city desc; 6 | -------------------------------------------------------------------------------- /linters/sql-formatter/test_data/empty.in.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/sql-formatter/test_data/empty.in.sql -------------------------------------------------------------------------------- /linters/sql-formatter/test_data/sql_formatter_v7.0.1_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter sql-formatter test basic 1`] = ` 4 | "select 5 | supplier_name, 6 | city 7 | from 8 | ( 9 | select 10 | * 11 | from 12 | suppliers 13 | join addresses on suppliers.address_id = addresses.id 14 | ) as suppliers 15 | where 16 | supplier_id > 500 17 | order by 18 | supplier_name asc, 19 | city desc; 20 | " 21 | `; 22 | -------------------------------------------------------------------------------- /linters/sqlfluff/.sqlfluff: -------------------------------------------------------------------------------- 1 | [sqlfluff] 2 | dialect = ansi 3 | -------------------------------------------------------------------------------- /linters/sqlfluff/test_data/bad.ddl: -------------------------------------------------------------------------------- 1 | SELECT 2 | col_a, 3 | col_b, 4 | COUNT(*) AS num, 5 | SUM(num) OVER ( 6 | PARTITION BY col_a 7 | ORDER BY col_b 8 | ) AS an_aggregate_function 9 | FROM tbl_a 10 | GROUP BY 1, 2 11 | -------------------------------------------------------------------------------- /linters/sqlfluff/test_data/bad.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | col_a, 3 | col_b, 4 | COUNT(*) AS num, 5 | SUM(num) OVER ( 6 | PARTITION BY col_a 7 | ORDER BY col_b 8 | ) AS an_aggregate_function 9 | FROM tbl_a 10 | GROUP BY 1, 2 11 | -------------------------------------------------------------------------------- /linters/sqlfluff/test_data/bad.sql.j2: -------------------------------------------------------------------------------- 1 | {% macro foo( 2 | bar, 3 | zed 4 | ) %} 5 | 6 | SELECT 7 | colA, 8 | colB, 9 | COUNT(*) AS num, 10 | SUM(num) OVER ( 11 | PARTITION BY {{ bar }} 12 | ORDER BY {{ zed }} 13 | ) AS function_cool 14 | FROM tblA 15 | GROUP BY 1, 2 16 | 17 | {% endmacro %} 18 | -------------------------------------------------------------------------------- /linters/sqlfluff/test_data/basic_check.in.sql: -------------------------------------------------------------------------------- 1 | SeLEct *, 1, blah as fOO from mySchema.myTable 2 | -------------------------------------------------------------------------------- /linters/sqlfluff/test_data/basic_fmt.in.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | col_a, 3 | col_b, 4 | COUNT(*) AS num, 5 | SUM(num) OVER ( 6 | PARTITION BY col_a 7 | ORDER BY col_b 8 | ) AS an_aggregate_function 9 | FROM tbl_a 10 | GROUP BY 1, 2 11 | -------------------------------------------------------------------------------- /linters/sqlfluff/test_data/sqlfluff_v2.0.0_basic_check.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter sqlfluff test basic_check 1`] = ` 4 | "SELECT 5 | *, 6 | 1, 7 | blah AS foo 8 | FROM myschema.mytable 9 | " 10 | `; 11 | -------------------------------------------------------------------------------- /linters/sqlfluff/test_data/sqlfluff_v2.0.0_basic_fmt.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter sqlfluff test basic_fmt 1`] = ` 4 | "SELECT 5 | col_a, 6 | col_b, 7 | COUNT(*) AS num, 8 | SUM(num) OVER ( 9 | PARTITION BY col_a 10 | ORDER BY col_b 11 | ) AS an_aggregate_function 12 | FROM tbl_a 13 | GROUP BY 1, 2 14 | " 15 | `; 16 | -------------------------------------------------------------------------------- /linters/sqlfluff/test_data/sqlfluff_v3.0.0_basic_check.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter sqlfluff test basic_check 1`] = ` 4 | "SELECT 5 | *, 6 | 1, 7 | blah AS foo 8 | FROM myschema.mytable 9 | " 10 | `; 11 | -------------------------------------------------------------------------------- /linters/sqlfluff/test_data/sqlfluff_v3.0.0_basic_fmt.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter sqlfluff test basic_fmt 1`] = ` 4 | "SELECT 5 | col_a, 6 | col_b, 7 | COUNT(*) AS num, 8 | SUM(num) OVER ( 9 | PARTITION BY col_a 10 | ORDER BY col_b 11 | ) AS an_aggregate_function 12 | FROM tbl_a 13 | GROUP BY 1, 2 14 | " 15 | `; 16 | -------------------------------------------------------------------------------- /linters/sqlfmt/sqlfmt.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | linterFmtTest({ 4 | linterName: "sqlfmt", 5 | }); 6 | -------------------------------------------------------------------------------- /linters/sqlfmt/test_data/basic.in.sql: -------------------------------------------------------------------------------- 1 | select supplier_name,city from 2 | (select * from suppliers join addresses on suppliers.address_id=addresses.id) 3 | as suppliers 4 | where supplier_id>500 5 | order by supplier_name asc,city desc; 6 | -------------------------------------------------------------------------------- /linters/sqlfmt/test_data/empty.in.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/sqlfmt/test_data/empty.in.sql -------------------------------------------------------------------------------- /linters/sqlfmt/test_data/sqlfmt_v0.16.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter sqlfmt test basic 1`] = ` 4 | "select supplier_name, city 5 | from 6 | ( 7 | select * from suppliers join addresses on suppliers.address_id = addresses.id 8 | ) as suppliers 9 | where supplier_id > 500 10 | order by supplier_name asc, city desc 11 | ; 12 | " 13 | `; 14 | -------------------------------------------------------------------------------- /linters/sqlfmt/test_data/sqlfmt_v0.16.0_empty.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter sqlfmt test empty 1`] = `""`; 4 | -------------------------------------------------------------------------------- /linters/squawk/squawk.test.ts: -------------------------------------------------------------------------------- 1 | import semver from "semver"; 2 | import { linterCheckTest } from "tests"; 3 | 4 | // Squawk first supported linux arm in 1.4.0 https://github.com/sbdchd/squawk/issues/372 5 | linterCheckTest({ 6 | linterName: "squawk", 7 | skipTestIf: (version) => 8 | process.arch === "arm64" && 9 | process.platform === "linux" && 10 | version !== undefined && 11 | semver.lt(version, "1.4.0"), 12 | }); 13 | -------------------------------------------------------------------------------- /linters/squawk/test_data/basic.in.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE "core_bar" ( 2 | "id" serial NOT NULL PRIMARY KEY, 3 | "alpha" varchar(100) NOT NULL 4 | ); 5 | 6 | CREATE INDEX "field_name_idx" ON "table_name" ("field_name"); 7 | 8 | ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name); 9 | -------------------------------------------------------------------------------- /linters/standardrb/test_data/basic.in.rb: -------------------------------------------------------------------------------- 1 | class Plumbus 2 | private 3 | 4 | 5 | 6 | 7 | 8 | 9 | def smooth; end 10 | end 11 | 12 | Klass.( 13 | key_1: 'hello', 14 | key_2: 'world' 15 | ) 16 | -------------------------------------------------------------------------------- /linters/standardrb/test_data/standardrb_v1.3.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter standardrb test basic 1`] = ` 4 | "class Plumbus 5 | private 6 | 7 | def smooth 8 | end 9 | end 10 | 11 | Klass.call( 12 | key_1: "hello", 13 | key_2: "world" 14 | ) 15 | " 16 | `; 17 | -------------------------------------------------------------------------------- /linters/stringslint/stringslint.test.ts: -------------------------------------------------------------------------------- 1 | import { customLinterCheckTest } from "tests"; 2 | import { skipOS, TEST_DATA } from "tests/utils"; 3 | 4 | // This is a Mac-exclusive linter 5 | customLinterCheckTest({ 6 | linterName: "stringslint", 7 | args: TEST_DATA, 8 | skipTestIf: skipOS(["linux", "win32"]), 9 | }); 10 | -------------------------------------------------------------------------------- /linters/stringslint/test_data/Localizable.strings: -------------------------------------------------------------------------------- 1 | "abc" = "A B C"; 2 | -------------------------------------------------------------------------------- /linters/stringslint/test_data/basic.swift: -------------------------------------------------------------------------------- 1 | class Foo { 2 | func Bar() { 3 | baz.typeText("test") 4 | } 5 | } 6 | 7 | NSLocalizedString("def", comment:"") 8 | -------------------------------------------------------------------------------- /linters/stylelint/test_data/basic.in.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 5ex 10ex; 3 | max-width: 80ex; 4 | line-height: 1.5; 5 | font-family: sans-serif; 6 | } 7 | h1, h2, h3 { 8 | font-weight: normal; 9 | } 10 | pre, code { 11 | font-family: x, monospace; 12 | } 13 | pre { 14 | padding: 1ex; 15 | background: #eee; 16 | border: solid 1px #ddd; 17 | min-width: 0; 18 | font-size: 90%; 19 | } 20 | code { 21 | color: #007; 22 | } 23 | div.chapter { 24 | margin-top: 4em; 25 | border-top: solid 2px black; 26 | } 27 | p { 28 | margin-top: 0; 29 | } 30 | -------------------------------------------------------------------------------- /linters/stylua/stylua.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | linterFmtTest({ 4 | linterName: "stylua", 5 | }); 6 | -------------------------------------------------------------------------------- /linters/stylua/stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 120 2 | line_endings = "Unix" 3 | indent_type = "Tabs" 4 | indent_width = 4 5 | quote_style = "AutoPreferDouble" 6 | call_parentheses = "Always" 7 | collapse_simple_statement = "Never" 8 | 9 | [sort_requires] 10 | enabled = false 11 | -------------------------------------------------------------------------------- /linters/stylua/test_data/basic.in.lua: -------------------------------------------------------------------------------- 1 | local a = 5 2 | local b 3 | 4 | function fact (n) 5 | if n == 0 then 6 | return 1 7 | else 8 | return n * fact(n-1) 9 | end 10 | end 11 | 12 | -- read 10 lines storing them in a table 13 | a = {} 14 | for i=1,10 do 15 | a[i] = io.read() 16 | end 17 | -------------------------------------------------------------------------------- /linters/stylua/test_data/empty.in.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/stylua/test_data/empty.in.lua -------------------------------------------------------------------------------- /linters/stylua/test_data/stylua_v0.17.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter stylua test basic 1`] = ` 4 | "local a = 5 5 | local b 6 | 7 | function fact(n) 8 | if n == 0 then 9 | return 1 10 | else 11 | return n * fact(n - 1) 12 | end 13 | end 14 | 15 | -- read 10 lines storing them in a table 16 | a = {} 17 | for i = 1, 10 do 18 | a[i] = io.read() 19 | end 20 | " 21 | `; 22 | -------------------------------------------------------------------------------- /linters/stylua/test_data/stylua_v0.17.0_empty.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter stylua test empty 1`] = `""`; 4 | -------------------------------------------------------------------------------- /linters/svgo/svgo.config.mjs: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: [ 3 | { 4 | name: "preset-default", 5 | params: { 6 | overrides: { 7 | removeViewBox: false, // https://github.com/svg/svgo/issues/1128 8 | sortAttrs: true, 9 | removeOffCanvasPaths: true, 10 | }, 11 | }, 12 | }, 13 | ], 14 | }; 15 | -------------------------------------------------------------------------------- /linters/svgo/svgo.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | linterFmtTest({ linterName: "svgo" }); 4 | -------------------------------------------------------------------------------- /linters/svgo/test_data/svgo_v2.8.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter svgo test basic 1`] = `" test "`; 4 | -------------------------------------------------------------------------------- /linters/svgo/test_data/svgo_v3.0.0_basic.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter svgo test basic 1`] = `" test "`; 4 | -------------------------------------------------------------------------------- /linters/swiftformat/swiftformat.test.ts: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import { customLinterFmtTest } from "tests"; 3 | import { skipOS, TEST_DATA } from "tests/utils"; 4 | 5 | customLinterFmtTest({ 6 | linterName: "swiftformat", 7 | testName: "basic", 8 | args: TEST_DATA, 9 | pathsToSnapshot: [path.join(TEST_DATA, "basic.swift")], 10 | skipTestIf: skipOS(["linux", "win32"]), 11 | }); 12 | -------------------------------------------------------------------------------- /linters/swiftformat/test_data/basic.swift: -------------------------------------------------------------------------------- 1 | // Swift "Hello, World!" Program 2 | 3 | print("Hello, World!") 4 | 5 | // This is a very long line that swiftformat does not format into multiple lines with the default configuration but maybe a future update will change this behavior. 6 | 7 | class Foo { 8 | let _foo = "foo" 9 | func foo() { 10 | print(self._foo) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /linters/swiftformat/test_data/swiftformat_v0.50.0_basic.test_data.basic.swift.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter swiftformat test basic 1`] = ` 4 | "// Swift "Hello, World!" Program 5 | 6 | print("Hello, World!") 7 | 8 | // This is a very long line that swiftformat does not format into multiple lines with the default configuration but maybe a future update will change this behavior. 9 | 10 | class Foo { 11 | let _foo = "foo" 12 | func foo() { 13 | print(_foo) 14 | } 15 | } 16 | " 17 | `; 18 | -------------------------------------------------------------------------------- /linters/swiftlint/test_data/basic.swift: -------------------------------------------------------------------------------- 1 | struct a {} 2 | 3 | // This is a very long line that swiftlint should complain about because lines are configured to be 120 characters or less and this is not. 4 | 5 | 6 | func Bar() { 7 | if true { return } 8 | } 9 | 10 | let foo = 11 | -------------------------------------------------------------------------------- /linters/taplo/test_data/bad.toml: -------------------------------------------------------------------------------- 1 | # THIS WILL NOT WORK 2 | spelling = "favorite" 3 | "spelling" = "favourite" 4 | # DO NOT DO THIS EITHER 5 | 6 | [fruit] 7 | apple = "red" 8 | 9 | [fruit.apple] 10 | texture = "smooth" 11 | -------------------------------------------------------------------------------- /linters/taplo/test_data/basic.toml: -------------------------------------------------------------------------------- 1 | # This is a TOML document 2 | 3 | title = "TOML Example" 4 | 5 | [owner] 6 | name = "Tom Preston-Werner" 7 | dob = 1979-05-27T07:32:00-08:00 8 | 9 | [database] 10 | enabled = true 11 | ports = [ 8000, 8001, 8002 ] 12 | data = [ ["delta", "phi"], [3.14] ] 13 | temp_targets = { cpu = 79.5, case = 72.0 } 14 | 15 | [servers] 16 | 17 | 18 | 19 | [servers.alpha] 20 | ip = "10.0.0.1" 21 | role = "frontend" 22 | 23 | [servers.beta] 24 | ip = "10.0.0.2" 25 | role = "backend" 26 | -------------------------------------------------------------------------------- /linters/taplo/test_data/empty.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trunk-io/plugins/704e01286f297b2500716d64454af43502ce47b6/linters/taplo/test_data/empty.toml -------------------------------------------------------------------------------- /linters/terraform/test_data/terraform_v1.1.0_variables.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter terraform test variables 1`] = ` 4 | "variable "ssl_certificates" { 5 | type = map(string) 6 | default = { 7 | lorem-elb-us-west-3 = "lorem" 8 | ipsum-elb-us-east-1 = "ipsum" 9 | dolor-elb-us-east-2 = "dolor" 10 | } 11 | } 12 | " 13 | `; 14 | -------------------------------------------------------------------------------- /linters/terraform/test_data/variables.in.tf: -------------------------------------------------------------------------------- 1 | variable "ssl_certificates" { 2 | type = "map" 3 | default = { 4 | lorem-elb-us-west-3 = "lorem" 5 | ipsum-elb-us-east-1 = "ipsum" 6 | dolor-elb-us-east-2 = "dolor" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /linters/terragrunt/terragrunt.test.ts: -------------------------------------------------------------------------------- 1 | import { linterFmtTest } from "tests"; 2 | 3 | linterFmtTest({ linterName: "terragrunt" }); 4 | -------------------------------------------------------------------------------- /linters/terragrunt/test_data/terragrunt_v0.45.8_unformatted.fmt.shot: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Testing formatter terragrunt test unformatted 1`] = ` 4 | "generate "provider" { 5 | path = "provider.tf" 6 | if_exists = "overwrite_terragrunt" 7 | contents = <=1.22.2-beta.5" 4 | # ThenChange tests/repo_tests/config_check.test.ts 5 | 6 | environments: 7 | - name: SYSTEM 8 | environment: 9 | - name: PATH 10 | list: ["${env.PATH:-}"] 11 | -------------------------------------------------------------------------------- /repo-tools/linter-test-helper/requirements.txt: -------------------------------------------------------------------------------- 1 | click==8.1.7 2 | -------------------------------------------------------------------------------- /repo-tools/tool-test-helper/requirements.txt: -------------------------------------------------------------------------------- 1 | click==8.1.7 2 | -------------------------------------------------------------------------------- /runtimes/README.md: -------------------------------------------------------------------------------- 1 | # Runtimes 2 | 3 | Runtime definitions are provided in this directory. Currently, runtimes don't have any testing in 4 | this repository, but their configuration is exercised with linter tests. 5 | 6 | ## Upgrades 7 | 8 | Runtime upgrades are handled through the `known_good_version` field. When a user upgrades to a new 9 | release of this plugins repository, trunk will recommend that they upgrade their runtimes to the 10 | versions identified by `known_good_version` values at that release. 11 | -------------------------------------------------------------------------------- /tests/driver/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./action_driver"; 2 | export * from "./lint_driver"; 3 | export * from "./tool_driver"; 4 | -------------------------------------------------------------------------------- /tests/reporter/index.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const tsNode = require("ts-node"); 3 | 4 | const REPO_ROOT = path.resolve(__dirname, "../.."); 5 | 6 | tsNode.register({ 7 | transpileOnly: true, 8 | compilerOptions: require(path.resolve(REPO_ROOT, "tsconfig.json")).compilerOptions, 9 | }); 10 | 11 | module.exports = require("./reporter"); 12 | -------------------------------------------------------------------------------- /tools/1password-cli/1password_cli.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "1password-cli", 6 | toolVersion: "2.19.0", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["op", "--version"], 10 | expectedOut: "2.19.0", 11 | }), 12 | ], 13 | skipTestIf: skipOS(["darwin"]), 14 | }); 15 | -------------------------------------------------------------------------------- /tools/act/act.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "act", 6 | toolVersion: "0.2.49", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["act", "--version"], 10 | expectedOut: "act version 0.2.49", 11 | }), 12 | ], 13 | // No download for the test version 14 | skipTestIf: skipOS(["win32"]), 15 | }); 16 | -------------------------------------------------------------------------------- /tools/action-validator/action_validator.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "action-validator", 6 | toolVersion: "0.5.3", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["action-validator", "--version"], 10 | expectedOut: "action-validator 0.5.3", 11 | }), 12 | ], 13 | skipTestIf: skipOS(["win32"]), 14 | }); 15 | -------------------------------------------------------------------------------- /tools/adr/adr.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "adr", 6 | toolVersion: "3.0.0", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["adr", "help"], 10 | expectedOut: "adr help COMMAND [ARG]", 11 | }), 12 | ], 13 | skipTestIf: skipOS(["win32"]), 14 | }); 15 | -------------------------------------------------------------------------------- /tools/adr/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | downloads: 3 | - name: adr 4 | downloads: 5 | - os: 6 | linux: linux 7 | macos: darwin 8 | url: https://github.com/npryce/adr-tools/archive/${version}.tar.gz 9 | strip_components: 1 10 | tools: 11 | definitions: 12 | - name: adr 13 | download: adr 14 | known_good_version: 3.0.0 15 | shims: [adr] 16 | environment: 17 | - name: PATH 18 | list: ["${tool}/src"] 19 | -------------------------------------------------------------------------------- /tools/age/age.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | 3 | toolTest({ 4 | toolName: "age", 5 | toolVersion: "1.1.1", 6 | testConfigs: [ 7 | makeToolTestConfig({ 8 | command: ["age", "--version"], 9 | expectedOut: "v1.1.1", 10 | }), 11 | makeToolTestConfig({ 12 | command: ["age-keygen", "--version"], 13 | expectedOut: "v1.1.1", 14 | }), 15 | ], 16 | }); 17 | -------------------------------------------------------------------------------- /tools/agebox/agebox.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | 3 | toolTest({ 4 | toolName: "agebox", 5 | toolVersion: "0.6.1", 6 | testConfigs: [ 7 | makeToolTestConfig({ 8 | command: ["agebox", "--version"], 9 | expectedErr: "v0.6.1", 10 | }), 11 | ], 12 | }); 13 | -------------------------------------------------------------------------------- /tools/air/air.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "air", 6 | toolVersion: "1.44.0", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["air", "--v"], 10 | expectedOut: "1.44.0", 11 | }), 12 | ], 13 | skipTestIf: skipOS(["win32"]), 14 | }); 15 | -------------------------------------------------------------------------------- /tools/air/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | downloads: 3 | - name: air 4 | executable: true 5 | downloads: 6 | - os: 7 | linux: linux 8 | macos: darwin 9 | cpu: 10 | x86_64: amd64 11 | arm_64: arm64 12 | url: https://github.com/cosmtrek/air/releases/download/v${version}/air_${version}_${os}_${cpu} 13 | tools: 14 | definitions: 15 | - name: air 16 | download: air 17 | known_good_version: 1.44.0 18 | shims: [air] 19 | -------------------------------------------------------------------------------- /tools/alp/alp.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | 3 | toolTest({ 4 | toolName: "alp", 5 | toolVersion: "1.0.14", 6 | testConfigs: [ 7 | makeToolTestConfig({ 8 | command: ["alp", "-v"], 9 | expectedOut: "1.0.14", 10 | }), 11 | ], 12 | }); 13 | -------------------------------------------------------------------------------- /tools/alp/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | downloads: 3 | - name: alp 4 | downloads: 5 | - os: 6 | linux: linux 7 | macos: darwin 8 | windows: windows 9 | cpu: 10 | x86_64: amd64 11 | arm_64: arm64 12 | url: https://github.com/tkuchiki/alp/releases/download/v${version}/alp_${os}_${cpu}.tar.gz 13 | tools: 14 | definitions: 15 | - name: alp 16 | download: alp 17 | known_good_version: 1.0.14 18 | shims: [alp] 19 | -------------------------------------------------------------------------------- /tools/amazon-ecr-credential-helper/amazon_ecr_credential_helper.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "amazon-ecr-credential-helper", 6 | toolVersion: "0.7.0", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["amazon-ecr-credential-helper"], 10 | expectedOut: "Usage: amazon-ecr-credential-helper ", 11 | expectedExitCode: 1, 12 | }), 13 | ], 14 | skipTestIf: skipOS(["win32"]), 15 | }); 16 | -------------------------------------------------------------------------------- /tools/asciinema/asciinema.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "asciinema", 6 | toolVersion: "2.1.0", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["asciinema", "--version"], 10 | expectedOut: "asciinema 2.1.0", 11 | }), 12 | ], 13 | skipTestIf: skipOS(["win32"]), 14 | }); 15 | -------------------------------------------------------------------------------- /tools/asciinema/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | # Doesn't work OOTB on Windows, see https://github.com/orgs/asciinema/discussions/47 5 | - name: asciinema 6 | runtime: python 7 | package: asciinema 8 | known_good_version: 2.1.0 9 | shims: 10 | - name: asciinema 11 | target: asciinema 12 | -------------------------------------------------------------------------------- /tools/assh/assh.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "assh", 6 | toolVersion: "2.15.0", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["assh", "--version"], 10 | expectedOut: "assh version n/a (n/a)", 11 | }), 12 | ], 13 | skipTestIf: skipOS(["win32"]), 14 | }); 15 | -------------------------------------------------------------------------------- /tools/assh/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | downloads: 3 | - name: assh 4 | downloads: 5 | - os: 6 | linux: linux 7 | macos: darwin 8 | cpu: 9 | x86_64: amd64 10 | arm_64: arm64 11 | url: https://github.com/moul/assh/releases/download/v${version}/assh_${version}_${os}_${cpu}.tar.gz 12 | 13 | tools: 14 | definitions: 15 | - name: assh 16 | download: assh 17 | known_good_version: 2.10.0 18 | shims: [assh] 19 | -------------------------------------------------------------------------------- /tools/aws-amplify/aws_amplify.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "aws-amplify", 6 | toolVersion: "12.3.0", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["amplify", "version"], 10 | expectedOut: "12.3.0", 11 | }), 12 | ], 13 | // On Windows, the shim is amplify.cmd, and we don't support platform-specific shims yet. 14 | // To use on Windows, override the shim with amplify.cmd. 15 | skipTestIf: skipOS(["win32"]), 16 | }); 17 | -------------------------------------------------------------------------------- /tools/aws-amplify/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: aws-amplify 5 | runtime: node 6 | package: "@aws-amplify/cli" 7 | known_good_version: 12.3.0 8 | shims: [amplify] 9 | health_checks: 10 | - command: amplify version 11 | parse_regex: ${semver} 12 | -------------------------------------------------------------------------------- /tools/awscli/awscli.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "awscli", 6 | toolVersion: "1.40.22", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["aws", "--version"], 10 | expectedOut: "aws-cli/1.40.22", 11 | }), 12 | ], 13 | // On Windows, the shim is aws.cmd, and we don't support platform-specific shims yet. 14 | // To use on Windows, override the shim with aws.cmd. 15 | skipTestIf: skipOS(["win32"]), 16 | }); 17 | -------------------------------------------------------------------------------- /tools/awscli/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: awscli 5 | runtime: python 6 | package: awscli 7 | known_good_version: 1.40.22 8 | shims: [aws] 9 | -------------------------------------------------------------------------------- /tools/bazel-differ/bazel.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "bazel-differ", 6 | toolVersion: "0.0.5", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["bazel-differ", "--help"], 10 | expectedOut: "bazel-differ is a CLI tool to assist with doing differential Bazel builds", 11 | }), 12 | ], 13 | skipTestIf: skipOS(["win32"]), 14 | }); 15 | -------------------------------------------------------------------------------- /tools/bazel-differ/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: bazel-differ 5 | package: github.com/ewhauser/bazel-differ/cli 6 | runtime: go 7 | known_good_version: 0.0.5 8 | shims: 9 | - name: bazel-differ 10 | target: cli 11 | -------------------------------------------------------------------------------- /tools/bazel/bazel.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | 3 | toolTest({ 4 | toolName: "bazel", 5 | toolVersion: "6.0.0", 6 | testConfigs: [ 7 | makeToolTestConfig({ command: ["bazel", "--version"], expectedOut: "bazel 6.0.0" }), 8 | ], 9 | }); 10 | -------------------------------------------------------------------------------- /tools/circleci/circleci.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | toolTest({ 3 | toolName: "circleci", 4 | toolVersion: "0.1.28528", 5 | testConfigs: [ 6 | makeToolTestConfig({ 7 | command: ["circleci", "version"], 8 | expectedOut: "0.1.28528", 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /tools/clangd-indexing-tools/clangd_indexing_tools.test.ts: -------------------------------------------------------------------------------- 1 | import { toolInstallTest } from "tests"; 2 | toolInstallTest({ 3 | toolName: "clangd-indexing-tools", 4 | toolVersion: "16.0.2", 5 | }); 6 | -------------------------------------------------------------------------------- /tools/clangd/clangd.test.ts: -------------------------------------------------------------------------------- 1 | import { toolInstallTest } from "tests"; 2 | 3 | toolInstallTest({ 4 | toolName: "clangd", 5 | toolVersion: "16.0.2", 6 | }); 7 | -------------------------------------------------------------------------------- /tools/dbt-cli/dbt_cli.test.ts: -------------------------------------------------------------------------------- 1 | import { toolInstallTest } from "tests"; 2 | 3 | toolInstallTest({ 4 | toolName: "dbt-cli", 5 | toolVersion: "0.38.14", 6 | }); 7 | -------------------------------------------------------------------------------- /tools/deno/deno.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipCPUOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "deno", 6 | toolVersion: "1.36.4", 7 | testConfigs: [makeToolTestConfig({ command: ["deno", "--version"], expectedOut: "deno 1.36.4" })], 8 | skipTestIf: skipCPUOS([{ os: "linux", cpu: "arm64" }]), 9 | }); 10 | -------------------------------------------------------------------------------- /tools/diff-so-fancy/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: diff-so-fancy 5 | runtime: node 6 | package: diff-so-fancy 7 | known_good_version: 1.4.3 8 | # NOTE: shim may differ from tool name 9 | shims: [diff-so-fancy] 10 | -------------------------------------------------------------------------------- /tools/difft/difft.test.ts: -------------------------------------------------------------------------------- 1 | import { toolInstallTest } from "tests"; 2 | 3 | toolInstallTest({ 4 | toolName: "difft", 5 | toolVersion: "0.56.1", 6 | }); 7 | -------------------------------------------------------------------------------- /tools/direnv/direnv.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | toolTest({ 4 | toolName: "direnv", 5 | toolVersion: "2.32.3", 6 | testConfigs: [ 7 | makeToolTestConfig({ 8 | command: ["direnv", "--version"], 9 | expectedOut: "2.32.3", 10 | }), 11 | ], 12 | skipTestIf: skipOS(["win32"]), 13 | }); 14 | -------------------------------------------------------------------------------- /tools/direnv/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | downloads: 3 | - name: direnv 4 | executable: true 5 | downloads: 6 | - os: 7 | linux: linux 8 | macos: darwin 9 | cpu: 10 | x86_64: amd64 11 | arm_64: arm64 12 | url: https://github.com/direnv/direnv/releases/download/v${version}/direnv.${os}-${cpu} 13 | # No windows release 14 | tools: 15 | definitions: 16 | - name: direnv 17 | download: direnv 18 | known_good_version: 2.32.3 19 | shims: [direnv] 20 | -------------------------------------------------------------------------------- /tools/docker-credential-ecr-login/docker-credential-ecr-login.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | 3 | toolTest({ 4 | toolName: "docker-credential-ecr-login", 5 | toolVersion: "0.8.0", 6 | testConfigs: [ 7 | makeToolTestConfig({ 8 | command: ["docker-credential-ecr-login", "-v"], 9 | expectedOut: "Version: 0.8.0", 10 | }), 11 | ], 12 | }); 13 | -------------------------------------------------------------------------------- /tools/dotnet/dotnet.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | toolTest({ 4 | toolName: "dotnet", 5 | toolVersion: "7.0.400", 6 | testConfigs: [ 7 | makeToolTestConfig({ 8 | command: ["dotnet", "--version"], 9 | expectedOut: "7.0.400", 10 | }), 11 | ], 12 | skipTestIf: skipOS(["darwin"]), 13 | }); 14 | -------------------------------------------------------------------------------- /tools/eksctl/eksctl.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | 3 | toolTest({ 4 | toolName: "eksctl", 5 | toolVersion: "0.74.0", 6 | testConfigs: [makeToolTestConfig({ command: ["eksctl", "version"], expectedOut: "0.74.0" })], 7 | }); 8 | -------------------------------------------------------------------------------- /tools/gh/gh.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | 3 | toolTest({ 4 | toolName: "gh", 5 | toolVersion: "2.27.0", 6 | testConfigs: [ 7 | makeToolTestConfig({ 8 | command: ["gh", "--version"], 9 | expectedOut: "gh version 2.27.0", 10 | }), 11 | ], 12 | }); 13 | -------------------------------------------------------------------------------- /tools/gk/gk.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | 3 | // No version command for gk 4 | toolTest({ 5 | toolName: "gk", 6 | toolVersion: "1.2.2", 7 | testConfigs: [makeToolTestConfig({ command: ["gk", "-h"], expectedErr: "Usage" })], 8 | }); 9 | -------------------------------------------------------------------------------- /tools/goreleaser/goreleaser.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { osTimeoutMultiplier } from "tests/utils"; 3 | 4 | // This install is quite slow on some Linux machines. 5 | jest.setTimeout(600000 * osTimeoutMultiplier); 6 | 7 | toolTest({ 8 | toolName: "goreleaser", 9 | toolVersion: "1.25.1", 10 | testConfigs: [ 11 | makeToolTestConfig({ command: ["goreleaser", "--version"], expectedOut: "goreleaser" }), 12 | ], 13 | }); 14 | -------------------------------------------------------------------------------- /tools/goreleaser/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: goreleaser 5 | known_good_version: 1.25.1 6 | package: github.com/goreleaser/goreleaser 7 | runtime: go 8 | shims: 9 | - name: goreleaser 10 | target: goreleaser 11 | -------------------------------------------------------------------------------- /tools/grpcui/grpcui.test.ts: -------------------------------------------------------------------------------- 1 | import { toolInstallTest } from "tests"; 2 | 3 | toolInstallTest({ 4 | toolName: "grpcui", 5 | toolVersion: "1.4.1", 6 | }); 7 | -------------------------------------------------------------------------------- /tools/gt/gt.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "gt", 6 | toolVersion: "1.0.7", 7 | testConfigs: [makeToolTestConfig({ command: ["gt", "--version"], expectedOut: "1.0.7" })], 8 | skipTestIf: skipOS(["win32"]), 9 | }); 10 | -------------------------------------------------------------------------------- /tools/gt/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: gt 5 | # There used to be a download for older versions, but the assets are no longer available. 6 | known_good_version: 1.0.0 7 | runtime: node 8 | package: "@withgraphite/graphite-cli" 9 | shims: 10 | - name: gt 11 | target: gt 12 | -------------------------------------------------------------------------------- /tools/gulp/gulp.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "gulp", 6 | toolVersion: "4.0.2", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["gulp", "--version"], 10 | expectedOut: "Local version: 4.0.2", 11 | }), 12 | ], 13 | // On Windows, the shim is gulp.cmd, and we don't support platform-specific shims yet. 14 | // To use on Windows, override the shim with gulp.cmd. 15 | skipTestIf: skipOS(["win32"]), 16 | }); 17 | -------------------------------------------------------------------------------- /tools/gulp/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: gulp 5 | runtime: node 6 | package: gulp 7 | known_good_version: 4.0.2 8 | shims: 9 | - gulp 10 | -------------------------------------------------------------------------------- /tools/helm/helm.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | 3 | toolTest({ 4 | toolName: "helm", 5 | toolVersion: "3.9.4", 6 | testConfigs: [ 7 | makeToolTestConfig({ 8 | command: ["helm", "version"], 9 | expectedOut: 'version.BuildInfo{Version:"v3.9.4"', 10 | }), 11 | ], 12 | }); 13 | -------------------------------------------------------------------------------- /tools/helm/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | downloads: 3 | - name: helm 4 | downloads: 5 | - os: 6 | linux: linux 7 | macos: darwin 8 | windows: windows 9 | cpu: 10 | x86_64: amd64 11 | arm_64: arm64 12 | url: https://get.helm.sh/helm-v${version}-${os}-${cpu}.tar.gz 13 | strip_components: 1 14 | tools: 15 | definitions: 16 | - name: helm 17 | download: helm 18 | known_good_version: 3.9.4 19 | shims: 20 | - name: helm 21 | target: helm 22 | -------------------------------------------------------------------------------- /tools/ibazel/ibazel.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | 3 | toolTest({ 4 | toolName: "ibazel", 5 | toolVersion: "0.22.0", 6 | testConfigs: [ 7 | makeToolTestConfig({ 8 | command: ["ibazel"], 9 | expectedErr: "iBazel - Version v0.22.0", 10 | }), 11 | ], 12 | }); 13 | -------------------------------------------------------------------------------- /tools/istioctl/istioctl.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | // TODO(lauri): unclear why this doesn't work on macOS on test runners - it works locally 5 | toolTest({ 6 | toolName: "istioctl", 7 | toolVersion: "1.14.6", 8 | testConfigs: [ 9 | makeToolTestConfig({ 10 | command: ["istioctl", "version"], 11 | expectedOut: "1.14.6", 12 | }), 13 | ], 14 | skipTestIf: skipOS(["darwin", "win32"]), 15 | }); 16 | -------------------------------------------------------------------------------- /tools/kubectl/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | downloads: 3 | - name: kubectl 4 | downloads: 5 | - os: 6 | linux: linux 7 | macos: darwin 8 | cpu: 9 | x86_64: amd64 10 | arm_64: arm64 11 | url: https://dl.k8s.io/release/v${version}/bin/${os}/${cpu}/kubectl 12 | tools: 13 | definitions: 14 | - name: kubectl 15 | download: kubectl 16 | known_good_version: 1.25.16 17 | shims: 18 | - name: kubectl 19 | target: kubectl 20 | -------------------------------------------------------------------------------- /tools/minikube/minikube.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | 3 | toolTest({ 4 | toolName: "minikube", 5 | toolVersion: "1.24.0", 6 | testConfigs: [ 7 | makeToolTestConfig({ 8 | command: ["minikube", "version"], 9 | expectedOut: "minikube version: v1.24.0", 10 | }), 11 | ], 12 | }); 13 | -------------------------------------------------------------------------------- /tools/paratest/paratest.test.ts: -------------------------------------------------------------------------------- 1 | import { toolInstallTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolInstallTest({ 5 | toolName: "paratest", 6 | toolVersion: "7.6.0", 7 | skipTestIf: skipOS(["win32"]), 8 | }); 9 | -------------------------------------------------------------------------------- /tools/paratest/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: paratest 5 | runtime: php 6 | package: brianium/paratest 7 | # Minimum version compatible with php@8.4 8 | known_good_version: 7.6.0 9 | shims: [paratest] 10 | environment: 11 | - name: PATH 12 | list: ["${tool}/vendor/bin"] 13 | health_checks: 14 | - command: paratest --version 15 | parse_regex: ParaTest v${semver} 16 | -------------------------------------------------------------------------------- /tools/phpunit/phpunit.test.ts: -------------------------------------------------------------------------------- 1 | import { toolInstallTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolInstallTest({ 5 | toolName: "phpunit", 6 | toolVersion: "11.1.3", 7 | skipTestIf: skipOS(["win32"]), 8 | }); 9 | -------------------------------------------------------------------------------- /tools/phpunit/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: phpunit 5 | runtime: php 6 | package: phpunit/phpunit 7 | known_good_version: 11.1.3 8 | shims: [phpunit] 9 | environment: 10 | - name: PATH 11 | list: ["${tool}/vendor/bin"] 12 | health_checks: 13 | - command: phpunit --version 14 | parse_regex: PHPUnit ${semver} 15 | -------------------------------------------------------------------------------- /tools/platformio/platformio.test.ts: -------------------------------------------------------------------------------- 1 | import { toolInstallTest } from "tests"; 2 | 3 | toolInstallTest({ 4 | toolName: "platformio", 5 | toolVersion: "6.1.11", 6 | }); 7 | -------------------------------------------------------------------------------- /tools/platformio/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: platformio 5 | runtime: python 6 | package: platformio 7 | known_good_version: 6.1.11 8 | shims: [pio] 9 | health_checks: 10 | - command: pio --version 11 | parse_regex: PlatformIO Core, version ${semver} 12 | -------------------------------------------------------------------------------- /tools/pnpm/pnpm.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | 3 | toolTest({ 4 | toolName: "pnpm", 5 | toolVersion: "8.6.1", 6 | testConfigs: [makeToolTestConfig({ command: ["pnpm", "--version"], expectedOut: "8.6.1" })], 7 | }); 8 | -------------------------------------------------------------------------------- /tools/prisma/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | # Because this tool can be functionally and semantically distinct, we do not merge it with linters/prisma/plugin.yaml 3 | tools: 4 | definitions: 5 | - name: prisma 6 | runtime: node 7 | package: prisma 8 | known_good_version: 4.16.1 9 | shims: 10 | - name: prisma 11 | target: prisma 12 | -------------------------------------------------------------------------------- /tools/prisma/prisma.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "prisma", 6 | toolVersion: "4.16.1", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["prisma", "--version"], 10 | expectedOut: "4.16.1", 11 | }), 12 | ], 13 | // prisma.bat doesn't exit and close handles on Windows 14 | skipTestIf: skipOS(["win32"]), 15 | }); 16 | -------------------------------------------------------------------------------- /tools/pwsh/pwsh.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | toolTest({ 3 | toolName: "pwsh", 4 | toolVersion: "7.4.1", 5 | testConfigs: [ 6 | makeToolTestConfig({ 7 | command: ["pwsh", "--version"], 8 | expectedOut: "PowerShell 7.4.1", 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /tools/renovate/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: renovate 5 | runtime: node 6 | package: renovate 7 | shims: [renovate, renovate-config-validator] 8 | known_good_version: 34.122.0 9 | -------------------------------------------------------------------------------- /tools/ripgrep/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | # NOTE: This only works if rust runtime version >=1.70.0 3 | tools: 4 | definitions: 5 | - name: ripgrep 6 | package: ripgrep 7 | runtime: rust 8 | known_good_version: 13.0.0 9 | shims: [rg] 10 | -------------------------------------------------------------------------------- /tools/ripgrep/ripgrep.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | toolTest({ 4 | toolName: "ripgrep", 5 | toolVersion: "13.0.0", 6 | testConfigs: [ 7 | makeToolTestConfig({ 8 | command: ["rg", "--version"], 9 | expectedOut: "ripgrep 13.0.0", 10 | }), 11 | ], 12 | // Requires installation of VS "C++ build tools", which we don't yet have set up 13 | skipTestIf: skipOS(["win32"]), 14 | }); 15 | -------------------------------------------------------------------------------- /tools/sentry-cli/sentry_cli.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | 3 | toolTest({ 4 | toolName: "sentry-cli", 5 | toolVersion: "1.66.0", 6 | testConfigs: [ 7 | makeToolTestConfig({ 8 | command: ["sentry-cli", "-V"], 9 | expectedOut: "sentry-cli 1.66.0", 10 | }), 11 | ], 12 | }); 13 | -------------------------------------------------------------------------------- /tools/sfdx/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: sfdx 5 | runtime: node 6 | package: "@salesforce/cli" 7 | known_good_version: 2.0.1 8 | shims: 9 | - name: sfdx 10 | target: sfdx 11 | - name: sf 12 | target: sf 13 | -------------------------------------------------------------------------------- /tools/sourcery/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: sourcery 5 | runtime: python 6 | package: sourcery 7 | shims: [sourcery] 8 | known_good_version: 1.37.0 9 | -------------------------------------------------------------------------------- /tools/sourcery/sourcery.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | toolTest({ 3 | toolName: "sourcery", 4 | toolVersion: "1.37.0", 5 | testConfigs: [ 6 | makeToolTestConfig({ 7 | command: ["sourcery", "--version"], 8 | expectedOut: "1.37.0", 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /tools/tailwindcss/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: tailwindcss 5 | runtime: node 6 | package: tailwindcss 7 | known_good_version: 3.3.5 8 | shims: 9 | - tailwindcss 10 | -------------------------------------------------------------------------------- /tools/target-determinator/target_determinator.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | 3 | toolTest({ 4 | toolName: "target-determinator", 5 | toolVersion: "0.3.0", 6 | testConfigs: [ 7 | makeToolTestConfig({ 8 | command: ["target-determinator"], 9 | expectedErr: 10 | "Failed to parse flags: expected one positional argument, , but got 0", 11 | // Error exit code varies by platform 12 | expectedExitCode: process.platform == "win32" ? 0 : 1, 13 | }), 14 | ], 15 | }); 16 | -------------------------------------------------------------------------------- /tools/terraform-docs/terraform_docs.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | toolTest({ 3 | toolName: "terraform-docs", 4 | toolVersion: "0.16.0", 5 | testConfigs: [ 6 | makeToolTestConfig({ 7 | command: ["terraform-docs", "--version"], 8 | expectedOut: "terraform-docs version v0.16.0", 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /tools/terraform-switcher/terraform_switcher.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | toolTest({ 3 | toolName: "terraform-switcher", 4 | toolVersion: "0.13.1308", 5 | testConfigs: [ 6 | makeToolTestConfig({ 7 | command: ["tfswitch", "--version"], 8 | expectedOut: "Version: 0.13.1308", 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /tools/terraform/terraform.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | toolTest({ 3 | toolName: "terraform", 4 | toolVersion: "1.1.4", 5 | testConfigs: [ 6 | makeToolTestConfig({ 7 | command: ["terraform", "--version"], 8 | expectedOut: "Terraform v1.1.4", 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /tools/terraformer/terraformer.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | toolTest({ 3 | toolName: "terraformer", 4 | toolVersion: "0.8.24", 5 | testConfigs: [ 6 | makeToolTestConfig({ 7 | command: ["terraformer", "--version"], 8 | expectedOut: "version v0.8.24", 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /tools/terramate/terramate.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | toolTest({ 3 | toolName: "terramate", 4 | toolVersion: "0.4.0", 5 | testConfigs: [ 6 | makeToolTestConfig({ 7 | command: ["terramate", "--version"], 8 | expectedOut: "0.4.0", 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /tools/tfmigrate/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | downloads: 3 | - name: tfmigrate 4 | downloads: 5 | - os: 6 | linux: linux 7 | macos: darwin 8 | cpu: 9 | x86_64: amd64 10 | arm_64: arm64 11 | url: https://github.com/minamijoyo/tfmigrate/releases/download/v${version}/tfmigrate_${version}_${os}_${cpu}.tar.gz 12 | # no windows binary 13 | tools: 14 | definitions: 15 | - name: tfmigrate 16 | download: tfmigrate 17 | known_good_version: 0.3.14 18 | shims: [tfmigrate] 19 | -------------------------------------------------------------------------------- /tools/tfmigrate/tfmigrate.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | toolTest({ 4 | toolName: "tfmigrate", 5 | toolVersion: "0.3.14", 6 | testConfigs: [ 7 | makeToolTestConfig({ 8 | command: ["tfmigrate", "--version"], 9 | expectedOut: "0.3.14", 10 | }), 11 | ], 12 | skipTestIf: skipOS(["win32"]), 13 | }); 14 | -------------------------------------------------------------------------------- /tools/tfnotify/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | downloads: 3 | - name: tfnotify 4 | downloads: 5 | - os: 6 | linux: linux 7 | macos: darwin 8 | cpu: 9 | x86_64: amd64 10 | arm_64: arm64 11 | url: https://github.com/mercari/tfnotify/releases/download/v${version}/tfnotify_${os}_${cpu}.tar.gz 12 | # no windows binary 13 | tools: 14 | definitions: 15 | - name: tfnotify 16 | download: tfnotify 17 | known_good_version: 0.8.0 18 | shims: [tfnotify] 19 | -------------------------------------------------------------------------------- /tools/tfnotify/tfnotify.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "tfnotify", 6 | toolVersion: "0.8.0", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["tfnotify", "--version"], 10 | expectedOut: "tfnotify version unset", 11 | }), 12 | ], 13 | skipTestIf: skipOS(["win32"]), 14 | }); 15 | -------------------------------------------------------------------------------- /tools/tfupdate/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | downloads: 3 | - name: tfupdate 4 | downloads: 5 | - os: 6 | linux: linux 7 | macos: darwin 8 | windows: windows 9 | cpu: 10 | x86_64: amd64 11 | arm_64: arm64 12 | url: https://github.com/minamijoyo/tfupdate/releases/download/v${version}/tfupdate_${version}_${os}_${cpu}.tar.gz 13 | tools: 14 | definitions: 15 | - name: tfupdate 16 | download: tfupdate 17 | known_good_version: 0.7.2 18 | shims: [tfupdate] 19 | -------------------------------------------------------------------------------- /tools/tfupdate/tfupdate.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | toolTest({ 3 | toolName: "tfupdate", 4 | toolVersion: "0.7.2", 5 | testConfigs: [ 6 | makeToolTestConfig({ 7 | command: ["tfupdate", "--version"], 8 | expectedOut: "0.7.2", 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /tools/tofu/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | downloads: 3 | - name: tofu 4 | version: 1.6.2 5 | downloads: 6 | - os: 7 | linux: linux 8 | macos: darwin 9 | windows: windows 10 | cpu: 11 | x86_64: amd64 12 | arm_64: arm64 13 | url: https://github.com/opentofu/opentofu/releases/download/v${version}/tofu_${version}_${os}_${cpu}.zip 14 | tools: 15 | definitions: 16 | - name: tofu 17 | download: tofu 18 | shims: [tofu] 19 | known_good_version: 1.6.2 20 | -------------------------------------------------------------------------------- /tools/tofu/tofu.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | toolTest({ 3 | toolName: "tofu", 4 | toolVersion: "1.6.2", 5 | testConfigs: [ 6 | makeToolTestConfig({ 7 | command: ["tofu", "--version"], 8 | expectedOut: "OpenTofu v1.6.2", 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /tools/tree-sitter/tree_sitter.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | toolTest({ 3 | toolName: "tree-sitter", 4 | toolVersion: "0.20.8", 5 | testConfigs: [ 6 | makeToolTestConfig({ 7 | command: ["tree-sitter", "--version"], 8 | expectedOut: "tree-sitter 0.20.8", 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /tools/ts-node/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: ts-node 5 | runtime: node 6 | package: ts-node 7 | known_good_version: 10.9.1 8 | shims: [ts-node] 9 | health_checks: 10 | - command: ts-node --version 11 | parse_regex: ${semver} 12 | -------------------------------------------------------------------------------- /tools/ts-node/ts_node.test.ts: -------------------------------------------------------------------------------- 1 | import { toolInstallTest } from "tests"; 2 | toolInstallTest({ 3 | toolName: "ts-node", 4 | toolVersion: "10.9.1", 5 | }); 6 | -------------------------------------------------------------------------------- /tools/tsc/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: tsc 5 | runtime: node 6 | package: typescript 7 | known_good_version: 5.2.2 8 | shims: [tsc] 9 | health_checks: 10 | - command: tsc --version 11 | parse_regex: Version ${semver} 12 | -------------------------------------------------------------------------------- /tools/tsc/tsc.test.ts: -------------------------------------------------------------------------------- 1 | import { toolInstallTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolInstallTest({ 5 | toolName: "tsc", 6 | toolVersion: "5.2.2", 7 | // On Windows, the shim is tsc.cmd, and we don't support platform-specific shims yet. 8 | // To use on Windows, override the shim with tsc.cmd. 9 | skipTestIf: skipOS(["win32"]), 10 | }); 11 | -------------------------------------------------------------------------------- /tools/webpack/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | tools: 3 | definitions: 4 | - name: webpack 5 | runtime: node 6 | package: webpack 7 | known_good_version: 5.89.0 8 | shims: 9 | - webpack 10 | extra_packages: 11 | - webpack-cli 12 | -------------------------------------------------------------------------------- /tools/webpack/webpack.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "webpack", 6 | toolVersion: "5.89.0", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["webpack", "--version"], 10 | expectedOut: "Binaries:", 11 | }), 12 | ], 13 | // On Windows, the shim is webpack.cmd, and we don't support platform-specific shims yet. 14 | // To use on Windows, override the shim with webpack.cmd. 15 | skipTestIf: skipOS(["win32"]), 16 | }); 17 | -------------------------------------------------------------------------------- /tools/yarn/plugin.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | downloads: 3 | - name: yarn 4 | downloads: 5 | - os: 6 | linux: linux 7 | macos: darwin 8 | cpu: 9 | x86_64: amd64 10 | arm_64: arm64 11 | url: https://github.com/yarnpkg/yarn/releases/download/v${version}/yarn-${version}.js 12 | tools: 13 | definitions: 14 | - name: yarn 15 | download: yarn 16 | known_good_version: 1.22.19 17 | shims: 18 | - name: yarn 19 | target: yarn 20 | -------------------------------------------------------------------------------- /tools/yarn/yarn.test.ts: -------------------------------------------------------------------------------- 1 | import { makeToolTestConfig, toolTest } from "tests"; 2 | import { skipOS } from "tests/utils"; 3 | 4 | toolTest({ 5 | toolName: "yarn", 6 | toolVersion: "1.22.19", 7 | testConfigs: [ 8 | makeToolTestConfig({ 9 | command: ["yarn", "--version"], 10 | expectedOut: "1.22.19", 11 | }), 12 | ], 13 | skipTestIf: skipOS(["win32"]), 14 | }); 15 | -------------------------------------------------------------------------------- /tools/yq/yq.test.ts: -------------------------------------------------------------------------------- 1 | import { toolInstallTest } from "tests"; 2 | 3 | // The binary name varies by platform so we can't roll this into a health_check as-is. 4 | toolInstallTest({ 5 | toolName: "yq", 6 | toolVersion: "4.44.1", 7 | }); 8 | --------------------------------------------------------------------------------