diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..6584adb --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,101 @@ +run: + timeout: 5m +linters: + enable: + # region General + + # Add depguard to prevent adding additional dependencies. This is a client library, we really don't want + # additional dependencies. + - depguard + # Prevent improper directives in go.mod. + - gomoddirectives + # Prevent improper nolint directives. + - nolintlint + + # endregion + + + # region Code Quality and Comments + + # Inspect source code for potential security problems. This check has a fairly high false positive rate, + # comment with // nolint:gosec where not relevant. + - gosec + # Replace golint. + # - revive + # Complain about deeply nested if cases. + - nestif + # Prevent naked returns in long functions. + - nakedret + # Make Go code more readable. + - gocritic + # We don't want hidden global scope, so disallow global variables. You can disable this with + # Check if comments end in a period. This helps prevent incomplete comment lines, such as half-written sentences. + # - godot + # Complain about comments as these indicate incomplete code. + - godox + # Keep the cyclomatic complexity of functions to a reasonable level. + - gocyclo + # Complain about cognitive complexity of functions. + - gocognit + # Find repeated strings that could be converted into constants. + - goconst + # Complain about unnecessary type conversions. + - unconvert + # Complain about unused parameters. These should be replaced with underscores. + - unparam + # Check for non-ASCII identifiers. + - asciicheck + # Check for HTTP response body being closed. Sometimes, you may need to disable this using // nolint:bodyclose. + - bodyclose + # Check for duplicate code. You may want to disable this with // nolint:dupl if the source code is the same, but + # legitimately exists for different reasons. + - dupl + # Check for pointers in loops. This is a typical bug source. + - exportloopref + # Enforce a reasonable function length of 60 lines or 40 instructions. In very rare cases you may want to disable + # this with // nolint:funlen if there is absolutely no way to split the function in question. + - funlen + # Prevent dogsledding (mass-ignoring return values). This typically indicates missing error handling. + - dogsled + # Enforce consistent import aliases across all files. + - importas + # Make code properly formatted. + - gofmt + # Prevent faulty error checks. + - nilerr + # Prevent direct error checks that won't work with wrapped errors. + - errorlint + # Find slice usage that could potentially be preallocated. + - prealloc + # Check for improper duration handling. + - durationcheck + # Enforce tests being in the _test package. + # - testpackage + + # endregion +linters-settings: + depguard: + rules: + main: + list-mode: strict + allow: + - $gostd + - go.flow.arcalot.io/ + - go.arcalot.io/ + - github.com/docker/ + - github.com/opencontainers/ + - gopkg.in/yaml.v3 + - github.com/fxamacker/cbor + - golang.org/ + govet: + enable-all: true + check-shadowing: false + disable: + # We don't care about variable shadowing. + - shadow + - fieldalignment + stylecheck: + checks: + - all +issues: + exclude-use-default: false diff --git a/go.mod b/go.mod index c60d97c..2ff455b 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ module go.flow.arcalot.io/pythondeployer -go 1.18 +go 1.21 require ( - go.arcalot.io/assert v1.6.1 - go.arcalot.io/lang v1.0.0 + go.arcalot.io/assert v1.7.0 + go.arcalot.io/lang v1.1.0 ) require ( @@ -14,7 +14,7 @@ require ( require ( go.arcalot.io/exex v0.1.0 - go.arcalot.io/log/v2 v2.0.0 - go.flow.arcalot.io/deployer v0.4.0 - go.flow.arcalot.io/pluginsdk v0.5.1 + go.arcalot.io/log/v2 v2.1.0 + go.flow.arcalot.io/deployer v0.5.0 + go.flow.arcalot.io/pluginsdk v0.8.0 ) diff --git a/go.sum b/go.sum index fc969ee..ea93786 100644 --- a/go.sum +++ b/go.sum @@ -2,16 +2,17 @@ github.com/fxamacker/cbor/v2 v2.5.0 h1:oHsG0V/Q6E/wqTS2O1Cozzsy69nqCiguo5Q1a1ADi github.com/fxamacker/cbor/v2 v2.5.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= -go.arcalot.io/assert v1.6.1 h1:pr7wvTE/vZJ4pY0f88R8tXicTOGogkGS1mtY0Qb7GRE= -go.arcalot.io/assert v1.6.1/go.mod h1:Xy3ScX0p9IMY89gdsgexOKxnmDr0nGHG9dV7p8Uxg7w= +go.arcalot.io/assert v1.7.0 h1:PTLyeisNMUKpM9wXRDxResanBhuGOYO1xFK3v5b3FSw= +go.arcalot.io/assert v1.7.0/go.mod h1:nNmWPoNUHFyrPkNrD2aASm5yPuAfiWdB/4X7Lw3ykHk= go.arcalot.io/exex v0.1.0 h1:0SSaU7NO73Tdx6N1G4cPzbJvE+e+XpkH5G4DOJYBiyo= go.arcalot.io/exex v0.1.0/go.mod h1:ohSmm9Y/648LeThX2tY8Lg0YMYYQrlmqzIC3C4lxPxA= -go.arcalot.io/lang v1.0.0 h1:mgDaieT4wWdZTnR4V7+/pgYRmzfU7VZZgIzHccuxAbY= -go.arcalot.io/lang v1.0.0/go.mod h1:ALqfYEhAzC2WoGLaycmJoNJd5NmkR7V1PSKp/c5D278= -go.arcalot.io/log/v2 v2.0.0 h1:mbmsWDVBXZNWrDzUh5JLzeGCQ59kTuMFs+pyfJGc1hk= -go.arcalot.io/log/v2 v2.0.0/go.mod h1:1V8jnFIIGwh2CtcGkHNOmy1nCo7LbazQNkUcnKYNMn4= -go.flow.arcalot.io/deployer v0.4.0 h1:5YveLCX+zc8Ra/aukHOwD5OrJD2W8WRzoruf3bpJfqY= -go.flow.arcalot.io/deployer v0.4.0/go.mod h1:x6gsz/hANR8qN1nerpyY3vXpdaqofDH5Wlg+Nsqg/x0= -go.flow.arcalot.io/pluginsdk v0.5.1 h1:ebb2ThAqmjmwGpDyKpd1wEDUisPqPabgARjFohy47Io= -go.flow.arcalot.io/pluginsdk v0.5.1/go.mod h1:2s2f//7uOkBjr1QaiWJD/bqDIeLlINJtD1BhiY4aGPM= +go.arcalot.io/lang v1.1.0 h1:ugglRKpd3qIMkdghAjKJxsziIgHm8QpxrzZPSXoa08I= +go.arcalot.io/lang v1.1.0/go.mod h1:2BZJO4csY7NnN/Nf1+eTdIQH4A2vxtOMneaO+PJl+Co= +go.arcalot.io/log/v2 v2.1.0 h1:lNO931hJ82LgS6WcCFCxpLWXQXPFhOkz6PyAJ/augq4= +go.arcalot.io/log/v2 v2.1.0/go.mod h1:PNWOSkkPmgS2OMlWTIlB/WqOw0yaBvDYd8ENAP80H4k= +go.flow.arcalot.io/deployer v0.5.0 h1:yXYogvL3shNBEEoTx9U9CNbfxuf8777uAH5Vn3hv1Yo= +go.flow.arcalot.io/deployer v0.5.0/go.mod h1:whj8wOUursCnfZCt1a7eY5hU3EyOcUG48vM4NeAe5N8= +go.flow.arcalot.io/pluginsdk v0.8.0 h1:cShsshrR17ZFLcbgi3aZvqexLttcp3JISFNqPUPuDvA= +go.flow.arcalot.io/pluginsdk v0.8.0/go.mod h1:sk7ssInR/T+Gy+RSRr+QhKqZcECFFxMyn1hPQCTZSyU= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=