Skip to content

Commit

Permalink
Merge pull request #118 from linjie7674/ci/pre_commit_lint
Browse files Browse the repository at this point in the history
ci: config code linter in pre-commit hook
  • Loading branch information
IRONICBo committed Feb 7, 2024
2 parents c7ef660 + bdc728f commit 51366c9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/golangci/golangci-lint # golangci-lint hook repo
rev: v1.54.0 # golangci-lint hook repo revision
hooks:
- id: golangci-lint
name: golangci-lint
description: Fast linters runner for Go.
entry: golangci-lint run --fix
types: [go]
language: golang
pass_filenames: false
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,20 @@ gop run .

1. **Fork the repository to your local repo**

2. **Modify your own code**
2. **Config code linter**

```bash
// install pre-commit
pip install pre-commit

3. **Commit your code**
// config code linter in pre-commit hook
pre-commit install
```

4. **Create a pull request**
3. **Modify your own code**

4. **Commit your code**

5. **Create a pull request**

> **Note:** Please check the PR brach is `mvp-20240119` or not.

0 comments on commit 51366c9

Please sign in to comment.