NSBFUNC004 triggers for test projects referencing a project that has functions - #115
NSBFUNC004 triggers for test projects referencing a project that has functions#115andreasohlund wants to merge 5 commits into
Conversation
| // because SourceGeneratorTest currently does not flow WithProperty(...) values to analyzers. | ||
| // Keep this fallback until analyzer config options are propagated in Particular.AnalyzerTesting. | ||
| public static bool IsIsolatedFunctionsProject(Compilation compilation, AnalyzerConfigOptions options) | ||
| => IsIsolatedFunctionsProject(options) || compilation.GetTypeByMetadataName(FunctionAttribute) is not null; |
There was a problem hiding this comment.
This was the bug since it treated access to the attribute as "you are a functions project," which isn't correct
There was a problem hiding this comment.
Test projects will be treated as exe even though they have <OutputType>Library</OutputType> explicitly set
|
Needs to be updated with Particular/Particular.AnalyzerTesting#31 for tests to pass |
|
Should w switch to the function version instead? We can probably get it and just assert is greater than some version and be done with it? |
|
The more I think about it the more I'm convinced we should kill this. There is a lot of complexity and the danger of misbehaving for something that you literally type once and then never touch again as a user and when you hit F5 in dev and your functions haven't been invoked you also immediately know what's missing because that literally the first thing we point out in the documentation. |
|
I think that makes sense, I'll raise a PR to remove instead |
|
Replaced by #116 |
root cause: Test projects are treated like exes
due to