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 additional Squirrel parameters #2431

Merged
merged 2 commits into from
Dec 11, 2019

Conversation

pchinery
Copy link
Contributor

Squirrel seems to have a few additional parameters, which I have added in this PR.

To have something to work with if things should change in future, I have also added "AdditionalArguments" to add raw arguments to the squirrel call. This is not a favorable solution to use, but rather a tool to create short-term workarounds. I'm open to discussing this part. It does help for the moment, but not having this option also has greatly accelerated me in creating the PR.

@pchinery
Copy link
Contributor Author

With all due respect and understanding, I would like to amend my point above. I know that the FAKE team (an especially @matthid) does a terrific job at a very high pace and there are loots of completely reasons, why a PR is not merged or discussed. So I don't want to push attention to my PR when other things have a higher priority.

For these situations, it would be helpful to keep the workaround way in my PR of adding required parameters on a short, as this would have allowed me to continue with my work and would take the pressure from the team to merge it.

So again, please don't feel pushed in any way. I'm still open to discuss the "all purpose" parameter list of course, but my opinion of its usefulness has changed a bit.

@matthid
Copy link
Member

matthid commented Nov 27, 2019

Don't assume there are any other reasons than just missing time. Every contribution is appreciated. Sorry just give me a couple of days to review and give feedback

@pchinery
Copy link
Contributor Author

Not a problem at all, missing time is one valid reasons for me, everyone has other work, family and time one might not want to spend on a computer. Waht I wanted to express: I fully understand any reason :)

@matthid
Copy link
Member

matthid commented Nov 27, 2019

Regarding the additional arguments field, afaik we have that on other modules as well. The only feedback is that is should be named similarly across modules

Copy link
Member

@matthid matthid left a comment

Choose a reason for hiding this comment

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

Sorry for the late review. I'd say this module needs updates to the new API and some tests. The change itself looks good to me besides the discussion about the name of the AdditionalArguments-field (the field itself is fine as we have it in lots of other modules). We could add documentation which states "if you need to use this field please consider sending a PR to FAKE in order to make life easier for everyone, thanks!"

FrameworkVersion : string option

/// Add other arguments, in case Squirrel adds new arguments in future
AdditionalArguments : string list
Copy link
Member

Choose a reason for hiding this comment

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

It seems like we have any combination of this name already, besides the one you have chosen 💃

Expecto:

      /// Custom arguments to use in the case the helper not yet supports them
      CustomArgs : string list

DotCover:

      CustomParameters: string

OpenCover:

          /// This options is used to add additional optional arguments, could be somthing like "-returntargetcode "
          OptionalArguments : string

InnoSetup

        /// Additional parameters
        AdditionalParameters : string option

Npm/Yarn

    | Custom of string

Chocolatey

        /// A character string containing additional arguments to give to choco.
        AdditionalArgs: string

I'm not sure but at least we should be consistent and I might enforce a name via contribution guidelines. Do you like any of the existing ones?

Copy link
Member

Choose a reason for hiding this comment

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

Also I'm not sure if it should be a list or just a string (and leave escaping to the user).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Facepalm for me... I'm sorry.

I think I would prefer AdditionalParameters. The way it is implemented right now, each parameter will be string escaped and surrounded with quotes. Not doing that is easy of course. In that case, I would change it to a string option. Do you have any preference between string option and string list? I can do the change on Sunday or Monday.

Copy link
Member

Choose a reason for hiding this comment

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

I was more pointing out the bad quality of the existing code base than the name you have chosen. In fact I think one more name doesn't even matter at this point, but we should work in unifying this in the next version and I'd "lock" the one we choose now in the contribution guidelines :D

There are some tools where the "escaping" will actually break them so I tend to just provide a simple string here, but I'm open for arguments for using a list, which I guess would be more "safe".


parameters.AdditionalArguments |> Seq.iter (fun arg -> StringBuilder.appendIfNotNullOrEmpty arg "" sb |> ignore)

sb
|> StringBuilder.appendIfNotNullOrEmpty nugetPackage "--releasify="
Copy link
Member

Choose a reason for hiding this comment

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

I'd recommend updating this to the Arguments/CreateProcess API as the StringBuilder is a bit unsafe

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 have now added a commit that uses the CreateProcess API and uses only a string option for the args

@pchinery pchinery force-pushed the Add-Squirrel-parameters branch from 494f4fe to 98a5031 Compare December 9, 2019 09:02
@matthid
Copy link
Member

matthid commented Dec 11, 2019

Thanks, looks good!

@matthid matthid changed the base branch from master to release/next December 11, 2019 22:35
@matthid matthid merged commit a56ebce into fsprojects:release/next Dec 11, 2019
@matthid matthid mentioned this pull request Dec 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants