mirror of
https://github.com/bitwarden/server.git
synced 2024-12-11 15:17:44 +01:00
Add git hook for formating (#2224)
This commit is contained in:
parent
5ecf7b9440
commit
b612426782
8
.git-hooks/pre-commit
Executable file
8
.git-hooks/pre-commit
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
FILES=$(git diff --cached --name-only --diff-filter=ACM "*.cs")
|
||||||
|
if [ -n "$FILES" ]
|
||||||
|
then
|
||||||
|
dotnet format ./bitwarden-server.sln --no-restore --include $FILES
|
||||||
|
echo "$FILES" | xargs git add
|
||||||
|
fi
|
12
README.md
12
README.md
@ -75,15 +75,11 @@ No grant of any rights in the trademarks, service marks, or logos of Bitwarden i
|
|||||||
|
|
||||||
### Dotnet-format
|
### Dotnet-format
|
||||||
|
|
||||||
We recently migrated to using dotnet-format as code formatter. All previous branches will need to updated to avoid large merge conflicts using the following steps:
|
Consider installing our git pre-commit hook for automatic formatting.
|
||||||
|
|
||||||
1. Check out your local Branch
|
```bash
|
||||||
2. Run `git merge 61dc65aa598b1f492d2f0222bb7bf0dd15d116f5`
|
git config --local core.hooksPath .git-hooks
|
||||||
3. Resolve any merge conflicts, commit.
|
```
|
||||||
4. Run `dotnet tool run dotnet-format`
|
|
||||||
5. Commit
|
|
||||||
6. Run `git merge -Xours 23b0a1f9df25058ab29785ecad9a233113c10889`
|
|
||||||
7. Push
|
|
||||||
|
|
||||||
### File Scoped Namespaces
|
### File Scoped Namespaces
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user