Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
IA Automator committed Feb 28, 2024
0 parents commit ebfb40c
Show file tree
Hide file tree
Showing 24 changed files with 1,578 additions and 0 deletions.
1 change: 1 addition & 0 deletions .config/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
222 changes: 222 additions & 0 deletions .config/.golangcli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
# Options for analysis running.
run:
# Number of CPUs to use when running golangci-lint.
# Default: the number of logical CPUs in the machine
concurrency: 4
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 3m
# Exit code when at least one issue was found.
# Default: 1
issues-exit-code: 2
# Include test files or not.
# Default: true
tests: false
# List of build tags, all linters use it.
# Default: []
build-tags:
- mytag
# Which dirs to skip: issues from them won't be reported.
# Can use regexp here: `generated.*`, regexp is applied on full path,
# including the path prefix if one is set.
# Default dirs are skipped independently of this option's value (see skip-dirs-use-default).
# "/" will be replaced by current OS file path separator to properly work on Windows.
# Default: []
skip-dirs:
- node_modules
- .project_automation
- .config
# Enables skipping of directories:
# - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
# Default: true
skip-dirs-use-default: false
# Which files to skip: they will be analyzed, but issues from them won't be reported.
# There is no need to include all autogenerated files,
# we confidently recognize autogenerated files.
# If it's not, please let us know.
# "/" will be replaced by current OS file path separator to properly work on Windows.
# Default: []
skip-files:
- ".*\\.my\\.go$"
- lib/bad.go
# If set, we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
# to go.mod are needed. This setting is most useful to check that go.mod does
# not need updates, such as in a continuous integration and testing system.
# If invoked with -mod=vendor, the go command assumes that the vendor
# directory holds the correct copies of dependencies and ignores
# the dependency descriptions in go.mod.
#
# Allowed values: readonly|vendor|mod
# Default: ""
# modules-download-mode: readonly
# Allow multiple parallel golangci-lint instances running.
# If false, golangci-lint acquires file lock on start.
# Default: false
allow-parallel-runners: false
# Define the Go version limit.
# Mainly related to generics support since go1.18.
# Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.17
# output configuration options
output:
# Format: colored-line-number|line-number|json|colored-tab|tab|checkstyle|code-climate|junit-xml|github-actions|teamcity
#
# Multiple can be specified by separating them by comma, output can be provided
# for each of them by separating format name and path by colon symbol.
# Output path can be either `stdout`, `stderr` or path to the file to write to.
# Example: "checkstyle:report.xml,json:stdout,colored-line-number"
#
# Default: colored-line-number
format: json
# Print lines of code with issue.
# Default: true
print-issued-lines: false
# Print linter name in the end of issue text.
# Default: true
print-linter-name: false
# Make issues output unique by line.
# Default: true
uniq-by-line: false
# Add a prefix to the output file references.
# Default: ""
path-prefix: ""
# Sort results by: filepath, line and column.
# Default: false
sort-results: true
# This file contains only configs which differ from defaults.
# All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
linters-settings:
cyclop:
# The maximal code complexity to report.
# Default: 10
max-complexity: 30
# The maximal average package complexity.
# If it's higher than 0.0 (float) the check is enabled
# Default: 0.0
package-average: 10.0

errcheck:
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
# Such cases aren't reported by default.
# Default: false
check-type-assertions: true

exhaustive:
# Program elements to check for exhaustiveness.
# Default: [ switch ]
check:
- switch
- map

exhaustruct:
# List of regular expressions to exclude struct packages and names from check.
# Default: []
exclude:
# std libs
- "^net/http.Client$"
- "^net/http.Cookie$"
- "^net/http.Request$"
- "^net/http.Response$"
- "^net/http.Server$"
- "^net/http.Transport$"
- "^net/url.URL$"
- "^os/exec.Cmd$"
- "^reflect.StructField$"
# public libs
- "^github.com/Shopify/sarama.Config$"
- "^github.com/Shopify/sarama.ProducerMessage$"
- "^github.com/mitchellh/mapstructure.DecoderConfig$"
- "^github.com/prometheus/client_golang/.+Opts$"
- "^github.com/spf13/cobra.Command$"
- "^github.com/spf13/cobra.CompletionOptions$"
- "^github.com/stretchr/testify/mock.Mock$"
- "^github.com/testcontainers/testcontainers-go.+Request$"
- "^github.com/testcontainers/testcontainers-go.FromDockerfile$"
- "^golang.org/x/tools/go/analysis.Analyzer$"
- "^google.golang.org/protobuf/.+Options$"
- "^gopkg.in/yaml.v3.Node$"

gomnd:
# List of function patterns to exclude from analysis.
# Values always ignored: `time.Date`,
# `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`,
# `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`.
# Default: []
ignored-functions:
- flag.Arg
- flag.Duration.*
- flag.Float.*
- flag.Int.*
- flag.Uint.*
- os.Chmod
- os.Mkdir.*
- os.OpenFile
- os.WriteFile
- prometheus.ExponentialBuckets.*
- prometheus.LinearBuckets

govet:
# Enable all analyzers.
# Default: false
enable-all: true
# Disable analyzers by name.
# Run `go tool vet help` to see all analyzers.
# Default: []
disable:
- fieldalignment # too strict
# Settings per analyzer.
settings:
shadow:
# Whether to be strict about shadowing; can be noisy.
# Default: false
strict: true

nakedret:
# Make an issue if func has more lines of code than this setting, and it has naked returns.
# Default: 30
max-func-lines: 0

linters:
enable:
# Visit https://golangci-lint.run/usage/linters/
# for the full, current list of available linters.

# Default linters
- deadcode # Finds unused code
- errcheck # Detect unchecked errors
- gosimple # Suggest code simplifications
- govet # Reports suspicious constructs
- ineffassign # Detects unused variable assignments
- staticcheck # go vet on steroids
- structcheck # Find unused struct fields
- typecheck # Standard Go type checks
- unused # Detect unused constants, variables, functions and types
- varcheck # Find unused global variables and constants

# Suggested additional linters
- gocyclo # or "cyclop", # Detect cyclomatic complexity
- goconst # Detect repeated values that can be made constants
- gofumpt # Or "gofmt", # Enforce standard formatting
- goimports # Ensure standard import formatting/ordering
- misspell # Fix spelling errors
- revive # General purpose linter
- unconvert # Detect unnecessary type conversions
- unparam # Detect unused function parameters

# Optional
- bodyclose # Check whether HTTP response bodies are closed
# "goerr113", # Enforce standard error handling practices
# "depguard", # Forbid certain package imports
# "dupl", # Detect duplicate code
# "errchkjson", # some JSON-specific checks
- gomnd # Magic number detection
- nakedret # Detect naked returns
# "rowserrcheck", # Check whether Err of rows is checked
# "sqlclosecheck", # Ensure sql.Rows and sql.Stmt are closed
- tparallel # Detects inappropriate use of t.Parallel()
- exhaustruct # [highly recommend to enable] checks if all structure fields are initialized
- exhaustive # checks exhaustiveness of enum switch statements
issues:
exclude-use-default: false
max-same-issues: 50
Loading

0 comments on commit ebfb40c

Please sign in to comment.