Linters for Envbuilder aren't catching some common concerns that we have
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
調査の方向性
まず linting の設定を確認し、coder/coder の設定と比較してから、現在の linter を envbuilder.go、devcontainer/devcontainer.go、devcontainer/script.go に対して実行します。エクスポートされた要素のドキュメントと並列化可能なテストについて合意されたルールを追加し、その結果生じた違反を修正して、プロジェクトの lint コマンドと test コマンドが正常に通ることを確認します。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Go
- スター
- 300
- フォーク
- 64
- 平均マージ
- 20分
- マージ済み PR(30日)
- 1
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/envbuilder のほかの issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
coder/envbuilder#506 ·
-
bug envbuilder needs-investigation
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
coder/envbuilder#495 ·
-
envbuilder Feature
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
coder/envbuilder#492 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
coder/envbuilder#484 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
coder/envbuilder#483 ·
coder/envbuilder の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
bazel-contrib/rules_go#4726 · コメント 1 件 ·
-
area/auto-scaling area/monitoring area/ops-productivity kind/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Type/Improvement
難易度 1/5 1〜3時間 初心者へのやさしさ 90/100
OpenNSW/nsw-srilanka#522 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100