From 1e0ac609b57b9efdafd54de4cb56f98c507c032f Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 9 Sep 2024 12:33:09 -0400 Subject: [PATCH] BREAKING: remove deprecated files config (#25535) The long form "files" config has been flattened into the parent. Old: ```json { "test": { "files": { "include": ["**/*.ts"], "exclude": ["ignore.ts"] } } } ``` New: ```json { "test": { "include": ["**/*.ts"], "exclude": ["ignore.ts"] } } ``` This was deprecated some time ago, but we're removing it now in Deno 2.0. Closes #25415 --- Cargo.lock | 4 +- cli/Cargo.toml | 2 +- cli/schemas/config-file.v1.json | 76 ------------------- tests/integration/fmt_tests.rs | 6 -- tests/integration/lsp_tests.rs | 12 +-- tests/integration/test_tests.rs | 6 -- .../fmt/fmt_with_deprecated_config.out | 3 - .../fmt/with_config/deno.deprecated.jsonc | 20 ----- tests/testdata/test/collect.deprecated.out | 10 --- .../test/collect/deno.deprecated.jsonc | 7 -- tools/lint.js | 4 +- 11 files changed, 8 insertions(+), 142 deletions(-) delete mode 100644 tests/testdata/fmt/fmt_with_deprecated_config.out delete mode 100644 tests/testdata/fmt/with_config/deno.deprecated.jsonc delete mode 100644 tests/testdata/test/collect.deprecated.out delete mode 100644 tests/testdata/test/collect/deno.deprecated.jsonc diff --git a/Cargo.lock b/Cargo.lock index 5f8b8837c9..1c9fafb308 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1375,9 +1375,9 @@ dependencies = [ [[package]] name = "deno_config" -version = "0.33.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d90b5eacfd6ee4ec978a11739c71eaeb19a575889f8c2b473430df84078fe2" +checksum = "353595ebd9d19602f4cc0bb5613ae8bf036fb23ce1e6638eec594a63b1f8d48a" dependencies = [ "anyhow", "deno_package_json", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index c582004ad9..63ad21c376 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -65,7 +65,7 @@ winres.workspace = true [dependencies] deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit"] } deno_cache_dir = { workspace = true } -deno_config = { version = "=0.33.2", features = ["workspace", "sync"] } +deno_config = { version = "=0.34.0", features = ["workspace", "sync"] } deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_doc = { version = "0.148.0", features = ["html", "syntect"] } deno_graph = { version = "=0.82.1" } diff --git a/cli/schemas/config-file.v1.json b/cli/schemas/config-file.v1.json index d0dc27e759..8d0af55bfd 100644 --- a/cli/schemas/config-file.v1.json +++ b/cli/schemas/config-file.v1.json @@ -279,25 +279,6 @@ "type": "string" } }, - "files": { - "type": "object", - "properties": { - "include": { - "type": "array", - "description": "List of files, directories or globs that will be linted.", - "items": { - "type": "string" - } - }, - "exclude": { - "type": "array", - "description": "List of files, directories or globs that will not be linted.", - "items": { - "type": "string" - } - } - } - }, "rules": { "type": "object", "properties": { @@ -355,25 +336,6 @@ "type": "string" } }, - "files": { - "type": "object", - "properties": { - "include": { - "type": "array", - "description": "List of files, directories or globs that will be formatted.", - "items": { - "type": "string" - } - }, - "exclude": { - "type": "array", - "description": "List of files, directories or globs that will not be formatted.", - "items": { - "type": "string" - } - } - } - }, "useTabs": { "description": "Whether to use tabs (true) or spaces (false) for indentation.", "type": "boolean", @@ -477,25 +439,6 @@ "items": { "type": "string" } - }, - "files": { - "type": "object", - "properties": { - "include": { - "type": "array", - "description": "List of files, directories or globs that will be searched for tests.", - "items": { - "type": "string" - } - }, - "exclude": { - "type": "array", - "description": "List of files, directories or globs that will not be searched for tests.", - "items": { - "type": "string" - } - } - } } } }, @@ -536,25 +479,6 @@ "items": { "type": "string" } - }, - "files": { - "type": "object", - "properties": { - "include": { - "type": "array", - "description": "List of files, directories or globs that will be searched for benchmarks.", - "items": { - "type": "string" - } - }, - "exclude": { - "type": "array", - "description": "List of files, directories or globs that will not be searched for benchmarks.", - "items": { - "type": "string" - } - } - } } } }, diff --git a/tests/integration/fmt_tests.rs b/tests/integration/fmt_tests.rs index c2d38f0d8c..b890b3b72a 100644 --- a/tests/integration/fmt_tests.rs +++ b/tests/integration/fmt_tests.rs @@ -291,12 +291,6 @@ itest!(fmt_with_config { output: "fmt/fmt_with_config.out", }); -itest!(fmt_with_deprecated_config { - args: - "fmt --config fmt/with_config/deno.deprecated.jsonc fmt/with_config/subdir", - output: "fmt/fmt_with_deprecated_config.out", -}); - itest!(fmt_with_config_default { args: "fmt fmt/with_config/subdir", output: "fmt/fmt_with_config.out", diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 78e5260851..981dcc01dc 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -10269,9 +10269,7 @@ fn lsp_format_exclude_with_config() { "deno.fmt.jsonc", r#"{ "fmt": { - "files": { - "exclude": ["ignored.ts"] - }, + "exclude": ["ignored.ts"], "options": { "useTabs": true, "lineWidth": 40, @@ -10322,9 +10320,7 @@ fn lsp_format_exclude_default_config() { "deno.fmt.jsonc", r#"{ "fmt": { - "files": { - "exclude": ["ignored.ts"] - }, + "exclude": ["ignored.ts"], "options": { "useTabs": true, "lineWidth": 40, @@ -11707,9 +11703,7 @@ fn lsp_lint_exclude_with_config() { "deno.lint.jsonc", r#"{ "lint": { - "files": { - "exclude": ["ignored.ts"] - }, + "exclude": ["ignored.ts"], "rules": { "exclude": ["camelcase"], "include": ["ban-untagged-todo"], diff --git a/tests/integration/test_tests.rs b/tests/integration/test_tests.rs index d3c9f00093..f6c48654d3 100644 --- a/tests/integration/test_tests.rs +++ b/tests/integration/test_tests.rs @@ -124,12 +124,6 @@ itest!(test_with_config2 { output: "test/collect2.out", }); -itest!(test_with_deprecated_config { - args: "test --config test/collect/deno.deprecated.jsonc test/collect", - exit_code: 0, - output: "test/collect.deprecated.out", -}); - itest!(test_with_malformed_config { args: "test --config test/collect/deno.malformed.jsonc", exit_code: 1, diff --git a/tests/testdata/fmt/fmt_with_deprecated_config.out b/tests/testdata/fmt/fmt_with_deprecated_config.out deleted file mode 100644 index 793fac1bc4..0000000000 --- a/tests/testdata/fmt/fmt_with_deprecated_config.out +++ /dev/null @@ -1,3 +0,0 @@ -Warning: "options" configuration is deprecated. Please use "flat" options instead. -Warning: "files" configuration is deprecated. Please use "include" and "exclude" instead. -Checked 2 files diff --git a/tests/testdata/fmt/with_config/deno.deprecated.jsonc b/tests/testdata/fmt/with_config/deno.deprecated.jsonc deleted file mode 100644 index e053233fd2..0000000000 --- a/tests/testdata/fmt/with_config/deno.deprecated.jsonc +++ /dev/null @@ -1,20 +0,0 @@ -{ - "fmt": { - "files": { - "include": [ - "./subdir/" - ], - "exclude": [ - "./subdir/b.ts" - ] - }, - "options": { - "useTabs": true, - "lineWidth": 40, - "indentWidth": 8, - "singleQuote": true, - "proseWrap": "always", - "semiColons": false - } - } -} diff --git a/tests/testdata/test/collect.deprecated.out b/tests/testdata/test/collect.deprecated.out deleted file mode 100644 index 7db2f276c1..0000000000 --- a/tests/testdata/test/collect.deprecated.out +++ /dev/null @@ -1,10 +0,0 @@ -Warning: "files" configuration is deprecated. Please use "include" and "exclude" instead. -Check [WILDCARD]/test/collect/include/2_test.ts -Check [WILDCARD]/test/collect/include/test.ts -Check [WILDCARD]/test/collect/test.ts -running 0 tests from [WILDCARD]/test/collect/include/2_test.ts -running 0 tests from [WILDCARD]/test/collect/include/test.ts -running 0 tests from [WILDCARD]/test/collect/test.ts - -ok | 0 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/collect/deno.deprecated.jsonc b/tests/testdata/test/collect/deno.deprecated.jsonc deleted file mode 100644 index b8acda27d0..0000000000 --- a/tests/testdata/test/collect/deno.deprecated.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "test": { - "files": { - "exclude": ["./ignore"] - } - } -} diff --git a/tools/lint.js b/tools/lint.js index d8dc296557..e692110fa3 100755 --- a/tools/lint.js +++ b/tools/lint.js @@ -203,7 +203,7 @@ async function ensureNoNewITests() { "coverage_tests.rs": 0, "eval_tests.rs": 0, "flags_tests.rs": 0, - "fmt_tests.rs": 17, + "fmt_tests.rs": 16, "info_tests.rs": 18, "init_tests.rs": 0, "inspector_tests.rs": 0, @@ -223,7 +223,7 @@ async function ensureNoNewITests() { "run_tests.rs": 348, "shared_library_tests.rs": 0, "task_tests.rs": 30, - "test_tests.rs": 75, + "test_tests.rs": 74, "upgrade_tests.rs": 0, "vendor_tests.rs": 1, "watcher_tests.rs": 0,