Skip to content

chore: add linters configuration#2233

Open
kristina-solovyova wants to merge 1 commit intomainfrom
02-15-chore_add_linters_configuration
Open

chore: add linters configuration#2233
kristina-solovyova wants to merge 1 commit intomainfrom
02-15-chore_add_linters_configuration

Conversation

@kristina-solovyova
Copy link
Collaborator

No description provided.

Copy link
Collaborator Author

kristina-solovyova commented Feb 16, 2026


How to use the Graphite Merge Queue

Add the label main-merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kristina-solovyova kristina-solovyova changed the base branch from 02-12-fix_extract_hugepage_calculations_and_simplify_cluster_template_structure to graphite-base/2233 February 16, 2026 16:11
@kristina-solovyova kristina-solovyova force-pushed the 02-15-chore_add_linters_configuration branch from 1bceebb to 63a88ca Compare February 16, 2026 16:11
@kristina-solovyova kristina-solovyova changed the base branch from graphite-base/2233 to main February 16, 2026 16:11
@kristina-solovyova kristina-solovyova force-pushed the 02-15-chore_add_linters_configuration branch 2 times, most recently from 07b502a to 1441c11 Compare March 2, 2026 12:12
@kristina-solovyova kristina-solovyova force-pushed the 02-15-chore_add_linters_configuration branch from 1441c11 to bcc56f4 Compare March 2, 2026 12:35
@kristina-solovyova kristina-solovyova marked this pull request as ready for review March 5, 2026 08:50
@kristina-solovyova kristina-solovyova requested a review from a team as a code owner March 5, 2026 08:50
Copilot AI review requested due to automatic review settings March 5, 2026 08:50
@graphite-app graphite-app bot requested review from assafgi and tigrawap March 5, 2026 08:50
@graphite-app
Copy link

graphite-app bot commented Mar 5, 2026

Graphite Automations

"Add anton/matt/sergey/kristina as reviwers on operator PRs" took an action on this PR • (03/05/26)

2 reviewers were added to this PR based on Anton Bykov's automation.

Copy link

Copilot AI left a comment

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 adds comprehensive linting and static analysis configuration to the repository. It introduces a .golangci.yaml configuration file for golangci-lint v2, updates the pre-commit hook to use golangci-lint instead of make fmt vet, adds linting Make targets, and restructures the build.yaml CI workflow (renamed to "CI") to run lint, deadcode analysis, govulncheck, and tests as separate parallel jobs. Additionally, all GitHub Actions workflows are updated to use actions/checkout@v6 and actions/setup-go@v6.

Changes:

  • Added .golangci.yaml with golangci-lint v2 configuration including linters (errcheck, govet, staticcheck, unused, misspell, gocritic) and exclusions for Kubernetes controller complexity
  • Restructured .github/workflows/build.yaml from a single build job into four parallel jobs (lint, static-checks, security, test) and bumped all action versions (actions/checkout@v6, actions/setup-go@v6) across all workflows
  • Added Makefile lint targets (lint, lint-go, lint-deadcode, lint-govulncheck, lint-fix) and updated .pre-commit-config.yaml to use golangci-lint

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.golangci.yaml New golangci-lint v2 configuration file with linter settings and exclusions
.pre-commit-config.yaml Replaced make fmt vet hook with golangci-lint pre-commit hook
Makefile Added lint-related Make targets for golangci-lint, deadcode, govulncheck, and auto-fix
.github/workflows/build.yaml Renamed to "CI", split single build job into lint/static-checks/security/test parallel jobs
.github/workflows/conventional-commits.yaml Bumped actions/checkout from v4 to v6
.github/workflows/dagger_ci_on_merge_queue_plan.yaml Bumped actions/checkout from v4 to v6 in all checkout steps
.github/workflows/helm_lint.yaml Bumped actions/checkout from v4 to v6
.github/workflows/package.yaml Bumped actions/checkout from v4 to v6 and actions/setup-go from v5 to v6
.github/workflows/run_upgrade_test.yaml Bumped actions/checkout from v4 to v6 and actions/setup-go from v5 to v6

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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +30 to +39
# Kubernetes controllers often have long functions due to reconciliation logic
rules:
- path: internal/controllers/
text: "cognitive complexity|cyclomatic complexity"
linters:
- gocritic

issues:
max-issues-per-linter: 0
max-same-issues: 0
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

In golangci-lint v2 configuration format (as indicated by version: "2" on line 1), issues is no longer a valid top-level section. The max-issues-per-linter and max-same-issues settings should be placed under linters.exclusions instead. This will likely produce a configuration error or be silently ignored.

The correct location would be:

linters:
  exclusions:
    max-issues-per-linter: 0
    max-same-issues: 0
Suggested change
# Kubernetes controllers often have long functions due to reconciliation logic
rules:
- path: internal/controllers/
text: "cognitive complexity|cyclomatic complexity"
linters:
- gocritic
issues:
max-issues-per-linter: 0
max-same-issues: 0
max-issues-per-linter: 0
max-same-issues: 0
# Kubernetes controllers often have long functions due to reconciliation logic
rules:
- path: internal/controllers/
text: "cognitive complexity|cyclomatic complexity"
linters:
- gocritic

Copilot uses AI. Check for mistakes.
go vet ./...

.PHONY: lint
lint: lint-go lint-deadcode ## Run all linters (golangci-lint and deadcode).
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

The help text says "Run all linters (golangci-lint and deadcode)" but lint-govulncheck is also defined below and not included. The comment is misleading — it should either include lint-govulncheck as a dependency or clarify the comment to say the lint target doesn't include govulncheck (e.g., "Run fast linters" or just "Run golangci-lint and deadcode").

Suggested change
lint: lint-go lint-deadcode ## Run all linters (golangci-lint and deadcode).
lint: lint-go lint-deadcode ## Run golangci-lint and deadcode linters.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants