Skip to content
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

Add missing getters for unity task command line options #116

Merged
merged 1 commit into from
Sep 3, 2021

Conversation

Azurelol
Copy link
Contributor

@Azurelol Azurelol commented Aug 25, 2021

Description

Add missing getters for Unity task command line options, and a generated test that will catch if any newer ones don't have them implemented.

resolves #114

Changes

  • UPDATE UnityCommandLineSpec

Comment on lines 178 to 196
[testCase, useSetter, value] <<
[
UnityCommandLineOption.argumentFlags.collect(
{ it -> ["${it}", it.flag] }),
[true, false],
["foobar", ""]
].combinations()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't like these arrays as it is visually super hard to understand what the values will be. I know that you want to save space and don't repeat yourself.

Also this setup and the test case before could be rolled into one or?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this approach is safer since anytime we add command line options we automatically catch if the setters/getters are not added for them. It is also much easier to maintain.

I would like to avoid the duplication in the setup for these test cases but I haven't yet figured how to factor it out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That said, I do understand your point.

I have added comments to these test cases to explain how they work.

@Azurelol Azurelol force-pushed the add/missing_unity_command_line_getters branch from fccdc5e to 3da5d33 Compare August 26, 2021 09:15
@Azurelol Azurelol requested a review from Larusso August 30, 2021 07:34
Comment on lines +79 to +84
// For each option that is a flag (with a boolean value)
UnityCommandLineOption.flags.collect(
{ it -> ["${it}", it.flag] }),
// Test with and without the setter
[true, false],
// Test both true and false values
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I think that commends won't make this more readable. Again that is why I prefer the table definitions since it might be more verbose but it is clearer which variable will have which value (in most cases)
The commends here now won't help really to see what you want to achieve with the nested array

@Larusso Larusso merged commit 4061e2b into master Sep 3, 2021
@Larusso Larusso deleted the add/missing_unity_command_line_getters branch September 3, 2021 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide getters to underlying Property for commandline properties
2 participants