Skip to content

Commit

Permalink
Add pre-commit hooks configuration (#8)
Browse files Browse the repository at this point in the history
The pre-commit hooks are used to run code formatting checks before the
code is submitted to the repository with `git commit` command.

To setup the hooks follow the steps:

1. Install `pre-commit` tool: 
```sh
brew install pre-commit
```

3. Install the hooks for the repository: 
```sh
pre-commit install
```
  • Loading branch information
r-czajkowski authored Nov 1, 2023
2 parents 1294480 + bb1e92f commit ee3d77f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
repos:
- repo: local
hooks:
- id: lint-sol
name: "lint core sol"
entry: /usr/bin/env bash -c "cd core/ && npm run lint:sol"
files: '\.sol$'
language: script
description: "Checks solidity code according to the package's linter configuration"
- id: lint-js
name: "lint core ts/js"
entry: /usr/bin/env bash -c "cd core/ && npm run lint:js"
files: '\.(ts|js)$'
language: script
description: "Checks TS/JS code according to the package's linter configuration"
- id: lint-config
name: "lint core json/yaml"
entry: /usr/bin/env bash -c "cd core/ && npm run lint:config"
files: '\.(json|yaml)$'
language: script
description: "Checks JSON/YAML code according to the package's linter configuration"
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
# litmus
Bitcoin Liquid Staking

# Development

## Pre-commit Hooks

Developers are encouraged to use [pre-commit](https://pre-commit.com/) hooks to
automatically discover code issues, before they submit the code.

To setup the hooks follow the steps:

1. Install `pre-commit` tool:
```sh
brew install pre-commit
```

2. Install the hooks for the repository:
```sh
pre-commit install
```

0 comments on commit ee3d77f

Please sign in to comment.