Skip to content

Add additional Squirrel parameters - #2431

Merged
matthid merged 2 commits into
fsprojects:release/nextfrom
pchinery:Add-Squirrel-parameters
Dec 11, 2019
Merged

matthid merged 2 commits into
fsprojects:release/nextfrom
pchinery:Add-Squirrel-parameters

Conversation

@pchinery

Copy link
Copy Markdown
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
Copy Markdown
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

matthid commented Nov 27, 2019

Copy link
Copy Markdown
Member

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
Copy Markdown
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

matthid commented Nov 27, 2019

Copy link
Copy Markdown
Member

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

@matthid matthid left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

matthid commented Dec 11, 2019

Copy link
Copy Markdown
Member

Thanks, looks good!

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