-
Notifications
You must be signed in to change notification settings - Fork 20
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
Make fishtape file compatible with fish_indent #34
Comments
Note that I might lack some insight in both Addressing the use of For instance, we could write test.fish:
Neither |
@edouard-lopez I am sure you're already aware of this, but I should point out that this is not valid fish either. |
Sure but
I update the issue to target compatibility instead of validity. Do you think it's an attainable goal? |
Using Anyway it could be: begin "say_hello"
echo Hello $argv
end begin test_say_hello
$HOME = $DIRNAME
end begin test:say_hello
echo Hello $argv
end Is there other alternative syntax you can think of? |
@edouard-lopez All of those look good, also: begin test "is home"
$HOME = $DIRNAME
end |
Good one. However vscode-fish-ide show a syntax error:
|
Fortunately, that's not true with fish 3.0 anymore, so you can just upgrade to the 3.0 beta and that bit should be gone. /plug So... what you two seem to be discussing is how to make this look like fish-script. That solves the immediate concern that fish_indent indents it "wrong", but it's still essentially invalid fish-script. You're still saving this as ".fish", and E.g. begin test "is home"
$HOME = $DIRNAME
end will test if "is home" is a non-empty string, throw away the result, then try to run $HOME as a command with the arguments "=" and "$DIRNAME" (post-3.0) or print an error that variables aren't allowed as commands (pre-3.0). Why not either invent syntax whole-cloth and call the scripts ".tape", or find a way to make this working fish-script, just with some convenience functions? |
@edouard-lopez I've updated #31 with the new syntax I have in mind. Feedback welcome. 🙏 |
@edouard-lopez Fishtape tests are now compatible with |
related: #32, fish-shell/fish-shell#5399
From discussion with @jorgebucaran and @faho it appears using fishtape file aren't
validcompatible fish file. Hence the problem met while trying to format them withfish_indent
(cf. #32).Rationale
Adopting a
validcompatible fish syntax will let us leverage all the tooling related tofish
and help developers adopt testing approaches. So we get better integration and better software quality.Fishtape example
Roadblocks
Can we list the roadblocks that prevent
fishtape
file from beingvalidcompatible fish file ?test
already has a specific meaning in fish, and it does not start blocks.test
is a keyword in fish 3.0The text was updated successfully, but these errors were encountered: