From 68c921b7580999207e0171a5c1155deacadfae78 Mon Sep 17 00:00:00 2001 From: Tyler Jang Date: Wed, 6 Dec 2023 16:13:57 -0800 Subject: [PATCH] Update mypy `run_from` to respect nested setups (#570) Multi-language repos that do not include `pyproject.toml` at their workspace root will require mypy to respect their relevant configs. This uses the new `run_from` key to support this, and we can roll this out for other linters as needed. Will require a CLI version (and required version) bump once the relevant changes are released. --- .trunk/trunk.yaml | 2 +- linters/mypy/plugin.yaml | 1 + plugin.yaml | 2 +- tests/repo_tests/config_check.test.ts | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 4b721734e..e2f4ce930 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -2,7 +2,7 @@ version: 0.1 # version used for local trunk runs and testing cli: - version: 1.17.3-beta.15 + version: 1.18.0 api: address: api.trunk-staging.io:8443 diff --git a/linters/mypy/plugin.yaml b/linters/mypy/plugin.yaml index 150bd8011..db319f832 100644 --- a/linters/mypy/plugin.yaml +++ b/linters/mypy/plugin.yaml @@ -17,6 +17,7 @@ lint: run: mypy --ignore-missing-imports --follow-imports=silent --show-error-codes --show-column-numbers ${target} + run_from: ${root_or_parent_with_any_config} success_codes: [0, 1] stdin: false tools: [mypy] diff --git a/plugin.yaml b/plugin.yaml index 824db9ca6..4da7e4678 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,6 +1,6 @@ version: 0.1 # IfChange -required_trunk_version: ">=1.17.3-beta.5" +required_trunk_version: ">=1.18.0" # ThenChange tests/repo_tests/config_check.test.ts environments: diff --git a/tests/repo_tests/config_check.test.ts b/tests/repo_tests/config_check.test.ts index 5e429adec..48ebf11cd 100644 --- a/tests/repo_tests/config_check.test.ts +++ b/tests/repo_tests/config_check.test.ts @@ -25,7 +25,7 @@ describe("Global config health check", () => { setupTrunk: true, // NOTE: This version should be kept compatible in lockstep with the `required_trunk_version` in plugin.yaml // IfChange - trunkVersion: "1.17.3-beta.5", + trunkVersion: "1.18.0", // ThenChange plugin.yaml });