Skip to content

Add golangci-lint static analysis and integrate into CI - #10

Merged
bamnet merged 2 commits into
masterfrom
add-static-analysis-and-linting
Jun 24, 2026
Merged

Add golangci-lint static analysis and integrate into CI#10
bamnet merged 2 commits into
masterfrom
add-static-analysis-and-linting

Conversation

@bamnet-bot

Copy link
Copy Markdown
Collaborator

This Pull Request integrates golangci-lint static analysis into the repository:

  1. Linter Configuration: Added .golangci.yaml to enable static checks, styling conventions (revive), formatting, security audits (gosec), and code optimization warnings (gocritic).
  2. CI Integration: Modified .github/workflows/test.yaml to run golangci-lint automatically via GitHub Actions on every push/PR.
  3. Linter Fix: Rewrote a single-case switch statement in vehicle_data_test.go to satisfy the gocritic readability rule.

All tests and linter checks run and pass cleanly locally.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a .golangci.yaml configuration file to enable several Go linters and simplifies a single-case switch statement to an if statement in vehicle_data_test.go. Feedback on the linter configuration notes that the custom revive rules block overrides the default ruleset entirely, disabling other default checks, and suggests removing the linters-settings block if the default ruleset is desired.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread .golangci.yaml
Comment on lines +19 to +23
linters-settings:
revive:
rules:
- name: exported
severity: warning

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

In revive, providing a custom rules list in the configuration completely overrides the default ruleset rather than extending it. By only listing the exported rule here, all other default stylistic and convention checks of revive (such as var-naming, error-strings, indent-error-flow, etc.) are disabled.

If your intention is to use the default revive ruleset (which already includes the exported rule as a warning), you can safely remove this entire linters-settings block.

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.24%. Comparing base (6abf558) to head (91c8a44).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #10   +/-   ##
=======================================
  Coverage   84.24%   84.24%           
=======================================
  Files           5        5           
  Lines         273      273           
=======================================
  Hits          230      230           
  Misses         26       26           
  Partials       17       17           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bamnet
bamnet merged commit 250c6e8 into master Jun 24, 2026
3 checks passed
@bamnet
bamnet deleted the add-static-analysis-and-linting branch June 29, 2026 04:43
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