mirror of
https://github.com/astro/deadnix.git
synced 2024-12-18 00:52:17 +03:00
feat: Provide pre-commit hook configuration and docs
This commit is contained in:
parent
29303ce4c0
commit
60af7e9880
7
.pre-commit-hooks.yaml
Normal file
7
.pre-commit-hooks.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
- id: deadnix
|
||||
name: deadnix
|
||||
description: Scan Nix files for dead code
|
||||
entry: deadnix
|
||||
args: [--fail]
|
||||
types: [nix]
|
||||
language: system
|
20
README.md
20
README.md
@ -77,6 +77,26 @@ Warning: Unused declarations were found.
|
||||
$ nix run github:astro/deadnix -- -eq test.nix
|
||||
```
|
||||
|
||||
## Usage with [pre-commit](https://pre-commit.com/)
|
||||
|
||||
Add the following to your project's `.pre-commit-config.yaml`:
|
||||
```yaml
|
||||
repos:
|
||||
- repo: https://github.com/astro/deadnix
|
||||
rev: ID # frozen: VERSION
|
||||
hooks:
|
||||
- id: deadnix
|
||||
#args: [--edit] # Uncomment to automatically modify files
|
||||
stages: [commit]
|
||||
```
|
||||
|
||||
Replace `ID` and `VERSION` above with the relevant version tag and
|
||||
commit ID for reference, for example:
|
||||
|
||||
```yaml
|
||||
rev: da39a3ee5e6b4b0d3255bfef95601890afd80709 # frozen: v1.2.3
|
||||
```
|
||||
|
||||
## Behavior
|
||||
|
||||
### Renaming of all unused to lambda args to start with `_`
|
||||
|
Loading…
Reference in New Issue
Block a user