From 0da81205d57e947e82aa02206f8ba6822c624ebc Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 2 Aug 2024 15:52:48 +0200 Subject: feat(unstable/fmt): move yaml formatting behind unstable flag (#24848) This moves YAML formatting behind an unstable flag for Deno 1.46. This will make it opt-in to start and then we can remove the flag to make it on by default in version of Deno after that. This can be specified by doing `deno fmt --unstable-yaml` or by specifying the following in a deno.json file: ```json { "unstable": ["fmt-yaml"] } ``` --- tests/specs/fmt/unstable_yaml/__test__.jsonc | 25 +++++++++++++++++++++++ tests/specs/fmt/unstable_yaml/badly_formatted.yml | 3 +++ 2 files changed, 28 insertions(+) create mode 100644 tests/specs/fmt/unstable_yaml/__test__.jsonc create mode 100644 tests/specs/fmt/unstable_yaml/badly_formatted.yml (limited to 'tests/specs') diff --git a/tests/specs/fmt/unstable_yaml/__test__.jsonc b/tests/specs/fmt/unstable_yaml/__test__.jsonc new file mode 100644 index 000000000..885db59b9 --- /dev/null +++ b/tests/specs/fmt/unstable_yaml/__test__.jsonc @@ -0,0 +1,25 @@ +{ + "tempDir": true, + "tests": { + "nothing": { + "args": "fmt", + "output": "Checked 1 file\n" + }, + "flag": { + "args": "fmt --unstable-yaml", + "output": "[WILDLINE]badly_formatted.yml\nChecked 1 file\n" + }, + "config_file": { + "steps": [{ + "args": [ + "eval", + "Deno.writeTextFile('deno.json', '{\\n \"unstable\": [\"fmt-yaml\"]\\n}\\n')" + ], + "output": "[WILDCARD]" + }, { + "args": "fmt", + "output": "[WILDLINE]badly_formatted.yml\nChecked 2 files\n" + }] + } + } +} \ No newline at end of file diff --git a/tests/specs/fmt/unstable_yaml/badly_formatted.yml b/tests/specs/fmt/unstable_yaml/badly_formatted.yml new file mode 100644 index 000000000..49646f320 --- /dev/null +++ b/tests/specs/fmt/unstable_yaml/badly_formatted.yml @@ -0,0 +1,3 @@ +- Test + - Test + - Test \ No newline at end of file -- cgit v1.2.3