-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[BuildCheck Suggestion]: Detect use of Exec task to run "dotnet build" or similar commands #11125
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
Comments
Hi @dsplaisted, @surayya-MS, I am interested in working on this issue. Considering it has been open for some time now and has both |
@baronfel @rainersigwald Do we have guidance for folks that want to contribute build checks? Ilya would like to help out with this one. |
@dsplaisted, thanks. Considering that BuildCheck is a relatively new feature, this seems pretty straightforward to me, so while any guidance would be appreciated, it's not necessary. I can start right away, just wanted to confirm that it's available for external contribution, given that it has an "internal" label. |
I think the main things that will be interesting are:
After that, it should just be a matter of trial-and-error to get the semantics we want on the check itself! |
@baronfel, not sure if I got this right, but do you mean that this check should not be one of the built-in build checks which are being registered by default in the RegisterBuiltInChecks internal method? |
Oh I'm sorry - I thought I was in the SDK repo. You're exactly right - there are no barriers at all to creating a built-in buildcheck. Carry on! |
@dsplaisted, @baronfel, I prepared PR #11523 implementing the new build check, could you please take a look? |
#11523 detects |
Summary
We should warn when an
Exec
task is used to spawn a new build viadotnet build
,dotnet publish
, etc.Background and Motivation
It's usually a bad pattern to run
dotnet build
,dotnet publish
, etc from anExec
task, since this spawns an entirely separate build that the MSBuild engine doesn't have visibility over. We should recommend using anMSBuild
task instead.Sample issue or antipattern that the check should be flagging
Source: dotnet/sdk#45034 (comment)
Sample output
No response
The text was updated successfully, but these errors were encountered: