Initial commit with golangci-lint.
This commit is contained in:
commit
21f4717bcd
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.idea
|
6
.pre-commit-hooks.yaml
Normal file
6
.pre-commit-hooks.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
- id: golangci-lint-mod
|
||||
name: 'golangci-lint-mod'
|
||||
entry: 'golangci-lint-mod.sh'
|
||||
language: 'script'
|
||||
description: 'Run golangci-lint in module mode (GO111MODULE=on)'
|
||||
pass_filenames: false
|
20
LICENSE
Normal file
20
LICENSE
Normal file
@ -0,0 +1,20 @@
|
||||
Copyright (c) 2020 by Stanislav Nikitin <pztrn@pztrn.name>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
README.md
Normal file
20
README.md
Normal file
@ -0,0 +1,20 @@
|
||||
# pre-commit hooks for golang
|
||||
|
||||
This repository contains [pre-commit](https://pre-commit.com) hooks for modern Golang developers.
|
||||
|
||||
## Using
|
||||
|
||||
Add this to your ``.pre-commit-config.yaml``:
|
||||
|
||||
```yaml
|
||||
repos:
|
||||
- repo: https://sources.dev.pztrn.name/pztrn/pre-commit-hooks-golang
|
||||
rev: master
|
||||
hooks:
|
||||
- id: golangci-lint-mod
|
||||
...
|
||||
```
|
||||
|
||||
## Hooks list
|
||||
|
||||
* ``golangci-lint-mod`` - executes ``golangci-lint`` in module mode (``GO111MODULES=on``)
|
5
golangci-lint-mod.sh
Normal file
5
golangci-lint-mod.sh
Normal file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
export GO111MODULE=on
|
||||
|
||||
$(which golangci-lint) run
|
Loading…
Reference in New Issue
Block a user