-
-
Notifications
You must be signed in to change notification settings - Fork 735
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 helper for argument validation #1561
Comments
This could also be helpful Cake internally to simplify argument checking, like its eg done here. If this is of interest I can provide a PR for a class similar to the one which we use in the Cake.Prca Addin. |
@pascalberger I would have no objection to this. @cake-build/cake-team thoughts? |
This sounds pretty awesome if it makes it easier. It is a common pattern in every addin. |
I agree, this would be great. There's already several argument validation frameworks - I wonder if any of them have source-only NuGet packages... |
Agreed that it would be good to centralise this (few other candidates for that) 👍 @daveaglick I've used Ensure.That from @danielwertheim before, but looks like the source-only version hasn't gotten the latest updates yet.. |
Agreed! But instead of signature
I personally think ASP.NET team have a quite decent boilerplate here which I have used from time to time. |
Additional reason to centralise this I just noticed: the |
I like the link @mholo65 posted. |
OK, I'll create a PR containing a class based on the ASP.NET boilerplate. |
@pascalberger Just make sure to attribute ASP.NET project in your code. |
Since there's currently only interest for aliases providing argument checking but not also for a public class which can be consumed in addins, I'll leave this to someone else for implementing (or there is also already an implementation for such aliases in Cake.Incubator). |
Adding Up-for-grabs on this one. This is what we thought of:
to:
|
@mholo65 Perhaps we should reserve this one for https://yourfirstpr.github.io/? I could do the mentoring. |
@patriksvensson sounds good to me! |
@patriksvensson I'd be interested in trying this out |
@bookman220 Great! Do you want any help to get started or do you want to give it a shot yourself? |
@patriksvensson I'll probably need some help but let me figure out how to build this thing first. |
@patriksvensson @bookman220 I don't want to step on anyone's toes, I'm interested in trying this out if it is still up for grabs. This would be my first time contributing to open source. |
@sarithsutha @patriksvensson I do apologize for taking so long. I do think I may need some guidance however. Do I just open up the solution file in visual studio and compile it from there? If I haven't fixed the big within the next week you may take it sarithsutha |
@bookman220 thanks for your response. No rush, take your time, I don't mind waiting. I use Visual Studio 2017, I was able to just open the solution and compile it from there. And with VS code I was able to build using the Cake addin. |
@sarithsutha It appears I am having some trouble building the project. Apologies for needing such basic advice but I am new to Visual Studio and C#. It appears a fair amount of the solution failed to load and when I go to Build it just has the option to run a code analysis on the solution, which I did and you can see the output. Can you give me some pointers as to where to go from here? |
@bookman220 There seems to be problems loading the different projects according to the screenshot. The following prerequisites need to be installed:
The |
@patriksvensson I'd like to take a try on this one. |
What I'm planning to do :
Thoughts? |
As a developer, it would be preferable to more correctly support parameter names; Reference: Consider something like this, or overloads that would support the same..
So that the calling convention would be more akin to
|
@micheleissa This is still assigned to @bookman220. |
@kcamp |
@micheleissa What @kcamp means is that |
@patriksvensson gotcha. Silly me! |
So are you supposed to wait for a response from 'bookman220' |
@micheleissa let’s give him/her a couple of days to respond before reassigning it. |
sounds good. |
@patriksvensson @micheleissa Again I apologize for being so obtuse, but to be honest I am a little disheartened by how flummoxed I am by the environment, which is why it has taken me so long. I work with Javascript scripts in my day job and have debugged compilation errors in C# to get a game running using the Unity game engine, but for some reason I'm finding myself staring slack jawed at this even though it should be simple. At anry rate when I try to build it just says run code analysis on solution, and then in the output below it's all zeros: |
By the way I downloaded the .NET 2.0 SDK and I already had Visual Studio 2017, though it updated me to the latest version when I ran the installer. |
Apologies for forgetting to crop out the second screen by the way. |
@bookman220 What happens when you run the build [via Cake] from Powershell?
|
@kcamp @patriksvensson Do you guys have any suggestions? |
@bookman220 You seem to have a custom nuget source pointing at |
@patriksvensson I would have done no such thing intentionally. Any tips on how I might restore the default one? |
Maybe find the config file that is overriding the defaults? https://docs.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#config-file-locations-and-uses |
Hello. Can you just point out some checks which would be usefull to implement?
|
@qpooqp Did you tackle this one? |
To be honest i forgot about this one. |
@patriksvensson I have installed the NuGet Package Manager and am trying to see if "Sync-Package" would fix the issue. Do you know what value I should supply for the "Id" parameter here? |
@bookman220 I’m afraod that I have no clue what sync-packages does. If you’re trying to restore packages for the solution it should be enough to do a rebuild. |
@patriksvensson When I go to "Build" I only see "Run Code Analysis on Solution" and when I select that I get "========== Rebuild All: 0 succeeded, 0 failed, 0 skipped ==========" |
@bookman220 I have no idea why that occurs to you. Just to double check, do you open |
You'll need the .NET Core sdk bits too. |
@devlead Ok now I have the 4.7.2 .NET SDK (added the targeting pack for good measure): |
@patriksvensson I happened to be reading an article on Docker containers and I wondered if that could help people with creating an environment in which myself and others could build the app: https://www.sumologic.com/blog/devops/kubernetes-vs-docker/ |
Hey is this one done? To everyone greeted with 404 error on hitting up the ASP.NET example, the updated location is here. |
Each Cake addin requires some kind of argument validation (or at least should :). Instead of having to implement this in every addin it would be nice if this could be provided for common cases (null check, empty string check, ...) by Cake.Core.
The text was updated successfully, but these errors were encountered: