Skip to content

docs: add STYLE.md with Go style guide#2186

Open
EItanya wants to merge 3 commits into
mainfrom
eitanya/style-guide
Open

docs: add STYLE.md with Go style guide#2186
EItanya wants to merge 3 commits into
mainfrom
eitanya/style-guide

Conversation

@EItanya

@EItanya EItanya commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Adds a style guide covering general cross-language principles and Go conventions, derived from existing code patterns and recurring PR review feedback. Python/TypeScript/Helm sections are stubbed for follow-up.

The goal is to reduce repeated style feedback in reviews by documenting the conventions in one place.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Copilot AI review requested due to automatic review settings July 9, 2026 12:22
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 9, 2026
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a repository-level style guide (STYLE.md) intended to centralize recurring review feedback and document established coding conventions, with detailed coverage for Go and stub sections for Python/TypeScript/Helm to be completed later.

Changes:

  • Adds a new top-level STYLE.md covering cross-language principles and Go-specific conventions (errors, interfaces, CRD design, controller patterns, testing).
  • Establishes RFC2119-style normative language (MUST/SHOULD/MAY) for review-enforced rules.
  • Adds TODO stub sections for Python, TypeScript, and Helm/YAML for follow-up expansion.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread STYLE.md
Comment on lines +116 to +118
- When the shape of data is known at compile time, define a named struct.
`map[string]interface{}` **MUST NOT** be used for data whose schema you
control; it is reserved for genuinely schema-less JSON.
Comment thread STYLE.md Outdated
Comment thread STYLE.md
Comment on lines +194 to +195
- Keep exactly **one** constructor per type with all parameters; don't
accumulate `NewXxxWithYyy` convenience shims.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should fix the existing deviations not add more

Comment thread STYLE.md
garbage-collected with the parent. Use finalizers when cleanup involves
anything beyond owned K8s objects; adding a finalizer returns
`ctrl.Result{Requeue: true}`.
- All controllers set `NeedLeaderElection: new(true)`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code works in the latest golang

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants