mirror of
https://github.com/apricote/hcloud-upload-image.git
synced 2026-01-13 21:31:03 +00:00
chore: setup pre-commit
This commit is contained in:
parent
043c73cf7d
commit
9fc97a2421
5 changed files with 61 additions and 7 deletions
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
|
|
@ -30,7 +30,6 @@ jobs:
|
||||||
args: --timeout 5m
|
args: --timeout 5m
|
||||||
working-directory: hcloudimages
|
working-directory: hcloudimages
|
||||||
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -45,7 +44,6 @@ jobs:
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: go test -v -race -coverpkg=./...,./hcloudimages/... ./... ./hcloudimages/...
|
run: go test -v -race -coverpkg=./...,./hcloudimages/... ./... ./hcloudimages/...
|
||||||
|
|
||||||
|
|
||||||
go-mod-tidy:
|
go-mod-tidy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,6 @@ nfpms:
|
||||||
file_info:
|
file_info:
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
||||||
|
|
||||||
aurs:
|
aurs:
|
||||||
- name: hcloud-upload-image-bin
|
- name: hcloud-upload-image-bin
|
||||||
homepage: "https://github.com/apricote/hcloud-upload-image"
|
homepage: "https://github.com/apricote/hcloud-upload-image"
|
||||||
|
|
@ -104,12 +103,9 @@ aurs:
|
||||||
install -Dm644 "./completions/hcloud-upload-image.zsh" "${pkgdir}/usr/share/zsh/site-functions/_hcloud-upload-image"
|
install -Dm644 "./completions/hcloud-upload-image.zsh" "${pkgdir}/usr/share/zsh/site-functions/_hcloud-upload-image"
|
||||||
install -Dm644 "./completions/hcloud-upload-image.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/hcloud-upload-image.fish"
|
install -Dm644 "./completions/hcloud-upload-image.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/hcloud-upload-image.fish"
|
||||||
|
|
||||||
|
|
||||||
snapshot:
|
snapshot:
|
||||||
name_template: "{{ .Version }}-dev+{{ .ShortCommit }}"
|
name_template: "{{ .Version }}-dev+{{ .ShortCommit }}"
|
||||||
|
|
||||||
changelog:
|
changelog:
|
||||||
# Generated by release-please
|
# Generated by release-please
|
||||||
disable: true
|
disable: true
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
57
.pre-commit-config.yaml
Normal file
57
.pre-commit-config.yaml
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
# See https://pre-commit.com for more information
|
||||||
|
# See https://pre-commit.com/hooks.html for more hooks
|
||||||
|
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v4.6.0
|
||||||
|
hooks:
|
||||||
|
- id: check-added-large-files
|
||||||
|
- id: check-case-conflict
|
||||||
|
- id: check-symlinks
|
||||||
|
- id: destroyed-symlinks
|
||||||
|
|
||||||
|
- id: check-json
|
||||||
|
- id: check-yaml
|
||||||
|
- id: check-toml
|
||||||
|
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: mixed-line-ending
|
||||||
|
- id: trailing-whitespace
|
||||||
|
|
||||||
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||||
|
rev: v3.1.0
|
||||||
|
hooks:
|
||||||
|
- id: prettier
|
||||||
|
files: \.(md|ya?ml)$
|
||||||
|
exclude: CHANGELOG.md
|
||||||
|
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: shfmt
|
||||||
|
name: shfmt
|
||||||
|
description: Format shell scripts with shfmt
|
||||||
|
language: golang
|
||||||
|
additional_dependencies: [mvdan.cc/sh/v3/cmd/shfmt@v3.7.0]
|
||||||
|
entry: shfmt -i 2 -ci -sr -kp -w
|
||||||
|
types: [shell]
|
||||||
|
|
||||||
|
- repo: https://github.com/shellcheck-py/shellcheck-py
|
||||||
|
rev: v0.10.0.1
|
||||||
|
hooks:
|
||||||
|
- id: shellcheck
|
||||||
|
|
||||||
|
- repo: https://github.com/golangci/golangci-lint
|
||||||
|
rev: v1.58.2
|
||||||
|
hooks:
|
||||||
|
- id: golangci-lint-full
|
||||||
|
name: golangci-lint cli
|
||||||
|
exclude: hcloudimages/
|
||||||
|
- id: golangci-lint-full
|
||||||
|
name: golangci-lint lib
|
||||||
|
files: hcloudimages/
|
||||||
|
|
||||||
|
- repo: https://github.com/dnephin/pre-commit-golang
|
||||||
|
rev: v0.5.1
|
||||||
|
hooks:
|
||||||
|
- id: go-mod-tidy
|
||||||
|
|
@ -11,6 +11,9 @@
|
||||||
"gomodTidy",
|
"gomodTidy",
|
||||||
"gomodUpdateImportPaths"
|
"gomodUpdateImportPaths"
|
||||||
],
|
],
|
||||||
|
"pre-commit": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
"customManagers": [
|
"customManagers": [
|
||||||
{
|
{
|
||||||
"customType": "regex",
|
"customType": "regex",
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,5 @@ set -e
|
||||||
rm -rf completions
|
rm -rf completions
|
||||||
mkdir completions
|
mkdir completions
|
||||||
for sh in bash zsh fish; do
|
for sh in bash zsh fish; do
|
||||||
go run . completion "$sh" >"completions/hcloud-upload-image.$sh"
|
go run . completion "$sh" > "completions/hcloud-upload-image.$sh"
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue