-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: double_quotes #45
Conversation
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.
Does this work for nested placeholder strings? I haven't checked out the branch to test myself. e.g. String nested = "Hello ~{if alien then 'world' else planet}!"
. The inner 'world'
string should be flagged. There are other cases we probably want to check as well.
I'm fine with skipping over the command
block for now. That seems like a bonus check to me, that shouldn't hold up the other test conditions.
e694f85
to
e749054
Compare
It does appear to catch that condition. |
I rebased this to get the latest changes. Looking at the |
Ok so that's a good thing I think. As long as it doesn't apply to literal Bash code. e.g. look at this hypothetical command block
|
To clarify, it filters to |
That's perfect then. Let's add a my example as an actual test case for sanity, update Arena, and then this should be good to merge. |
Test added. I've updated Arena, but I was going to hold off until stjudecloud/workflows#157 is merged. However, I can commit the Arena warnings and move ahead with this first if you prefer. |
7603265
to
db5e5c0
Compare
This pull request adds a new rule to
wdl
.double_quotes
v1::W012
wdl-grammar
Warns about strings defined with single-quotes. This ignores anything located inside the command section. Tests are not exhaustive, there are quite a lot of things that are using strings. Should they still be added?
Before submitting this PR, please make sure:
CHANGELOG.md
(see"keep a changelog" for more information).
good, articulated reason as to why there should be more than one).
Rule specific checks:
tables (
wdl-ast/src/v1.rs
for AST-based rules andwdl-grammar/src/v1.rs
for parse tree-based rules).table at
RULES.md
.fn rules()
.wdl-ast
should be added tofn rules()
withinwdl-ast/src/v1/validation.rs
.wdl-ast
should be added tofn rules()
withinwdl-ast/src/v1/lint.rs
.wdl-grammar
should be added tofn rules()
withinwdl-grammar/src/v1/validation.rs
.wdl-grammar
should be added tofn rules()
withinwdl-grammar/src/v1/lint.rs
.within the file where the rule is implemented.
wdl-gauntlet --save-config
to ensure that all of the rulesadded/removed are now reflected in the baseline configuration file
(
Gauntlet.toml
).