From 9c3a304af88da153fbb02f9075bf4190188fe8e1 Mon Sep 17 00:00:00 2001 From: Amolith Date: Sun, 24 Sep 2023 17:07:42 -0400 Subject: [PATCH] add justfile and ci-lint config --- .golangci.toml | 114 +++++++++++++++++++++++++++++++++++++++++++++++++ justfile | 26 +++++++++++ 2 files changed, 140 insertions(+) create mode 100644 .golangci.toml create mode 100644 justfile diff --git a/.golangci.toml b/.golangci.toml new file mode 100644 index 0000000..9819e4c --- /dev/null +++ b/.golangci.toml @@ -0,0 +1,114 @@ +# SPDX-FileCopyrightText: Amolith +# +# SPDX-License-Identifier: CC0-1.0 + +[run] +concurrency = 8 +timeout = "30m" +issues-exit-code = 1 +tests = true +skip-dirs = ["frontend"] +modules-download-mode = "readonly" +go = "" + +[output] +print-issued-lines = false +print-linter-name = true +uniq-by-line = false +path-prefix = "" +sort-results = true + +[issues] +max-issues-per-linter = 0 +max-same-issues = 0 +new = false +fix = false + +[linters] +fast = false +eeable = [ + "asasalint", + "asciicheck", + "bidichk", + "bodyclose", + "contextcheck", + "durationcheck", + "errcheck", + "errname", + "errorlint", + "exportloopref", + "gocritic", + "godot", + "gofumpt", + "goimports", + "gomoddirectives", + "gosec", + "gosimple", + "govet", + "ineffassign", + "misspell", + "nakedret", + "nilerr", + "nilnil", + "noctx", + "nolintlint", + "prealloc", + "predeclared", + "promlinter", + "reassign", + "revive", + "rowserrcheck", + "sqlclosecheck", + "stylecheck", + "tagliatelle", + "tenv", + "testableexamples", + "thelper", + "tparallel", + "unconvert", + "unparam", + "unused", + "usestdlibvars", + "wastedassign", + "containedctx", + "cyclop", + "decorder", + "depguard", + "dogsled", + "dupl", + "dupword", + "errchkjson", + "execinquery", + "exhaustive", + "exhaustruct", + "forcetypeassert", + "funlen", + "gci", + "gocheckcompilerdirectives", + "gocognit", + "gocyclo", + "godox", + "goerr113", + "gomnd", + "gomodguard", + "goprintffuncname", + "grouper", + "importas", + "interfacebloat", + "ireturn", + "lll", + "loggercheck", + "maintidx", + "makezero", + "musttag", + "nestif", + "nonamedreturns", + "nosprintfhostport", + "paralleltest", + "testpackage", + "typecheck", + "varnamelen", + "whitespace", + "wrapcheck", + "wsl" +] diff --git a/justfile b/justfile new file mode 100644 index 0000000..f4676d9 --- /dev/null +++ b/justfile @@ -0,0 +1,26 @@ +# SPDX-FileCopyrightText: Amolith +# +# SPDX-License-Identifier: CC0-1.0 + +default: reuse lint test staticcheck + +reuse: + reuse lint + +lint: + # Linting Go code + go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + golangci-lint run + +test: + # Running tests + go test -v ./... + +staticcheck: + # Performing static analysis + go install honnef.co/go/tools/cmd/staticcheck@latest + staticcheck ./... + +clean: + # Cleaning up + rm -rf willow