1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-30 16:40:57 -05:00

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
This commit is contained in:
David Sherret 2024-09-09 12:33:09 -04:00 committed by GitHub
parent 3daab54612
commit 1e0ac609b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 8 additions and 142 deletions

4
Cargo.lock generated
View file

@ -1375,9 +1375,9 @@ dependencies = [
[[package]] [[package]]
name = "deno_config" name = "deno_config"
version = "0.33.2" version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84d90b5eacfd6ee4ec978a11739c71eaeb19a575889f8c2b473430df84078fe2" checksum = "353595ebd9d19602f4cc0bb5613ae8bf036fb23ce1e6638eec594a63b1f8d48a"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"deno_package_json", "deno_package_json",

View file

@ -65,7 +65,7 @@ winres.workspace = true
[dependencies] [dependencies]
deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit"] } deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit"] }
deno_cache_dir = { workspace = true } 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_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
deno_doc = { version = "0.148.0", features = ["html", "syntect"] } deno_doc = { version = "0.148.0", features = ["html", "syntect"] }
deno_graph = { version = "=0.82.1" } deno_graph = { version = "=0.82.1" }

View file

@ -279,25 +279,6 @@
"type": "string" "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": { "rules": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -355,25 +336,6 @@
"type": "string" "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": { "useTabs": {
"description": "Whether to use tabs (true) or spaces (false) for indentation.", "description": "Whether to use tabs (true) or spaces (false) for indentation.",
"type": "boolean", "type": "boolean",
@ -477,25 +439,6 @@
"items": { "items": {
"type": "string" "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": { "items": {
"type": "string" "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"
}
}
}
} }
} }
}, },

View file

@ -291,12 +291,6 @@ itest!(fmt_with_config {
output: "fmt/fmt_with_config.out", 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 { itest!(fmt_with_config_default {
args: "fmt fmt/with_config/subdir", args: "fmt fmt/with_config/subdir",
output: "fmt/fmt_with_config.out", output: "fmt/fmt_with_config.out",

View file

@ -10269,9 +10269,7 @@ fn lsp_format_exclude_with_config() {
"deno.fmt.jsonc", "deno.fmt.jsonc",
r#"{ r#"{
"fmt": { "fmt": {
"files": { "exclude": ["ignored.ts"],
"exclude": ["ignored.ts"]
},
"options": { "options": {
"useTabs": true, "useTabs": true,
"lineWidth": 40, "lineWidth": 40,
@ -10322,9 +10320,7 @@ fn lsp_format_exclude_default_config() {
"deno.fmt.jsonc", "deno.fmt.jsonc",
r#"{ r#"{
"fmt": { "fmt": {
"files": { "exclude": ["ignored.ts"],
"exclude": ["ignored.ts"]
},
"options": { "options": {
"useTabs": true, "useTabs": true,
"lineWidth": 40, "lineWidth": 40,
@ -11707,9 +11703,7 @@ fn lsp_lint_exclude_with_config() {
"deno.lint.jsonc", "deno.lint.jsonc",
r#"{ r#"{
"lint": { "lint": {
"files": { "exclude": ["ignored.ts"],
"exclude": ["ignored.ts"]
},
"rules": { "rules": {
"exclude": ["camelcase"], "exclude": ["camelcase"],
"include": ["ban-untagged-todo"], "include": ["ban-untagged-todo"],

View file

@ -124,12 +124,6 @@ itest!(test_with_config2 {
output: "test/collect2.out", 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 { itest!(test_with_malformed_config {
args: "test --config test/collect/deno.malformed.jsonc", args: "test --config test/collect/deno.malformed.jsonc",
exit_code: 1, exit_code: 1,

View file

@ -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

View file

@ -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
}
}
}

View file

@ -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])

View file

@ -1,7 +0,0 @@
{
"test": {
"files": {
"exclude": ["./ignore"]
}
}
}

View file

@ -203,7 +203,7 @@ async function ensureNoNewITests() {
"coverage_tests.rs": 0, "coverage_tests.rs": 0,
"eval_tests.rs": 0, "eval_tests.rs": 0,
"flags_tests.rs": 0, "flags_tests.rs": 0,
"fmt_tests.rs": 17, "fmt_tests.rs": 16,
"info_tests.rs": 18, "info_tests.rs": 18,
"init_tests.rs": 0, "init_tests.rs": 0,
"inspector_tests.rs": 0, "inspector_tests.rs": 0,
@ -223,7 +223,7 @@ async function ensureNoNewITests() {
"run_tests.rs": 348, "run_tests.rs": 348,
"shared_library_tests.rs": 0, "shared_library_tests.rs": 0,
"task_tests.rs": 30, "task_tests.rs": 30,
"test_tests.rs": 75, "test_tests.rs": 74,
"upgrade_tests.rs": 0, "upgrade_tests.rs": 0,
"vendor_tests.rs": 1, "vendor_tests.rs": 1,
"watcher_tests.rs": 0, "watcher_tests.rs": 0,