Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/compile_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,6 @@ impl Display for CompileError<'_> {
f,
"the guard `?` and infallible `-` sigils may not be used together"
),
Include => write!(
f,
"the `!include` directive has been stabilized as `import`"
),
IncompatibleSettings {
first,
first_line,
Expand Down
1 change: 0 additions & 1 deletion src/compile_error_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ pub(crate) enum CompileErrorKind<'src> {
function: &'src str,
},
GuardAndInfallibleSigil,
Include,
IncompatibleSettings {
first: Keyword,
first_line: usize,
Expand Down
1 change: 0 additions & 1 deletion src/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ impl<'src> Lexer<'src> {
fn lex_normal(&mut self, start: char) -> CompileResult<'src> {
match start {
' ' | '\t' => self.lex_whitespace(),
'!' if self.rest().starts_with("!include") => Err(self.error(Include)),
'!' => self.lex_choices('!', &[('=', BangEquals), ('~', BangTilde)], Bang),
'#' => self.lex_comment(),
'$' => self.lex_single(Dollar),
Expand Down
16 changes: 0 additions & 16 deletions tests/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,6 @@ fn listed_recipes_in_imports_are_in_load_order() {
.success();
}

#[test]
fn include_error() {
Test::new()
.justfile("!include foo")
.stderr(
"
error: the `!include` directive has been stabilized as `import`
——▶ justfile:1:1
1 │ !include foo
│ ^
",
)
.failure();
}

#[test]
fn recipes_in_import_are_overridden_by_recipes_in_parent() {
Test::new()
Expand Down
18 changes: 18 additions & 0 deletions tests/negation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,21 @@ fn requires_lists_setting() {
)
.failure();
}

#[test]
fn negate_include() {
Test::new()
.justfile(
"
set unstable
set lists

include := []

x := !include
",
)
.args(["--evaluate", "x"])
.stdout("true")
.success();
}
Loading