Linters for Envbuilder aren't catching some common concerns that we have
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Comienza revisando la configuración de linting y comparándola con la configuración de coder/coder; después, ejecuta el linter actual contra envbuilder.go, devcontainer/devcontainer.go y devcontainer/script.go. Añade las reglas acordadas para la documentación de elementos exportados y las pruebas paralelizables, corrige las infracciones resultantes y verifica que los comandos de lint y test del proyecto se completen correctamente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Go
- Estrellas
- 300
- Forks
- 64
- Merge medio
- 20 min
- PR fusionados (30 d)
- 1
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de coder/envbuilder
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
coder/envbuilder#506 ·
-
bug envbuilder needs-investigation
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
coder/envbuilder#495 ·
-
envbuilder Feature
Dificultad 3/5 1-2 días Aptitud para principiantes 56/100
coder/envbuilder#492 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
coder/envbuilder#484 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
coder/envbuilder#483 ·
Todos los issues de coder/envbuilder
Issues similares
-
bug github_actions
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
registrystack/registry-stack#1393 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
JakeChampion/lang#10213 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
oasisprotocol/oasis-sdk#2523 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100