From a7ac89935b092f86245ce0370042f4bef14ad82d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 23 Sep 2024 17:01:04 +0100 Subject: feat(fmt): stabilize CSS, HTML and YAML formatters (#25753) This commits stabilizes CSS, HTML and YAML formatters in `deno fmt`. It is no longer required to use either of these flags: - `--unstable-css` - `--unstable-html` - `--unstable-yaml` Or these `unstable` options in the config file: - `fmt-css` - `fmt-html` - `html-yaml` --- cli/args/flags.rs | 48 ++++++------------------------------------------ 1 file changed, 6 insertions(+), 42 deletions(-) (limited to 'cli/args/flags.rs') diff --git a/cli/args/flags.rs b/cli/args/flags.rs index a5ca78acc..8490fdab6 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -206,10 +206,7 @@ pub struct FmtFlags { pub prose_wrap: Option, pub no_semicolons: Option, pub watch: Option, - pub unstable_css: bool, - pub unstable_html: bool, pub unstable_component: bool, - pub unstable_yaml: bool, } impl FmtFlags { @@ -2219,7 +2216,8 @@ Ignore formatting a file by adding an ignore comment at the top of the file: .help("Enable formatting CSS, SCSS, Sass and Less files") .value_parser(FalseyValueParser::new()) .action(ArgAction::SetTrue) - .help_heading(FMT_HEADING), + .help_heading(FMT_HEADING) + .hide(true), ) .arg( Arg::new("unstable-html") @@ -2227,7 +2225,8 @@ Ignore formatting a file by adding an ignore comment at the top of the file: .help("Enable formatting HTML files") .value_parser(FalseyValueParser::new()) .action(ArgAction::SetTrue) - .help_heading(FMT_HEADING), + .help_heading(FMT_HEADING) + .hide(true), ) .arg( Arg::new("unstable-component") @@ -2243,7 +2242,8 @@ Ignore formatting a file by adding an ignore comment at the top of the file: .help("Enable formatting YAML files") .value_parser(FalseyValueParser::new()) .action(ArgAction::SetTrue) - .help_heading(FMT_HEADING), + .help_heading(FMT_HEADING) + .hide(true), ) }) } @@ -4374,10 +4374,7 @@ fn fmt_parse( let single_quote = matches.remove_one::("single-quote"); let prose_wrap = matches.remove_one::("prose-wrap"); let no_semicolons = matches.remove_one::("no-semicolons"); - let unstable_css = matches.get_flag("unstable-css"); - let unstable_html = matches.get_flag("unstable-html"); let unstable_component = matches.get_flag("unstable-component"); - let unstable_yaml = matches.get_flag("unstable-yaml"); flags.subcommand = DenoSubcommand::Fmt(FmtFlags { check: matches.get_flag("check"), @@ -4389,10 +4386,7 @@ fn fmt_parse( prose_wrap, no_semicolons, watch: watch_arg_parse(matches)?, - unstable_css, - unstable_html, unstable_component, - unstable_yaml, }); Ok(()) } @@ -6272,10 +6266,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Default::default(), }), ..Flags::default() @@ -6298,10 +6289,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Default::default(), }), ..Flags::default() @@ -6324,10 +6312,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Default::default(), }), ..Flags::default() @@ -6350,10 +6335,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Some(Default::default()), }), ..Flags::default() @@ -6385,10 +6367,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: true, - unstable_html: true, unstable_component: true, - unstable_yaml: true, watch: Some(WatchFlags { hmr: false, no_clear_screen: true, @@ -6422,10 +6401,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Some(Default::default()), }), ..Flags::default() @@ -6448,10 +6424,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Default::default(), }), config_flag: ConfigFlag::Path("deno.jsonc".to_string()), @@ -6482,10 +6455,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Some(Default::default()), }), config_flag: ConfigFlag::Path("deno.jsonc".to_string()), @@ -6521,10 +6491,7 @@ mod tests { single_quote: Some(true), prose_wrap: Some("never".to_string()), no_semicolons: Some(true), - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Default::default(), }), ..Flags::default() @@ -6554,10 +6521,7 @@ mod tests { single_quote: Some(false), prose_wrap: None, no_semicolons: Some(false), - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Default::default(), }), ..Flags::default() -- cgit v1.2.3