1
0
mirror of https://github.com/casey/just synced 2024-07-01 07:24:45 +00:00

Compare commits

..

6 Commits

Author SHA1 Message Date
Marcin Drzymala
fac177559a
Merge 95d51ab933 into 570d3058cf 2024-06-25 23:36:56 +00:00
Marcin Drzymala
95d51ab933 WIP: Add JustfileKind to Search: Path or Stdin 2024-06-26 01:36:11 +02:00
Marcin Drzymala
2964a62542 Add WithStdin variants to SearchConfig 2024-06-26 01:36:11 +02:00
Casey Rodarmor
570d3058cf
Link to modules when first introduced in readme (#2193) 2024-06-25 21:59:42 +00:00
dependabot[bot]
c900b6f478
Update softprops/action-gh-release (#2183) 2024-06-24 12:42:39 -07:00
Casey Rodarmor
af86a471e2
Don't analyze comments when ignore-comments is set (#2180) 2024-06-21 20:39:34 +00:00
5 changed files with 50 additions and 7 deletions

View File

@ -95,7 +95,7 @@ jobs:
shell: bash
- name: Publish Archive
uses: softprops/action-gh-release@v2.0.5
uses: softprops/action-gh-release@v2.0.6
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
draft: false
@ -105,7 +105,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Changelog
uses: softprops/action-gh-release@v2.0.5
uses: softprops/action-gh-release@v2.0.6
if: >-
${{
startsWith(github.ref, 'refs/tags/')

View File

@ -656,8 +656,8 @@ Available recipes:
lint
```
Recipes in submodules can be listed with `just --list PATH`, where `PATH` is a
space- or `::`-separated module path:
Recipes in [submodules](#modules1190) can be listed with `just --list PATH`,
where `PATH` is a space- or `::`-separated module path:
```
$ cat justfile
@ -3145,7 +3145,7 @@ import? 'foo/bar.just'
Missing source files for optional imports do not produce an error.
### Modules <sup>1.19.0</sup>
### Modules<sup>1.19.0</sup>
A `justfile` can declare modules using `mod` statements. `mod` statements are
currently unstable, so you'll need to use the `--unstable` flag, or set the

View File

@ -149,7 +149,7 @@ impl<'src> Analyzer<'src> {
}
}
let recipes = RecipeResolver::resolve_recipes(recipe_table, &self.assignments)?;
let recipes = RecipeResolver::resolve_recipes(&self.assignments, &settings, recipe_table)?;
let mut aliases = Table::new();
while let Some(alias) = self.aliases.pop() {

View File

@ -8,8 +8,9 @@ pub(crate) struct RecipeResolver<'src: 'run, 'run> {
impl<'src: 'run, 'run> RecipeResolver<'src, 'run> {
pub(crate) fn resolve_recipes(
unresolved_recipes: Table<'src, UnresolvedRecipe<'src>>,
assignments: &'run Table<'src, Assignment<'src>>,
settings: &Settings,
unresolved_recipes: Table<'src, UnresolvedRecipe<'src>>,
) -> CompileResult<'src, Table<'src, Rc<Recipe<'src>>>> {
let mut resolver = Self {
resolved_recipes: Table::new(),
@ -39,6 +40,10 @@ impl<'src: 'run, 'run> RecipeResolver<'src, 'run> {
}
for line in &recipe.body {
if line.is_comment() && settings.ignore_comments {
continue;
}
for fragment in &line.fragments {
if let Fragment::Interpolation { expression, .. } = fragment {
for variable in expression.variables() {

View File

@ -97,3 +97,41 @@ fn dont_evaluate_comments() {
)
.run();
}
#[test]
fn dont_analyze_comments() {
Test::new()
.justfile(
"
set ignore-comments
some_recipe:
# {{ bar }}
",
)
.run();
}
#[test]
fn comments_still_must_be_parsable_when_ignored() {
Test::new()
.justfile(
"
set ignore-comments
some_recipe:
# {{ foo bar }}
",
)
.stderr(
"
error: Expected '}}', '(', '+', or '/', but found identifier
justfile:4:12
4 # {{ foo bar }}
^^^
",
)
.status(EXIT_FAILURE)
.run();
}