Husky .NET check for warnings only staged files

25 Views Asked by At

I want to check for warnings (code style IDEXXX and code quality CAXXX) only staged files before push.

I expect something like this:

  1. We do dotnet build -warnaserrors for the soution

  2. We filter the output so we can see only warnings from staged files

  3. 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"]
     }
   ]
}
0

There are 0 best solutions below