Ashthos / Cake.StyleCop

Stylecop implementation for the CakeBuild build system.
MIT License
5 stars 14 forks source link

Filter out solution folders when iterating projects #2

Closed luisgoncalves closed 7 years ago

luisgoncalves commented 7 years ago

Version 0.15 of Cake introduced support for solution folders on SolutionParser. This broke Cake.StyleCop because additional items are now returned on the Projects collection and those items don't have a corresponding .csproj file on disk.

We need to filter out the "projects" that are actually solution fodlers.I see two options to handle this:

  1. Hard-code the well-known magic string for the Type of solution folders. This keeps the dependency on Cake in the same version.
  2. Assume the minimum version of Cake to 0.15.0 and filter out either using the SolutionFolder class or the SolutionFolder.TypeIdentifier constant.

Since Cake still doesn't have a way of matching addin versions to Cake versions, option 2 may break some scenarios. But everything is still on v 0.XX.X.

Which would you prefer?

Symbianx commented 7 years ago

I've created a pull request where I've taken the first approach to fix it for folder project types. There may be some projects that will break the addin as well, but I'm not confortable enough with the .sln format to know.

Symbianx commented 7 years ago

@Ashthos any word on this?

vip32 commented 7 years ago

i can confirm that solution folders are causing problems with the stylecop addin. please include @Symbianx his PR

luisgoncalves commented 7 years ago

Any news on this?

Symbianx commented 7 years ago

@luisgoncalves, this issue has been fixed with the merge of PR #3.