-
Notifications
You must be signed in to change notification settings - Fork 8
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
Make sure StyleCop is added to all projects #11
Comments
@gep13 Would Cake.CodeAnalysisReporting be interesting for creating reports (not only for StyleCop but for any analyzer / MSBuild warning) in Cake.Recipe? |
@pascalberger yes, would be very interested in adding this in 👍 |
Related to this, it would also be nice to provide a common ruleset for addins and for test projects. |
@pascalberger I think that would be a great idea. Where would you see that ruleset living? And how to get it into each project? |
Can't rulesets be published as nuget-packages? So we'd simply need to reference them? (The reference can then be tested for in the audit..) |
@nils-a short answer is I don’t know. If it is possible, I think this would be a great addition! |
In theory this is possible. In reality I don't know of any way which isn't full of pitfalls. In |
Hm. I was under the impression that "nowadays" no more powershell-voodoo was needed. I created a simple test package:
All worked in my tests. Maybe i am missing something. :-) My code is here: https://github.com/nils-a/test-common-analyzer testing can be done from: https://www.myget.org/feed/nils-a/package/nuget/test-common-analyzer |
@nils-a @pascalberger I was introduced to this project: https://github.com/endjin/Endjin.RecommendedPractices.NuGet And I was wondering if this could be useful here as well. |
Nice. Really elaborate. I like it. @gep13 Did you see they are shipping a default-icon in the package, too? (I feel that's a nice alternative to the git-submodule/always-copy-on-build discussion) (I'm currently on vacation with really cappy wi-fi, but I'd be willing to start a sample project if that's ok with you all..) |
@nils-a yes, I did notice that. I really like the idea of shipping the icon as a nuget package, and allowing it to be placed into the correct location, and updating of the necessary information. If you wanted to start the work on this, I would be happy for you to do this. |
@gep I started out with the (allegedly) easy task of providing a simple package to distibute the icon. Check out the work at https://github.com/nils-a/cake.cake-contrib-icon. Currently there is no magic set For the common "styleguide" I propose starting a repository (cake.cake-contrib-codestyles ?) in which we could start discussing what rules/styles to use. (for example in Cake.7zip I used stylecop & fxcop, but I also added an |
@gep13 ^^^ |
When this package is published, I volunteer to modify AddinDiscoverer to submit a PR to all 300+ addins so they reference this new package. |
@nils-a thanks for looking into this! I think we should start small with anything that we do as a NuGet package that contains the best practices for Cake-Contrib addins. To that end, if we can get a single NuGet package, which only adds the contained Cake-Contrib icon as an embedded icon to the project that it is being added to, I think it would be great to ship that as an initial release of the NuGet package. Are you at that point? |
@gep13 somewhat, yes. I'm not 100% satisfied with the current status of https://github.com/nils-a/cake.cake-contrib-icon but it's enough for a 0.1.0 release. |
@nils-a that sounds great! I think it would make sense to come up with a name that we can use going forward. @AdmiringWorm has recently created the CakeContrib.Analyzer project (https://github.com/AdmiringWorm/CakeContrib.Analyzer) so I think a name like CakeContrib.Guidelines would make sense. Thoughts? |
Oh, analyzers for Cake addins? Nice 👍
For a package enforcing guidelines for the cake-contrib organization I think CakeContrib.Guidelines makes sense. |
That is an interesting question. I can't speak for @AdmiringWorm here, but I think the naming was more to do with the fact that any Cake Addin is part of the extended Cake Contrib (i.e. the Cake Community) regardless of whether it was contained within the Cake-Contrib Organisation on GitHub. |
Speaking on my own behalf, the reason I went with CakeContrib as the name is because the end-goal of the analyzer is to recommend/enforce a common set of rules that Cake Contrib addins are expected to adhere to (once such rules have been agreed upon). With that said though, currently there are only two rules available in the analyzer, and none of them are specific to Cake Contrib addins, so it could very well be renamed to more of a general set of recommendations for all addins wether they are in Cake Contrib or not (currently only rules for missing |
IMHO it would be nice to have one project which provides rules for writing Cake addins, which is not related to cake-contrib projects. And another project which provides a default ruleset for cake-contrib projects (which would be CakeContrib.Guidelines with the above suggestion) |
Fair enough, I don't really disagree on the point of having a analyser for addins not related to cake-contrib. Regarding the suggestion of CakeContrib.Guidelines mentioned, to me that seems more geared towards the metadata specified in project files, and not really what analysers provide (which is static analysing of the source files themselves, but not on project files. At least not natively supported by the API provided by Microsoft). A small note on the analyser I am working on, it only supports MSBuild 16.0+ (VS2019), since there were some APIs not available in earlier versions of the CodeAnalyzer library that I wanted (forgot which ones though). |
To be clear (in other words: sometimes I'm a bit slow):
or is that one package and we're simply starting by "enforcing" the icon? |
@nils-a I think we should have a single package called CakeContrib.Guidelines. And since using an embedded icon is one of our guidelines, we should start with getting that deployed as part of the first version of this package. |
So I've created https://github.com/nils-a/CakeContrib.Guidelines and the 0.1.0-release is available at https://www.nuget.org/packages/CakeContrib.Guidelines/.
|
No description provided.
The text was updated successfully, but these errors were encountered: