Skip to content

Commit

Permalink
Enable more linters (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome authored Feb 8, 2024
1 parent d8a91de commit d49c3ed
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 104 deletions.
15 changes: 13 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ linters-settings:
- name: unused-parameter
- name: var-declaration
- name: var-naming
govet:
check-shadowing: true
enable-all: true

linters:
enable:
enable:
- asciicheck
- bidichk
- dupword
- errcheck
- errorlint
- gofmt
Expand All @@ -45,15 +50,21 @@ linters:
- misspell
- nilerr
- noctx
- perfsprint
- predeclared
- reassign
- revive
- staticcheck
- tagalign
- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
disable-all: true
- whitespace
disable-all: true
issues:
max-issues-per-linter: 0
max-same-issues: 0
Expand Down
68 changes: 29 additions & 39 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,37 @@
# 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.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-added-large-files
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-case-conflict
- id: check-vcs-permalinks
- id: mixed-line-ending
args: [--fix=lf]
- id: no-commit-to-branch
- id: fix-byte-order-marker
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-added-large-files
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-case-conflict
- id: check-vcs-permalinks
- id: mixed-line-ending
args: [--fix=lf]
- id: no-commit-to-branch
- id: fix-byte-order-marker

- repo: local
hooks:
- id: golang-diff
name: create-go-diff
entry: bash -c 'git diff -p origin/main > /tmp/diff.patch'
language: system
types: [go]
pass_filenames: false
- repo: https://github.com/golangci/golangci-lint
rev: v1.55.2
hooks:
- id: golangci-lint-full

- repo: https://github.com/golangci/golangci-lint
rev: v1.55.2
hooks:
- id: golangci-lint
args: [--new-from-patch=/tmp/diff.patch]
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.2
hooks:
- id: gitleaks

- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.2
hooks:
- id: gitleaks

- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.12.1
hooks:
- id: markdownlint-cli2
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.12.1
hooks:
- id: markdownlint-cli2

ci:
skip: [golang-diff, golangci-lint]
skip: [golangci-lint-full]
Loading

0 comments on commit d49c3ed

Please sign in to comment.