Skip to content

Commit

Permalink
Merge pull request #872 from rkm/feature/pre-commit
Browse files Browse the repository at this point in the history
Add .pre-commit-hooks.yaml
  • Loading branch information
JoeRobich committed Mar 15, 2021
2 parents faef2d3 + 5b33180 commit 7e34307
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-hooks.yaml
@@ -0,0 +1,7 @@
---

- id: dotnet-format
name: dotnet format
language: dotnet
types_or: ['c#', 'vb']
entry: dotnet-format --include
19 changes: 17 additions & 2 deletions docs/integrations.md
@@ -1,7 +1,7 @@
# Integrations
Collection of advice how to auto check/format. Every sample expects dotnet format installed as local tool.
Collection of advice how to auto check/format. Every sample expects dotnet format installed as local tool, unless otherwise noted.

## Pre-commit hook to reformat
## Git pre-commit hook to reformat

Create file `.git/hooks/pre-commit` with following contents:
```sh
Expand Down Expand Up @@ -46,3 +46,18 @@ Add following to your build file:


These instructions originally authored by [leotsarev](https://github.com/joinrpg/joinrpg-net/).


## [pre-commit.com](https://pre-commit.com/) hook to reformat

Add the following block to the `repos` section of your `.pre-commit-config.yaml` file:

```yaml
- repo: https://github.com/dotnet/format
rev: "" # Specify a tag or sha here, or run "pre-commit autoupdate"
hooks:
- id: dotnet-format
```
Note that this will install dotnet format to an isolated environment, using the system installation of the dotnet CLI. See the [pre-commit.com documentation](https://pre-commit.com/#dotnet) for more details.

These instructions originally authored by [rkm](https://github.com/rkm)

0 comments on commit 7e34307

Please sign in to comment.