BL0007: Component parameters should be auto property ignores .editoronfig on linux
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Describe the bug
Having a component which violates the new BL0007 rule will lead to an build on linux machine (github action) even though the analyzers severity is set to None
in a .editorconfig
.
This seems only to happen on a linux machine.
Also in the latest nightly builds we can reproduce this issue.
Example code from here: https://github.com/bUnit-dev/bUnit/pull/672/commits/54dffbf798da858d5230eb82a3f40f471af6af6a And here the failing build result for that specific commit: https://github.com/bUnit-dev/bUnit/runs/5837646463?check_suite_focus=true
We also could reproduce this with the latest version (7.0.0-preview.3.22175.4
- nightly docker sdk builds) see here: https://github.com/linkdotnet/bUnit/runs/5851324603?check_suite_focus=true#step:6:12
Expected Behavior
Should not be shown as warning / error. Only the following snippet will “remove” the error
#pragma warning disable BL0007
...
#pragma warning restore BL0007
Steps To Reproduce
See bug description
Exceptions (if any)
No response
.NET Version
7.0.100-preview.2.22153.17
Anything else?
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:10
I do think there are very valid cases, especially two-way binding aka
@bind-Value
:BL0007 would now suggest moving the
ValueChanged.InvokeAsync
outside, so I have to duplicate that code where ever that event would have triggered.Ran into this today. I have three cases:
In fact, this is why we have properties in the first place–to allow abstractions on getting and setting. Otherwise, why not bind to plain old fields?
I like this warning so as to encourage use of @bind:after, but I wonder if there is a more nuanced way.