Skip to content

Commit

Permalink
Remove pre-commit from precommit.md (#16229)
Browse files Browse the repository at this point in the history
  • Loading branch information
louwers committed Apr 28, 2024
1 parent 22e9d52 commit 470d04e
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions docs/precommit.md
Expand Up @@ -19,22 +19,7 @@ This will install [husky](https://github.com/typicode/husky) and [lint-staged](h

Read more at the [lint-staged](https://github.com/okonet/lint-staged#configuration) repo.

## Option 2. [pre-commit](https://github.com/pre-commit/pre-commit)

**Use Case:** Great when working with multi-language projects.

Copy the following config into your `.pre-commit-config.yaml` file:

```yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "" # Use the sha or tag you want to point at
hooks:
- id: prettier
```

Read more at [mirror of prettier package for pre-commit](https://github.com/pre-commit/mirrors-prettier) and the [pre-commit](https://pre-commit.com) website.

## Option 3. [Husky.Net](https://github.com/alirezanet/Husky.Net)
## Option 2. [Husky.Net](https://github.com/alirezanet/Husky.Net)

**Use Case:** A dotnet solution to use Prettier along with other code quality tools (e.g. dotnet-format, ESLint, Stylelint, etc.). It supports multiple file states (staged - last-commit, git-files etc.)

Expand All @@ -55,7 +40,7 @@ after installation you can add prettier task to the `task-runner.json`.
}
```

## Option 4. [git-format-staged](https://github.com/hallettj/git-format-staged)
## Option 3. [git-format-staged](https://github.com/hallettj/git-format-staged)

**Use Case:** Great for when you want to format partially-staged files, and other options do not provide a good fit for your project.

Expand Down Expand Up @@ -107,7 +92,7 @@ Add or remove file extensions to suit your project. Note that regardless of whic

To read about how git-format-staged works see [Automatic Code Formatting for Partially-Staged Files](https://www.olioapps.com/blog/automatic-code-formatting/).

## Option 5. Shell script
## Option 4. Shell script

Alternately you can save this script as `.git/hooks/pre-commit` and give it execute permission:

Expand Down

0 comments on commit 470d04e

Please sign in to comment.