Linters for Envbuilder aren't catching some common concerns that we have
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia esaminando la configurazione del linting e confrontandola con la configurazione di coder/coder, quindi esegui il linter attuale su envbuilder.go, devcontainer/devcontainer.go e devcontainer/script.go. Aggiungi le regole concordate per la documentazione degli elementi esportati e per i test parallelizzabili, risolvi le violazioni risultanti e verifica che i comandi di lint e test del progetto vadano a buon fine.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Suggestion: It's best practice for exported functions to have documentation (`// EnvWithBuildSecretPrefix ...`). It's part of the original Go linter (https://pkg.go.dev/github.com/golang/lint) and [CodeReviewComments](https://go.dev/wiki/CodeReviewComments#doc-comments)/[Effective Go](https://go.dev/doc/effective_go#commentary), so a bit surprising that it's not caught.
❯ golint ./...
envbuilder.go:43:2: a blank import should be only in a main or test package, or have a comment justifying it
devcontainer/devcontainer.go:34:6: exported type Spec should have comment or be unexported
devcontainer/devcontainer.go:50:6: exported type LifecycleScripts should have comment or be unexported
devcontainer/devcontainer.go:57:6: exported type BuildSpec should have comment or be unexported
devcontainer/devcontainer.go:78:1: exported function SubstituteVars should have comment or be unexported
devcontainer/script.go:16:6: exported type LifecycleScript should have comment or be unexported
devcontainer/script.go:21:1: exported method LifecycleScript.IsEmpty should have comment or be unexported
It seems golint is marked deprecated in golangci-lint though, so I guess the alternative linters aren't enforcing this rule. 😔 I always found it slightly annoying but ultimately worth the annoyance 😄.
Originally posted by @mafredri in https://github.com/coder/envbuilder/pull/391#discussion_r1818991909
There seem to be some linting rules that we'd value here. Two of them are:
- Tests should run in parallel when they can
- Exported functions should be documented
There may be others. It would be worth checking coder/coder's linting config to see what else we're missing. We should add the linters we deem important and ensure the project conforms to them.
- Lingua principale
- Go
- Stelle
- 300
- Fork
- 64
- Merge medio
- 20m
- PR unite (30g)
- 1
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di coder/envbuilder
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
coder/envbuilder#506 ·
-
bug envbuilder needs-investigation
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
coder/envbuilder#495 ·
-
envbuilder Feature
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
coder/envbuilder#492 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
coder/envbuilder#484 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
coder/envbuilder#483 ·
Tutte le issue di coder/envbuilder
Issue simili
-
bug github_actions
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
registrystack/registry-stack#1393 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
JakeChampion/lang#10213 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
oasisprotocol/oasis-sdk#2523 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100