I want to check for warnings (code style IDEXXX and code quality CAXXX) only staged files before push.
I expect something like this:
We do
dotnet build -warnaserrorsfor the soutionWe filter the output so we can see only warnings from staged files
If there is any warning, we fail the push
I have something similar but for dotnet format
{
"tasks": [
{
"name": "dotnet-format-staged-files",
"group": "pre-push-operations",
"command": "dotnet",
"args": ["format", "--include", "${staged}"],
"include": ["**/*.cs"]
}
]
}