Git pre-commit and pre-push actions
This commit is contained in:
parent
284ab3079c
commit
057d0a25e6
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"isRoot": true,
|
||||||
|
"tools": {
|
||||||
|
"husky": {
|
||||||
|
"version": "0.7.2",
|
||||||
|
"commands": [
|
||||||
|
"husky"
|
||||||
|
],
|
||||||
|
"rollForward": false
|
||||||
|
},
|
||||||
|
"jetbrains.resharper.globaltools": {
|
||||||
|
"version": "2024.3.6",
|
||||||
|
"commands": [
|
||||||
|
"jb"
|
||||||
|
],
|
||||||
|
"rollForward": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
4618
.editorconfig
4618
.editorconfig
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
STAGED_CS=`git diff --cached --name-only --diff-filter=ACMR --pickaxe-regex "*.cs" | tr '\n' ';'`
|
||||||
|
|
||||||
|
dotnet husky run --group pre-commit --args $STAGED_CS
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
## husky task runner examples -------------------
|
||||||
|
## Note : for local installation use 'dotnet' prefix. e.g. 'dotnet husky'
|
||||||
|
|
||||||
|
dotnet husky run --group pre-push
|
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://alirezanet.github.io/Husky.Net/schema.json",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"name": "Run Tests",
|
||||||
|
"group": "pre-push",
|
||||||
|
"command": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"test",
|
||||||
|
"PkmnLib.Tests/PkmnLib.Tests.csproj",
|
||||||
|
"--verbosity",
|
||||||
|
"minimal"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "JB Code Style",
|
||||||
|
"group": "pre-commit",
|
||||||
|
"command": "dotnet",
|
||||||
|
"pathMode": "relative",
|
||||||
|
"filteringRule": "staged",
|
||||||
|
"args": [
|
||||||
|
"jb",
|
||||||
|
"cleanupcode",
|
||||||
|
"PkmnLib.NET.sln",
|
||||||
|
"--profile=Built-in: Reformat & Apply Syntax Style",
|
||||||
|
"--include=${args}"
|
||||||
|
],
|
||||||
|
"include": ["**/*.cs"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -40,4 +40,9 @@
|
||||||
<Target Name="WorkaroundRider117732" AfterTargets="Build" Condition="!$([MSBuild]::IsOSPlatform('Windows'))">
|
<Target Name="WorkaroundRider117732" AfterTargets="Build" Condition="!$([MSBuild]::IsOSPlatform('Windows'))">
|
||||||
<Copy Condition="Exists('$(OutputPath)$(AssemblyName)')" SourceFiles="$(OutputPath)$(AssemblyName)" DestinationFiles="$(OutputPath)$(AssemblyName).exe"/>
|
<Copy Condition="Exists('$(OutputPath)$(AssemblyName)')" SourceFiles="$(OutputPath)$(AssemblyName)" DestinationFiles="$(OutputPath)$(AssemblyName).exe"/>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="Husky" BeforeTargets="Restore;CollectPackageReferences" Condition="'$(HUSKY)' != 0">
|
||||||
|
<Exec Command="dotnet tool restore" StandardOutputImportance="Low" StandardErrorImportance="High" />
|
||||||
|
<Exec Command="dotnet husky install" StandardOutputImportance="Low" StandardErrorImportance="High" WorkingDirectory=".." />
|
||||||
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
Loading…
Reference in New Issue