From 2b6bf7f95b21443296ece7fe97c0cc31ab62f172 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Wed, 7 Sep 2022 00:06:17 -0700 Subject: [PATCH 1/8] Add echo-comments Add a new setting "echo-comments", which defaults to true. If unset, this causes lines internal to a non-shebang recipe beginning with the character '#' (including '#!' internal to a non-shebang recipe; that is, any such instances occurring after the first line of a recipe) to be treated as comments of the justfile itself. They will not be echoed to stderr when the recipe executes. --- GRAMMAR.md | 1 + README.md | 19 +++++----- src/analyzer.rs | 3 ++ src/justfile.rs | 13 ++++++- src/keyword.rs | 1 + src/line.rs | 7 ++++ src/node.rs | 3 +- src/parser.rs | 47 +++++++++-------------- src/recipe.rs | 14 ++++++- src/setting.rs | 2 + src/settings.rs | 2 + tests/echo_comments.rs | 85 ++++++++++++++++++++++++++++++++++++++++++ tests/json.rs | 16 ++++++++ tests/lib.rs | 1 + 14 files changed, 171 insertions(+), 43 deletions(-) create mode 100644 tests/echo_comments.rs diff --git a/GRAMMAR.md b/GRAMMAR.md index 6e5f818ab9..c27d0d9398 100644 --- a/GRAMMAR.md +++ b/GRAMMAR.md @@ -59,6 +59,7 @@ assignment : NAME ':=' expression eol export : 'export' assignment setting : 'set' 'dotenv-load' boolean? + | 'set' 'echo-comments' boolean? | 'set' 'export' boolean? | 'set' 'positional-arguments' boolean? | 'set' 'allow-duplicate-recipes' boolean? diff --git a/README.md b/README.md index 61ff9211f9..04f102fa0e 100644 --- a/README.md +++ b/README.md @@ -641,15 +641,16 @@ foo: #### Table of Settings -| Name | Value | Description | -| ------------------------- | ------------------ | --------------------------------------------------------------------------------------------- | -| `allow-duplicate-recipes` | boolean | Allow recipes appearing later in a `justfile` to override earlier recipes with the same name. | -| `dotenv-load` | boolean | Load a `.env` file, if present. | -| `export` | boolean | Export all variables as environment variables. | -| `positional-arguments` | boolean | Pass positional arguments. | -| `shell` | `[COMMAND, ARGS…]` | Set the command used to invoke recipes and evaluate backticks. | -| `windows-shell` | `[COMMAND, ARGS…]` | Set the command used to invoke recipes and evaluate backticks. | -| `windows-powershell` | boolean | Use PowerShell on Windows as default shell. (Deprecated. Use `windows-shell` instead. | +| Name | Value | Default | Description | +| ------------------------- | ------------------ | --------|---------------------------------------------------------------------------------------------- | +| `allow-duplicate-recipes` | boolean | False | Allow recipes appearing later in a `justfile` to override earlier recipes with the same name. | +| `dotenv-load` | boolean | False | Load a `.env` file, if present. | +| `export` | boolean | False | Export all variables as environment variables. | +| `echo-comments` | boolean | True | Treat lines beginning with a '#' in the body of a recipe as comments, and do not print them. | +| `positional-arguments` | boolean | False | Pass positional arguments. | +| `shell` | `[COMMAND, ARGS…]` | - | Set the command used to invoke recipes and evaluate backticks. | +| `windows-shell` | `[COMMAND, ARGS…]` | - | Set the command used to invoke recipes and evaluate backticks. | +| `windows-powershell` | boolean | False | Use PowerShell on Windows as default shell. (Deprecated. Use `windows-shell` instead. | Boolean settings can be written as: diff --git a/src/analyzer.rs b/src/analyzer.rs index 39e03a5e6d..6cddcaa3fb 100644 --- a/src/analyzer.rs +++ b/src/analyzer.rs @@ -53,6 +53,9 @@ impl<'src> Analyzer<'src> { Setting::Export(export) => { settings.export = export; } + Setting::EchoComments(ignore) => { + settings.echo_comments = ignore; + } Setting::PositionalArguments(positional_arguments) => { settings.positional_arguments = positional_arguments; } diff --git a/src/justfile.rs b/src/justfile.rs index 26f06ea240..ae90df8e40 100644 --- a/src/justfile.rs +++ b/src/justfile.rs @@ -257,7 +257,15 @@ impl<'src> Justfile<'src> { let mut ran = BTreeSet::new(); for (recipe, arguments) in grouped { - Self::run_recipe(&context, recipe, arguments, &dotenv, search, &mut ran)?; + Self::run_recipe( + &context, + recipe, + arguments, + &dotenv, + search, + &self.settings, + &mut ran, + )?; } Ok(()) @@ -281,6 +289,7 @@ impl<'src> Justfile<'src> { arguments: &[&str], dotenv: &BTreeMap, search: &Search, + settings: &Settings, ran: &mut BTreeSet>, ) -> RunResult<'src, ()> { let mut invocation = vec![recipe.name().to_owned()]; @@ -319,6 +328,7 @@ impl<'src> Justfile<'src> { &arguments.iter().map(String::as_ref).collect::>(), dotenv, search, + settings, ran, )?; } @@ -341,6 +351,7 @@ impl<'src> Justfile<'src> { &evaluated.iter().map(String::as_ref).collect::>(), dotenv, search, + settings, &mut ran, )?; } diff --git a/src/keyword.rs b/src/keyword.rs index 2913e7115a..f08a3f6e88 100644 --- a/src/keyword.rs +++ b/src/keyword.rs @@ -10,6 +10,7 @@ pub(crate) enum Keyword { Export, False, If, + EchoComments, PositionalArguments, Set, Shell, diff --git a/src/line.rs b/src/line.rs index 6f26506d52..f0bc6dc966 100644 --- a/src/line.rs +++ b/src/line.rs @@ -12,6 +12,13 @@ impl<'src> Line<'src> { self.fragments.is_empty() } + pub(crate) fn is_comment(&self) -> bool { + match self.fragments.first() { + Some(Fragment::Text { token }) => token.lexeme().starts_with('#'), + _ => false, + } + } + pub(crate) fn is_continuation(&self) -> bool { match self.fragments.last() { Some(Fragment::Text { token }) => token.lexeme().ends_with('\\'), diff --git a/src/node.rs b/src/node.rs index 60eb042251..5ceb6d146e 100644 --- a/src/node.rs +++ b/src/node.rs @@ -228,7 +228,8 @@ impl<'src> Node<'src> for Set<'src> { | Setting::DotenvLoad(value) | Setting::Export(value) | Setting::PositionalArguments(value) - | Setting::WindowsPowerShell(value) => { + | Setting::WindowsPowerShell(value) + | Setting::EchoComments(value) => { set.push_mut(value.to_string()); } Setting::Shell(Shell { command, arguments }) diff --git a/src/parser.rs b/src/parser.rs index ac6324e50d..2748592d8d 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -755,36 +755,23 @@ impl<'tokens, 'src> Parser<'tokens, 'src> { let name = Name::from_identifier(self.presume(Identifier)?); let lexeme = name.lexeme(); - if Keyword::AllowDuplicateRecipes == lexeme { - let value = self.parse_set_bool()?; - return Ok(Set { - value: Setting::AllowDuplicateRecipes(value), - name, - }); - } else if Keyword::DotenvLoad == lexeme { - let value = self.parse_set_bool()?; - return Ok(Set { - value: Setting::DotenvLoad(value), - name, - }); - } else if Keyword::Export == lexeme { - let value = self.parse_set_bool()?; - return Ok(Set { - value: Setting::Export(value), - name, - }); - } else if Keyword::PositionalArguments == lexeme { - let value = self.parse_set_bool()?; - return Ok(Set { - value: Setting::PositionalArguments(value), - name, - }); - } else if Keyword::WindowsPowershell == lexeme { - let value = self.parse_set_bool()?; - return Ok(Set { - value: Setting::WindowsPowerShell(value), - name, - }); + let set_bool: Option = match Keyword::from_lexeme(lexeme) { + Some(kw) => match kw { + Keyword::AllowDuplicateRecipes => { + Some(Setting::AllowDuplicateRecipes(self.parse_set_bool()?)) + } + Keyword::DotenvLoad => Some(Setting::DotenvLoad(self.parse_set_bool()?)), + Keyword::EchoComments => Some(Setting::EchoComments(self.parse_set_bool()?)), + Keyword::Export => Some(Setting::Export(self.parse_set_bool()?)), + Keyword::PositionalArguments => Some(Setting::PositionalArguments(self.parse_set_bool()?)), + Keyword::WindowsPowershell => Some(Setting::WindowsPowerShell(self.parse_set_bool()?)), + _ => None, + }, + None => None, + }; + + if let Some(value) = set_bool { + return Ok(Set { name, value }); } self.expect(ColonEquals)?; diff --git a/src/recipe.rs b/src/recipe.rs index 63787a3f62..00291da64b 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -95,7 +95,7 @@ impl<'src, D> Recipe<'src, D> { } } - pub(crate) fn run_linewise<'run>( + fn run_linewise<'run>( &self, context: &RecipeContext<'src, 'run>, dotenv: &BTreeMap, @@ -114,6 +114,12 @@ impl<'src, D> Recipe<'src, D> { let mut continued = false; let quiet_command = lines.peek().map_or(false, |line| line.is_quiet()); let infallible_command = lines.peek().map_or(false, |line| line.is_infallible()); + + // Handle comment lines within a linewise recipe as ordinary just comments if and only if the + // echo_comments setting is false + let comments_in_recipe = !context.settings.echo_comments; + let comment_line = comments_in_recipe && lines.peek().map_or(false, |line| line.is_comment()); + loop { if lines.peek().is_none() { break; @@ -121,7 +127,7 @@ impl<'src, D> Recipe<'src, D> { let line = lines.next().unwrap(); line_number += 1; evaluated += &evaluator.evaluate_line(line, continued)?; - if line.is_continuation() { + if line.is_continuation() && !comment_line { continued = true; evaluated.pop(); } else { @@ -138,6 +144,10 @@ impl<'src, D> Recipe<'src, D> { command = &command[1..]; } + if comment_line { + continue; + } + if command.is_empty() { continue; } diff --git a/src/setting.rs b/src/setting.rs index 6349cabda6..ace0fde4ed 100644 --- a/src/setting.rs +++ b/src/setting.rs @@ -4,6 +4,7 @@ use super::*; pub(crate) enum Setting<'src> { AllowDuplicateRecipes(bool), DotenvLoad(bool), + EchoComments(bool), Export(bool), PositionalArguments(bool), Shell(Shell<'src>), @@ -16,6 +17,7 @@ impl<'src> Display for Setting<'src> { match self { Setting::AllowDuplicateRecipes(value) | Setting::DotenvLoad(value) + | Setting::EchoComments(value) | Setting::Export(value) | Setting::PositionalArguments(value) | Setting::WindowsPowerShell(value) => write!(f, "{}", value), diff --git a/src/settings.rs b/src/settings.rs index c755a60459..09d54bfc72 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -9,6 +9,7 @@ pub(crate) const WINDOWS_POWERSHELL_ARGS: &[&str] = &["-NoLogo", "-Command"]; pub(crate) struct Settings<'src> { pub(crate) allow_duplicate_recipes: bool, pub(crate) dotenv_load: Option, + pub(crate) echo_comments: bool, pub(crate) export: bool, pub(crate) positional_arguments: bool, pub(crate) shell: Option>, @@ -22,6 +23,7 @@ impl<'src> Settings<'src> { allow_duplicate_recipes: false, dotenv_load: None, export: false, + echo_comments: true, positional_arguments: false, shell: None, windows_powershell: false, diff --git a/tests/echo_comments.rs b/tests/echo_comments.rs new file mode 100644 index 0000000000..bb0bdf1a35 --- /dev/null +++ b/tests/echo_comments.rs @@ -0,0 +1,85 @@ +use super::*; + +#[test] +fn ignore_comments_in_recipe() { + Test::new() + .justfile( + " + set echo-comments := false + + some_recipe: + # A recipe-internal comment + echo something-useful + ", + ) + .stdout("something-useful\n") + .stderr("echo something-useful\n") + .run(); +} + +#[test] +fn dont_ignore_comments_in_recipe_by_default() { + Test::new() + .justfile( + " + some_recipe: + # A recipe-internal comment + echo something-useful + ", + ) + .stdout("something-useful\n") + .stderr("# A recipe-internal comment\necho something-useful\n") + .run(); +} + +#[test] +fn ignore_recipe_comments_with_shell_setting() { + Test::new() + .justfile( + " + set shell := ['echo', '-n'] + set echo-comments := false + + some_recipe: + # Alternate shells still ignore comments + echo something-useful + ", + ) + .stdout("something-useful\n") + .stderr("echo something-useful\n") + .run(); +} + +#[test] +fn continuations_iwth_echo_comments_false() { + Test::new() + .justfile( + " + set echo-comments := false + + some_recipe: + # Comment lines ignore line continuations \\ + echo something-useful + ", + ) + .stdout("something-useful\n") + .stderr("echo something-useful\n") + .run(); +} + +#[test] +fn continuations_with_echo_comments_true() { + Test::new() + .justfile( + " + set echo-comments := true + + some_recipe: + # comment lines can be continued \\ + echo something-useful + ", + ) + .stdout("") + .stderr("# comment lines can be continued echo something-useful\n") + .run(); +} diff --git a/tests/json.rs b/tests/json.rs index e312111df9..6142c47fb1 100644 --- a/tests/json.rs +++ b/tests/json.rs @@ -42,6 +42,7 @@ fn alias() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, + "echo_comments": true, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -71,6 +72,7 @@ fn assignment() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, + "echo_comments": true, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -113,6 +115,7 @@ fn body() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, + "echo_comments": true, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -165,6 +168,7 @@ fn dependencies() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, + "echo_comments": true, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -254,6 +258,7 @@ fn dependency_argument() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, + "echo_comments": true, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -307,6 +312,7 @@ fn duplicate_recipes() { "allow_duplicate_recipes": true, "dotenv_load": null, "export": false, + "echo_comments": true, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -342,6 +348,7 @@ fn doc_comment() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, + "echo_comments": true, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -365,6 +372,7 @@ fn empty_justfile() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, + "echo_comments": true, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -497,6 +505,7 @@ fn parameters() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, + "echo_comments": true, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -568,6 +577,7 @@ fn priors() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, + "echo_comments": true, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -603,6 +613,7 @@ fn private() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, + "echo_comments": true, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -638,6 +649,7 @@ fn quiet() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, + "echo_comments": true, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -665,6 +677,7 @@ fn settings() { set dotenv-load set export set positional-arguments + set echo-comments := false set shell := ['a', 'b', 'c'] foo: @@ -691,6 +704,7 @@ fn settings() { "allow_duplicate_recipes": false, "dotenv_load": true, "export": true, + "echo_comments": false, "positional_arguments": true, "shell": { "arguments": ["b", "c"], @@ -732,6 +746,7 @@ fn shebang() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, + "echo_comments": true, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -767,6 +782,7 @@ fn simple() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, + "echo_comments": true, "positional_arguments": false, "shell": null, "windows_powershell": false, diff --git a/tests/lib.rs b/tests/lib.rs index 9867e3da96..49ec60851b 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -41,6 +41,7 @@ mod completions; mod conditional; mod delimiters; mod dotenv; +mod echo_comments; mod edit; mod equals; mod error_messages; From 9ed26d9e4794f5054cea240fffb04abbd61dcb1f Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 4 Oct 2022 16:55:25 -0700 Subject: [PATCH 2/8] Change name to skip-comments --- GRAMMAR.md | 2 +- README.md | 2 +- src/analyzer.rs | 6 ++-- src/keyword.rs | 2 +- src/node.rs | 2 +- src/parser.rs | 2 +- src/recipe.rs | 4 +-- src/setting.rs | 4 +-- src/settings.rs | 31 ++++++------------- tests/json.rs | 32 ++++++++++---------- tests/lib.rs | 2 +- tests/{echo_comments.rs => skip_comments.rs} | 8 ++--- 12 files changed, 42 insertions(+), 55 deletions(-) rename tests/{echo_comments.rs => skip_comments.rs} (92%) diff --git a/GRAMMAR.md b/GRAMMAR.md index c27d0d9398..e5009c8c08 100644 --- a/GRAMMAR.md +++ b/GRAMMAR.md @@ -59,7 +59,7 @@ assignment : NAME ':=' expression eol export : 'export' assignment setting : 'set' 'dotenv-load' boolean? - | 'set' 'echo-comments' boolean? + | 'set' 'skip-comments' boolean? | 'set' 'export' boolean? | 'set' 'positional-arguments' boolean? | 'set' 'allow-duplicate-recipes' boolean? diff --git a/README.md b/README.md index 04f102fa0e..782c1adf9e 100644 --- a/README.md +++ b/README.md @@ -646,7 +646,7 @@ foo: | `allow-duplicate-recipes` | boolean | False | Allow recipes appearing later in a `justfile` to override earlier recipes with the same name. | | `dotenv-load` | boolean | False | Load a `.env` file, if present. | | `export` | boolean | False | Export all variables as environment variables. | -| `echo-comments` | boolean | True | Treat lines beginning with a '#' in the body of a recipe as comments, and do not print them. | +| `skip-comments` | boolean | True | Skip recipe lines beginning with '#'. | | `positional-arguments` | boolean | False | Pass positional arguments. | | `shell` | `[COMMAND, ARGS…]` | - | Set the command used to invoke recipes and evaluate backticks. | | `windows-shell` | `[COMMAND, ARGS…]` | - | Set the command used to invoke recipes and evaluate backticks. | diff --git a/src/analyzer.rs b/src/analyzer.rs index 6cddcaa3fb..eb2058ae7f 100644 --- a/src/analyzer.rs +++ b/src/analyzer.rs @@ -40,7 +40,7 @@ impl<'src> Analyzer<'src> { } } - let mut settings = Settings::new(); + let mut settings = Settings::default(); for (_, set) in self.sets { match set.value { @@ -53,8 +53,8 @@ impl<'src> Analyzer<'src> { Setting::Export(export) => { settings.export = export; } - Setting::EchoComments(ignore) => { - settings.echo_comments = ignore; + Setting::SkipComments(ignore) => { + settings.skip_comments = ignore; } Setting::PositionalArguments(positional_arguments) => { settings.positional_arguments = positional_arguments; diff --git a/src/keyword.rs b/src/keyword.rs index f08a3f6e88..bc3646d999 100644 --- a/src/keyword.rs +++ b/src/keyword.rs @@ -10,7 +10,7 @@ pub(crate) enum Keyword { Export, False, If, - EchoComments, + SkipComments, PositionalArguments, Set, Shell, diff --git a/src/node.rs b/src/node.rs index 5ceb6d146e..7f75900834 100644 --- a/src/node.rs +++ b/src/node.rs @@ -229,7 +229,7 @@ impl<'src> Node<'src> for Set<'src> { | Setting::Export(value) | Setting::PositionalArguments(value) | Setting::WindowsPowerShell(value) - | Setting::EchoComments(value) => { + | Setting::SkipComments(value) => { set.push_mut(value.to_string()); } Setting::Shell(Shell { command, arguments }) diff --git a/src/parser.rs b/src/parser.rs index 2748592d8d..c749248deb 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -761,7 +761,7 @@ impl<'tokens, 'src> Parser<'tokens, 'src> { Some(Setting::AllowDuplicateRecipes(self.parse_set_bool()?)) } Keyword::DotenvLoad => Some(Setting::DotenvLoad(self.parse_set_bool()?)), - Keyword::EchoComments => Some(Setting::EchoComments(self.parse_set_bool()?)), + Keyword::SkipComments => Some(Setting::SkipComments(self.parse_set_bool()?)), Keyword::Export => Some(Setting::Export(self.parse_set_bool()?)), Keyword::PositionalArguments => Some(Setting::PositionalArguments(self.parse_set_bool()?)), Keyword::WindowsPowershell => Some(Setting::WindowsPowerShell(self.parse_set_bool()?)), diff --git a/src/recipe.rs b/src/recipe.rs index 00291da64b..d3b167682f 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -117,8 +117,8 @@ impl<'src, D> Recipe<'src, D> { // Handle comment lines within a linewise recipe as ordinary just comments if and only if the // echo_comments setting is false - let comments_in_recipe = !context.settings.echo_comments; - let comment_line = comments_in_recipe && lines.peek().map_or(false, |line| line.is_comment()); + let comment_line = + context.settings.skip_comments && lines.peek().map_or(false, |line| line.is_comment()); loop { if lines.peek().is_none() { diff --git a/src/setting.rs b/src/setting.rs index ace0fde4ed..12916754b3 100644 --- a/src/setting.rs +++ b/src/setting.rs @@ -4,7 +4,7 @@ use super::*; pub(crate) enum Setting<'src> { AllowDuplicateRecipes(bool), DotenvLoad(bool), - EchoComments(bool), + SkipComments(bool), Export(bool), PositionalArguments(bool), Shell(Shell<'src>), @@ -17,7 +17,7 @@ impl<'src> Display for Setting<'src> { match self { Setting::AllowDuplicateRecipes(value) | Setting::DotenvLoad(value) - | Setting::EchoComments(value) + | Setting::SkipComments(value) | Setting::Export(value) | Setting::PositionalArguments(value) | Setting::WindowsPowerShell(value) => write!(f, "{}", value), diff --git a/src/settings.rs b/src/settings.rs index 09d54bfc72..d2d7b8778f 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -5,32 +5,19 @@ pub(crate) const DEFAULT_SHELL_ARGS: &[&str] = &["-cu"]; pub(crate) const WINDOWS_POWERSHELL_SHELL: &str = "powershell.exe"; pub(crate) const WINDOWS_POWERSHELL_ARGS: &[&str] = &["-NoLogo", "-Command"]; -#[derive(Debug, PartialEq, Serialize)] +#[derive(Debug, PartialEq, Serialize, Default)] pub(crate) struct Settings<'src> { pub(crate) allow_duplicate_recipes: bool, pub(crate) dotenv_load: Option, - pub(crate) echo_comments: bool, pub(crate) export: bool, pub(crate) positional_arguments: bool, pub(crate) shell: Option>, + pub(crate) skip_comments: bool, pub(crate) windows_powershell: bool, pub(crate) windows_shell: Option>, } impl<'src> Settings<'src> { - pub(crate) fn new() -> Settings<'src> { - Settings { - allow_duplicate_recipes: false, - dotenv_load: None, - export: false, - echo_comments: true, - positional_arguments: false, - shell: None, - windows_powershell: false, - windows_shell: None, - } - } - pub(crate) fn shell_command(&self, config: &Config) -> Command { let (command, args) = self.shell(config); @@ -84,7 +71,7 @@ mod tests { #[test] fn default_shell() { - let settings = Settings::new(); + let settings = Settings::default(); let config = Config { shell_command: false, @@ -96,7 +83,7 @@ mod tests { #[test] fn default_shell_powershell() { - let mut settings = Settings::new(); + let mut settings = Settings::default(); settings.windows_powershell = true; let config = Config { @@ -116,7 +103,7 @@ mod tests { #[test] fn overwrite_shell() { - let settings = Settings::new(); + let settings = Settings::default(); let config = Config { shell_command: true, @@ -130,7 +117,7 @@ mod tests { #[test] fn overwrite_shell_powershell() { - let mut settings = Settings::new(); + let mut settings = Settings::default(); settings.windows_powershell = true; let config = Config { @@ -145,7 +132,7 @@ mod tests { #[test] fn shell_cooked() { - let mut settings = Settings::new(); + let mut settings = Settings::default(); settings.shell = Some(Shell { command: StringLiteral { @@ -170,7 +157,7 @@ mod tests { #[test] fn shell_present_but_not_shell_args() { - let mut settings = Settings::new(); + let mut settings = Settings::default(); settings.windows_powershell = true; let config = Config { @@ -183,7 +170,7 @@ mod tests { #[test] fn shell_args_present_but_not_shell() { - let mut settings = Settings::new(); + let mut settings = Settings::default(); settings.windows_powershell = true; let config = Config { diff --git a/tests/json.rs b/tests/json.rs index 6142c47fb1..34194b8d52 100644 --- a/tests/json.rs +++ b/tests/json.rs @@ -42,9 +42,9 @@ fn alias() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "echo_comments": true, "positional_arguments": false, "shell": null, + "skip_comments": false, "windows_powershell": false, "windows_shell": null, }, @@ -72,7 +72,7 @@ fn assignment() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "echo_comments": true, + "skip_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -115,7 +115,7 @@ fn body() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "echo_comments": true, + "skip_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -168,7 +168,7 @@ fn dependencies() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "echo_comments": true, + "skip_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -258,7 +258,7 @@ fn dependency_argument() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "echo_comments": true, + "skip_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -312,7 +312,7 @@ fn duplicate_recipes() { "allow_duplicate_recipes": true, "dotenv_load": null, "export": false, - "echo_comments": true, + "skip_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -348,7 +348,7 @@ fn doc_comment() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "echo_comments": true, + "skip_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -372,7 +372,7 @@ fn empty_justfile() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "echo_comments": true, + "skip_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -505,7 +505,7 @@ fn parameters() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "echo_comments": true, + "skip_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -577,7 +577,7 @@ fn priors() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "echo_comments": true, + "skip_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -613,7 +613,7 @@ fn private() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "echo_comments": true, + "skip_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -649,7 +649,7 @@ fn quiet() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "echo_comments": true, + "skip_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -677,7 +677,7 @@ fn settings() { set dotenv-load set export set positional-arguments - set echo-comments := false + set skip-comments set shell := ['a', 'b', 'c'] foo: @@ -704,7 +704,7 @@ fn settings() { "allow_duplicate_recipes": false, "dotenv_load": true, "export": true, - "echo_comments": false, + "skip_comments": true, "positional_arguments": true, "shell": { "arguments": ["b", "c"], @@ -746,7 +746,7 @@ fn shebang() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "echo_comments": true, + "skip_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -782,9 +782,9 @@ fn simple() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "echo_comments": true, "positional_arguments": false, "shell": null, + "skip_comments": false, "windows_powershell": false, "windows_shell": null, }, diff --git a/tests/lib.rs b/tests/lib.rs index 49ec60851b..fb67099149 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -41,7 +41,6 @@ mod completions; mod conditional; mod delimiters; mod dotenv; -mod echo_comments; mod edit; mod equals; mod error_messages; @@ -71,6 +70,7 @@ mod search; mod shebang; mod shell; mod show; +mod skip_comments; mod slash_operator; mod string; mod sublime_syntax; diff --git a/tests/echo_comments.rs b/tests/skip_comments.rs similarity index 92% rename from tests/echo_comments.rs rename to tests/skip_comments.rs index bb0bdf1a35..51aeb81391 100644 --- a/tests/echo_comments.rs +++ b/tests/skip_comments.rs @@ -5,7 +5,7 @@ fn ignore_comments_in_recipe() { Test::new() .justfile( " - set echo-comments := false + set skip-comments some_recipe: # A recipe-internal comment @@ -38,7 +38,7 @@ fn ignore_recipe_comments_with_shell_setting() { .justfile( " set shell := ['echo', '-n'] - set echo-comments := false + set skip-comments some_recipe: # Alternate shells still ignore comments @@ -55,7 +55,7 @@ fn continuations_iwth_echo_comments_false() { Test::new() .justfile( " - set echo-comments := false + set skip-comments some_recipe: # Comment lines ignore line continuations \\ @@ -72,7 +72,7 @@ fn continuations_with_echo_comments_true() { Test::new() .justfile( " - set echo-comments := true + set skip-comments := false some_recipe: # comment lines can be continued \\ From 0e916971b70ad174a368f5af6fbacefca0e21df1 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 4 Oct 2022 17:02:33 -0700 Subject: [PATCH 3/8] Fix readme default --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 782c1adf9e..8cfdb061ae 100644 --- a/README.md +++ b/README.md @@ -646,7 +646,7 @@ foo: | `allow-duplicate-recipes` | boolean | False | Allow recipes appearing later in a `justfile` to override earlier recipes with the same name. | | `dotenv-load` | boolean | False | Load a `.env` file, if present. | | `export` | boolean | False | Export all variables as environment variables. | -| `skip-comments` | boolean | True | Skip recipe lines beginning with '#'. | +| `skip-comments` | boolean | False | Skip recipe lines beginning with '#'. | | `positional-arguments` | boolean | False | Pass positional arguments. | | `shell` | `[COMMAND, ARGS…]` | - | Set the command used to invoke recipes and evaluate backticks. | | `windows-shell` | `[COMMAND, ARGS…]` | - | Set the command used to invoke recipes and evaluate backticks. | From 39d95dcd9f898f594d8b0d4cf15d3f9484bac692 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 4 Oct 2022 17:03:21 -0700 Subject: [PATCH 4/8] Fix setting name --- src/analyzer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/analyzer.rs b/src/analyzer.rs index eb2058ae7f..bf7465a2aa 100644 --- a/src/analyzer.rs +++ b/src/analyzer.rs @@ -53,8 +53,8 @@ impl<'src> Analyzer<'src> { Setting::Export(export) => { settings.export = export; } - Setting::SkipComments(ignore) => { - settings.skip_comments = ignore; + Setting::SkipComments(skip_comments) => { + settings.skip_comments = skip_comments; } Setting::PositionalArguments(positional_arguments) => { settings.positional_arguments = positional_arguments; From 88824ef22822e04e3748e533cfe77195e742dc5a Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 4 Oct 2022 17:04:15 -0700 Subject: [PATCH 5/8] Remove comment --- src/recipe.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/recipe.rs b/src/recipe.rs index d3b167682f..38e1c13c32 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -115,8 +115,6 @@ impl<'src, D> Recipe<'src, D> { let quiet_command = lines.peek().map_or(false, |line| line.is_quiet()); let infallible_command = lines.peek().map_or(false, |line| line.is_infallible()); - // Handle comment lines within a linewise recipe as ordinary just comments if and only if the - // echo_comments setting is false let comment_line = context.settings.skip_comments && lines.peek().map_or(false, |line| line.is_comment()); From babf22e70e74cb5f5cea244978dc694cf64fa47c Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 4 Oct 2022 17:14:24 -0700 Subject: [PATCH 6/8] Placate clippy --- src/settings.rs | 53 +++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/src/settings.rs b/src/settings.rs index d2d7b8778f..589cc48019 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -83,8 +83,10 @@ mod tests { #[test] fn default_shell_powershell() { - let mut settings = Settings::default(); - settings.windows_powershell = true; + let settings = Settings { + windows_powershell: true, + ..Default::default() + }; let config = Config { shell_command: false, @@ -117,8 +119,10 @@ mod tests { #[test] fn overwrite_shell_powershell() { - let mut settings = Settings::default(); - settings.windows_powershell = true; + let settings = Settings { + windows_powershell: true, + ..Default::default() + }; let config = Config { shell_command: true, @@ -132,20 +136,21 @@ mod tests { #[test] fn shell_cooked() { - let mut settings = Settings::default(); - - settings.shell = Some(Shell { - command: StringLiteral { - kind: StringKind::from_token_start("\"").unwrap(), - raw: "asdf.exe", - cooked: "asdf.exe".to_string(), - }, - arguments: vec![StringLiteral { - kind: StringKind::from_token_start("\"").unwrap(), - raw: "-nope", - cooked: "-nope".to_string(), - }], - }); + let settings = Settings { + shell: Some(Shell { + command: StringLiteral { + kind: StringKind::from_token_start("\"").unwrap(), + raw: "asdf.exe", + cooked: "asdf.exe".to_string(), + }, + arguments: vec![StringLiteral { + kind: StringKind::from_token_start("\"").unwrap(), + raw: "-nope", + cooked: "-nope".to_string(), + }], + }), + ..Default::default() + }; let config = Config { shell_command: false, @@ -157,8 +162,10 @@ mod tests { #[test] fn shell_present_but_not_shell_args() { - let mut settings = Settings::default(); - settings.windows_powershell = true; + let settings = Settings { + windows_powershell: true, + ..Default::default() + }; let config = Config { shell: Some("lol".to_string()), @@ -170,8 +177,10 @@ mod tests { #[test] fn shell_args_present_but_not_shell() { - let mut settings = Settings::default(); - settings.windows_powershell = true; + let settings = Settings { + windows_powershell: true, + ..Default::default() + }; let config = Config { shell_command: false, From b4e732b269813bbaa5fced8a207804443106f226 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 4 Oct 2022 17:19:19 -0700 Subject: [PATCH 7/8] Switch back to ignore-comments --- GRAMMAR.md | 2 +- README.md | 4 +-- src/analyzer.rs | 4 +-- src/keyword.rs | 2 +- src/node.rs | 2 +- src/parser.rs | 2 +- src/recipe.rs | 2 +- src/setting.rs | 4 +-- src/settings.rs | 2 +- .../{skip_comments.rs => ignore_comments.rs} | 8 ++--- tests/json.rs | 32 +++++++++---------- tests/lib.rs | 2 +- 12 files changed, 33 insertions(+), 33 deletions(-) rename tests/{skip_comments.rs => ignore_comments.rs} (93%) diff --git a/GRAMMAR.md b/GRAMMAR.md index e5009c8c08..6bb4afc12e 100644 --- a/GRAMMAR.md +++ b/GRAMMAR.md @@ -59,7 +59,7 @@ assignment : NAME ':=' expression eol export : 'export' assignment setting : 'set' 'dotenv-load' boolean? - | 'set' 'skip-comments' boolean? + | 'set' 'ignore-comments' boolean? | 'set' 'export' boolean? | 'set' 'positional-arguments' boolean? | 'set' 'allow-duplicate-recipes' boolean? diff --git a/README.md b/README.md index 8cfdb061ae..7da202f308 100644 --- a/README.md +++ b/README.md @@ -646,11 +646,11 @@ foo: | `allow-duplicate-recipes` | boolean | False | Allow recipes appearing later in a `justfile` to override earlier recipes with the same name. | | `dotenv-load` | boolean | False | Load a `.env` file, if present. | | `export` | boolean | False | Export all variables as environment variables. | -| `skip-comments` | boolean | False | Skip recipe lines beginning with '#'. | +| `ignore-comments` | boolean | False | Ignore recipe lines beginning with `#`. | | `positional-arguments` | boolean | False | Pass positional arguments. | | `shell` | `[COMMAND, ARGS…]` | - | Set the command used to invoke recipes and evaluate backticks. | -| `windows-shell` | `[COMMAND, ARGS…]` | - | Set the command used to invoke recipes and evaluate backticks. | | `windows-powershell` | boolean | False | Use PowerShell on Windows as default shell. (Deprecated. Use `windows-shell` instead. | +| `windows-shell` | `[COMMAND, ARGS…]` | - | Set the command used to invoke recipes and evaluate backticks. | Boolean settings can be written as: diff --git a/src/analyzer.rs b/src/analyzer.rs index bf7465a2aa..bbd4434f0a 100644 --- a/src/analyzer.rs +++ b/src/analyzer.rs @@ -53,8 +53,8 @@ impl<'src> Analyzer<'src> { Setting::Export(export) => { settings.export = export; } - Setting::SkipComments(skip_comments) => { - settings.skip_comments = skip_comments; + Setting::IgnoreComments(ignore_comments) => { + settings.ignore_comments = ignore_comments; } Setting::PositionalArguments(positional_arguments) => { settings.positional_arguments = positional_arguments; diff --git a/src/keyword.rs b/src/keyword.rs index bc3646d999..439a154028 100644 --- a/src/keyword.rs +++ b/src/keyword.rs @@ -10,7 +10,7 @@ pub(crate) enum Keyword { Export, False, If, - SkipComments, + IgnoreComments, PositionalArguments, Set, Shell, diff --git a/src/node.rs b/src/node.rs index 7f75900834..65c1c63cbc 100644 --- a/src/node.rs +++ b/src/node.rs @@ -229,7 +229,7 @@ impl<'src> Node<'src> for Set<'src> { | Setting::Export(value) | Setting::PositionalArguments(value) | Setting::WindowsPowerShell(value) - | Setting::SkipComments(value) => { + | Setting::IgnoreComments(value) => { set.push_mut(value.to_string()); } Setting::Shell(Shell { command, arguments }) diff --git a/src/parser.rs b/src/parser.rs index c749248deb..4e76082c3e 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -761,7 +761,7 @@ impl<'tokens, 'src> Parser<'tokens, 'src> { Some(Setting::AllowDuplicateRecipes(self.parse_set_bool()?)) } Keyword::DotenvLoad => Some(Setting::DotenvLoad(self.parse_set_bool()?)), - Keyword::SkipComments => Some(Setting::SkipComments(self.parse_set_bool()?)), + Keyword::IgnoreComments => Some(Setting::IgnoreComments(self.parse_set_bool()?)), Keyword::Export => Some(Setting::Export(self.parse_set_bool()?)), Keyword::PositionalArguments => Some(Setting::PositionalArguments(self.parse_set_bool()?)), Keyword::WindowsPowershell => Some(Setting::WindowsPowerShell(self.parse_set_bool()?)), diff --git a/src/recipe.rs b/src/recipe.rs index 38e1c13c32..80156f2203 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -116,7 +116,7 @@ impl<'src, D> Recipe<'src, D> { let infallible_command = lines.peek().map_or(false, |line| line.is_infallible()); let comment_line = - context.settings.skip_comments && lines.peek().map_or(false, |line| line.is_comment()); + context.settings.ignore_comments && lines.peek().map_or(false, |line| line.is_comment()); loop { if lines.peek().is_none() { diff --git a/src/setting.rs b/src/setting.rs index 12916754b3..a30abdc29f 100644 --- a/src/setting.rs +++ b/src/setting.rs @@ -4,7 +4,7 @@ use super::*; pub(crate) enum Setting<'src> { AllowDuplicateRecipes(bool), DotenvLoad(bool), - SkipComments(bool), + IgnoreComments(bool), Export(bool), PositionalArguments(bool), Shell(Shell<'src>), @@ -17,7 +17,7 @@ impl<'src> Display for Setting<'src> { match self { Setting::AllowDuplicateRecipes(value) | Setting::DotenvLoad(value) - | Setting::SkipComments(value) + | Setting::IgnoreComments(value) | Setting::Export(value) | Setting::PositionalArguments(value) | Setting::WindowsPowerShell(value) => write!(f, "{}", value), diff --git a/src/settings.rs b/src/settings.rs index 589cc48019..6e27305fdc 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -10,9 +10,9 @@ pub(crate) struct Settings<'src> { pub(crate) allow_duplicate_recipes: bool, pub(crate) dotenv_load: Option, pub(crate) export: bool, + pub(crate) ignore_comments: bool, pub(crate) positional_arguments: bool, pub(crate) shell: Option>, - pub(crate) skip_comments: bool, pub(crate) windows_powershell: bool, pub(crate) windows_shell: Option>, } diff --git a/tests/skip_comments.rs b/tests/ignore_comments.rs similarity index 93% rename from tests/skip_comments.rs rename to tests/ignore_comments.rs index 51aeb81391..1dc04b197c 100644 --- a/tests/skip_comments.rs +++ b/tests/ignore_comments.rs @@ -5,7 +5,7 @@ fn ignore_comments_in_recipe() { Test::new() .justfile( " - set skip-comments + set ignore-comments some_recipe: # A recipe-internal comment @@ -38,7 +38,7 @@ fn ignore_recipe_comments_with_shell_setting() { .justfile( " set shell := ['echo', '-n'] - set skip-comments + set ignore-comments some_recipe: # Alternate shells still ignore comments @@ -55,7 +55,7 @@ fn continuations_iwth_echo_comments_false() { Test::new() .justfile( " - set skip-comments + set ignore-comments some_recipe: # Comment lines ignore line continuations \\ @@ -72,7 +72,7 @@ fn continuations_with_echo_comments_true() { Test::new() .justfile( " - set skip-comments := false + set ignore-comments := false some_recipe: # comment lines can be continued \\ diff --git a/tests/json.rs b/tests/json.rs index 34194b8d52..8742b0b39b 100644 --- a/tests/json.rs +++ b/tests/json.rs @@ -44,7 +44,7 @@ fn alias() { "export": false, "positional_arguments": false, "shell": null, - "skip_comments": false, + "ignore_comments": false, "windows_powershell": false, "windows_shell": null, }, @@ -72,7 +72,7 @@ fn assignment() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "skip_comments": false, + "ignore_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -115,7 +115,7 @@ fn body() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "skip_comments": false, + "ignore_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -168,7 +168,7 @@ fn dependencies() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "skip_comments": false, + "ignore_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -258,7 +258,7 @@ fn dependency_argument() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "skip_comments": false, + "ignore_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -312,7 +312,7 @@ fn duplicate_recipes() { "allow_duplicate_recipes": true, "dotenv_load": null, "export": false, - "skip_comments": false, + "ignore_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -348,7 +348,7 @@ fn doc_comment() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "skip_comments": false, + "ignore_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -372,7 +372,7 @@ fn empty_justfile() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "skip_comments": false, + "ignore_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -505,7 +505,7 @@ fn parameters() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "skip_comments": false, + "ignore_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -577,7 +577,7 @@ fn priors() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "skip_comments": false, + "ignore_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -613,7 +613,7 @@ fn private() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "skip_comments": false, + "ignore_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -649,7 +649,7 @@ fn quiet() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "skip_comments": false, + "ignore_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -677,7 +677,7 @@ fn settings() { set dotenv-load set export set positional-arguments - set skip-comments + set ignore-comments set shell := ['a', 'b', 'c'] foo: @@ -704,7 +704,7 @@ fn settings() { "allow_duplicate_recipes": false, "dotenv_load": true, "export": true, - "skip_comments": true, + "ignore_comments": true, "positional_arguments": true, "shell": { "arguments": ["b", "c"], @@ -746,7 +746,7 @@ fn shebang() { "allow_duplicate_recipes": false, "dotenv_load": null, "export": false, - "skip_comments": false, + "ignore_comments": false, "positional_arguments": false, "shell": null, "windows_powershell": false, @@ -784,7 +784,7 @@ fn simple() { "export": false, "positional_arguments": false, "shell": null, - "skip_comments": false, + "ignore_comments": false, "windows_powershell": false, "windows_shell": null, }, diff --git a/tests/lib.rs b/tests/lib.rs index fb67099149..3e6f9d0a3e 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -50,6 +50,7 @@ mod export; mod fall_back_to_parent; mod fmt; mod functions; +mod ignore_comments; mod init; #[cfg(unix)] mod interrupts; @@ -70,7 +71,6 @@ mod search; mod shebang; mod shell; mod show; -mod skip_comments; mod slash_operator; mod string; mod sublime_syntax; From 71d517c15333451b898ef0f266ef2803c8fc52d7 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 4 Oct 2022 17:25:21 -0700 Subject: [PATCH 8/8] Placate clippy --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index 4aa7ead75c..41ab113e41 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ #![deny(clippy::all, clippy::pedantic)] #![allow( + clippy::default_trait_access, clippy::doc_markdown, clippy::enum_glob_use, clippy::missing_errors_doc,