-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple recipe search path arguments #1475
Conversation
e458503
to
55667f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is totally reasonable. See review for comments.
@@ -225,4 +252,35 @@ mod tests { | |||
search_directory: None, | |||
arguments: ["a", "a=b"], | |||
} | |||
|
|||
test! { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these would be better as integration tests. I'd also add one that tries other args, like .
, ./foo
, ../foo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, any reason in particular an integration test would be better? Seems to me like a unit test can exercise the new functionality here, and that it's better to use a unit test than an integration test all else being equal because unit tests are simpler to set up and modify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With unit tests, you have to think about whether or not the unit test captures all aspects of the feature or change. In this case, the error test doesn't check the formatting of the error message, which an integration test would. But, engaging my brain for a second, I think it's fine here.
@neunenak I'm not acquainted with the source code here, nor with rust, but I'm interested in this change. Would you mind writing a higher level example[s] of what this change does? 🥺 |
Updated the description to hopefully make the intent of this change clearer. |
@neunenak Thanks! That makes sense to me. I really like the compromise you found. Should you also update the README.md part about "Invoking justfiles in Other Directories"? Currently, it says that a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I would:
- Add an integration test that checks the formatting of the error message.
- Update the readme
@@ -225,4 +252,35 @@ mod tests { | |||
search_directory: None, | |||
arguments: ["a", "a=b"], | |||
} | |||
|
|||
test! { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With unit tests, you have to think about whether or not the unit test captures all aspects of the feature or change. In this case, the error test doesn't check the formatting of the error message, which an integration test would. But, engaging my brain for a second, I think it's fine here.
Allow multiple search-path recipe arguments if the recipe search path is the same for all of them, and raise an error message if they have conflicting search paths.
Co-authored-by: Casey Rodarmor <[email protected]>
Co-authored-by: Casey Rodarmor <[email protected]>
Co-authored-by: Casey Rodarmor <[email protected]>
Co-authored-by: Casey Rodarmor <[email protected]>
Co-authored-by: Casey Rodarmor <[email protected]>
019c786
to
cd0cd8d
Compare
ac4d25f
to
104823b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, reworded the readme a little, but otherwise LGTM!
This reverts commit d499227.
- Revert #1475 - Add a test that arguments with different path prefixes are allowed
- Revert #1475 - Add a test that arguments with different path prefixes are allowed
Allow multiple search-path recipe arguments if the recipe search path is the same for all of them, and raise an error message if they have conflicting search paths.
This means that if you have a subdirectory
subdir
with a Justfile containingrecipe_a
andrecipe_b
, you can now invoke just asjust subdir/recipe_a subdir/recipe_b
, and have it correctly runrecipe_a
andrecipe_b
from that Justfile (the current behavior is that it will try to parse "subdir/recipe_b" as a recipe name in and of itself and fail).If you try to specify multiple separate Justfiles using this syntax (e.g.
just subdir1/recipe_a subdir2/recipe_b
where subdir1 and subdir2 contain different Justfiles),just
will fail with an error message.