-
Notifications
You must be signed in to change notification settings - Fork 196
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
Fail if an enumerated argument does not lie within a given set of values #2987
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.
LGTM, is easier to read
I think I prefer declarations with checks more, because they are explicit in that "this property may have been set earlier". Plain <property name="dita.xhtml.reloadstylesheet" value="false"/> is shorter and thus easier to read, but this leads to reading it as "set <condition property="dita.xhtml.reloadstylesheet" value="false">
<not><isset property="dita.xhtml.reloadstylesheet"/></not>
</condition> Is explicit and reminds you that the value may not be set in all cases. |
This is the key point. Either you can assume that the developer understands how ANT works or you need to be explicit. If you feel there is a need to be more explicit, I would suggest keeping the list of <!-- Setting default values of any unset properties ->
<property/>
<property/>
<property/> This would make the reference explicit but also significantly reduce the number of lines of code which was the intent in the first case. Personally I find it harder to remember the names of the properties if they are spread out so much, and ANT syntax is notoriously verbose already - why make it even more verbose? So what do you think? Annotate with comments or revert 468a4f2 and leave the other commit? |
I don't think it's too much to expect of anyone who reads or writes Ant build scripts to know that Ant properties are immutable (which, incidentally, is the best thing about Ant). I'm not sure it's worth writing out the property names twice everywhere on the off chance that someone might not know that. |
#3297 implements the removal of |
* Added new failure message * Added Checked for enumerated values Signed-off-by: Jason Fox <jason.fox@fiware.org>
9ac3776
to
1d88fdf
Compare
@jelovirt - I have isolated the regex-based change and rebased onto the tip of |
This issue has been automatically marked as stale because it has not been updated recently. It will be closed soon if no further activity occurs. Thank you for your contributions. |
Description
Simplified ANT scripts by removing unnecessary<condition>
statements.DOTA015F
<matches>
conditionMotivation and Context
Adds a check for enumerated parameters. Fails if parameter is not in the required range.Fixes #1935.
How Has This Been Tested?
Manual testing. Ran xhtml transform with and without valid generate.copy.outer parameter
Type of Changes
Checklist
I have not found any coding convention for ANT scripts.
No unit test has been added.