Skip to content

Commit

Permalink
Add a setup target to Makefile with pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
scorphus committed Sep 3, 2020
1 parent 42bc9f0 commit aa3264b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,38 @@
repos:
- repo: local
hooks:
- id: trailing-whitespace-fixer
name: trailing-whitespace-fixer
entry: trailing-whitespace-fixer
language: system
types: [non-executable, file, text]
exclude_types: [markdown]

- id: end-of-file-fixer
name: end-of-file-fixer
entry: end-of-file-fixer
language: system
types: [non-executable, file, text]
exclude_types: [markdown]

- id: rustfmt
name: cargo fmt
entry: cargo fmt
pass_filenames: false
language: system
types: [rust]

- id: clippy
name: cargo clippy
entry: cargo clippy --all-targets --all-features -- -D warnings
pass_filenames: false
language: system
types: [rust]

- id: test
name: cargo test
entry: cargo test
pass_filenames: false
language: system
types: [rust]
stages: [push]
8 changes: 8 additions & 0 deletions Makefile
@@ -1,3 +1,11 @@
setup:
@rustup component add rustfmt
@rustup component add clippy
@type -p pre-commit >/dev/null 2>&1 || \
(echo "Please install pre-commit and try again"; exit 1)
@pre-commit install -f --hook-type pre-commit
@pre-commit install -f --hook-type pre-push

mongo:
@docker run --name wallet-api-mongo --rm -p 27017:27017 \
--mount type=bind,source=$(PWD)/datadir,target=/data/db -d mongo
Expand Down

0 comments on commit aa3264b

Please sign in to comment.