Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 16 additions & 22 deletions backend/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,12 @@ run:
timeout: 5m
issues-exit-code: 1
tests: true
skip-dirs:
- vendor/
- .git/
- tmp/
skip-files:
- ".*\\.pb\\.go$"
- ".*\\.gen\\.go$"

output:
format: colored-line-number
formats:
- format: colored-line-number
print-issued-lines: true
print-linter-name: true
uniq-by-line: true
path-prefix: ""
sort-results: true

Expand Down Expand Up @@ -85,9 +78,8 @@ linters-settings:
max: 8

# Magic numbers
gomnd:
mnd:
settings:
mnd:
checks:
- argument
- case
Expand Down Expand Up @@ -257,9 +249,8 @@ linters:
- durationcheck
- errname
- errorlint
- execinquery
- exhaustive
- exportloopref
- copyloopvar
- forbidigo
- forcetypeassert
- funlen
Expand All @@ -278,7 +269,7 @@ linters:
- gofumpt
- goheader
- goimports
- gomnd
- mnd
- gomoddirectives
- gomodguard
- goprintffuncname
Expand Down Expand Up @@ -309,7 +300,7 @@ linters:
- sqlclosecheck
- stylecheck
- tagliatelle
- tenv
- usetesting
- testableexamples
- thelper
- tparallel
Expand All @@ -324,19 +315,22 @@ linters:

disable:
- depguard # We manage dependencies appropriately
- exhaustivestruct # Too restrictive
- exhaustruct # Too restrictive
- gochecksumtype # Not needed for this project
- goerr113 # Too restrictive for this project
- golint # Deprecated
- interfacer # Deprecated
- maligned # Deprecated
- err113 # Too restrictive for this project
- nosnakecase # We use snake_case for JSON/DB tags
- paralleltest # Not all tests need to be parallel
- scopelint # Deprecated
- testpackage # Not required for this project

issues:
exclude-dirs:
- vendor/
- .git/
- tmp/
exclude-files:
- ".*\\.pb\\.go$"
- ".*\\.gen\\.go$"
uniq-by-line: true
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
Expand Down Expand Up @@ -366,7 +360,7 @@ issues:
# Exclude magic number issues in tests and main files
- path: "(main|_test)\\.go"
linters:
- gomnd
- mnd

exclude-use-default: false
max-issues-per-linter: 0
Expand Down
2 changes: 0 additions & 2 deletions backend/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"os"
"strings"
"testing"
"time"

Expand Down
3 changes: 2 additions & 1 deletion backend/notes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import (
"bytes"
"context"
"crypto/rand"
"encoding/base64"
"encoding/json"
"fmt"
"net/http/httptest"
"testing"
"time"

"github.com/gofiber/fiber/v2"
"github.com/google/uuid"
"github.com/jackc/pgx/v5/pgxpool"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
Expand Down
1 change: 0 additions & 1 deletion backend/security_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"bytes"
"context"
"crypto/rand"
"encoding/json"
"fmt"
Expand Down
Loading