Skip to content

Commit

Permalink
chore: add pre-commit hook for dotnet formatting (#15)
Browse files Browse the repository at this point in the history
* chore: add husky dotnet format pre commit hook

* chore: add files to commit when running husky

* chore: run editorconfig

---------

Co-authored-by: Quake <QuakeEye@users.noreply.GitHub.com>
  • Loading branch information
QuakeEye and QuakeEye authored Mar 18, 2024
1 parent f401280 commit 1796efc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"husky": {
"version": "0.6.4",
"commands": [
"husky"
]
}
}
}
7 changes: 7 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

dotnet format -v diag

# Add any changes made by dotnet format to the commit
git add .
2 changes: 1 addition & 1 deletion Aplib.Tests/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
global using Xunit;
global using Xunit;
2 changes: 1 addition & 1 deletion Aplib.Tests/Tools/TestGoalBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Aplib.Tests.Tools;

internal sealed class TestGoalBuilder
{
private Tactic _tactic = new TacticStub(() => {});
private Tactic _tactic = new TacticStub(() => { });
private Goal.HeuristicFunction _heuristicFunction = CommonHeuristicFunctions.Constant(0);
private string _name = "Such a good goal name";
private string _description = "\"A lie is just a good story that someone ruined with the truth.\" ~ Barney Stinson";
Expand Down

0 comments on commit 1796efc

Please sign in to comment.