Skip to content

Conversation

@julio-lopez
Copy link
Collaborator

@julio-lopez julio-lopez commented Nov 13, 2025

The //nolint:modernize annotations are needed to maintain equivalence between the policy "value" and policy "definition" structs.

@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.04%. Comparing base (cb455c6) to head (5af1a9e).
⚠️ Report is 750 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4981      +/-   ##
==========================================
+ Coverage   75.86%   78.04%   +2.18%     
==========================================
  Files         470      548      +78     
  Lines       37301    31412    -5889     
==========================================
- Hits        28299    24516    -3783     
+ Misses       7071     4849    -2222     
- Partials     1931     2047     +116     

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@julio-lopez julio-lopez marked this pull request as ready for review November 13, 2025 04:53
Copilot AI review requested due to automatic review settings November 13, 2025 04:53
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 enables the modernize:omitzero linter setting in golangci-lint, which enforces the use of omitzero instead of omitempty for zero-value struct fields in JSON tags. The changes add //nolint:modernize annotations to policy definition structs where omitempty must be retained to maintain equivalence with their corresponding policy value structs.

Key Changes:

  • Removes the modernize:omitzero linter disable rule from .golangci.yml
  • Adds //nolint:modernize annotations to 6 fields across 3 policy definition files where omitempty is intentionally used

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
.golangci.yml Removes the exception that disabled the modernize:omitzero linter check
snapshot/policy/scheduling_policy.go Adds nolint annotations to TimesOfDay and Cron fields to preserve omitempty tags
snapshot/policy/files_policy.go Adds nolint annotations to IgnoreRules and DotIgnoreFiles fields to preserve omitempty tags
snapshot/policy/compression_policy.go Adds nolint annotations to OnlyCompress and NeverCompress fields to preserve omitempty tags

@julio-lopez julio-lopez merged commit 06845c7 into kopia:master Nov 13, 2025
32 of 33 checks passed
@julio-lopez julio-lopez deleted the chore/linter-modernize branch November 13, 2025 04:54
julio-lopez added a commit to julio-lopez/kopia that referenced this pull request Nov 25, 2025
julio-lopez added a commit that referenced this pull request Nov 25, 2025
- Revert "chore(ci): enable modernize:omitzero linter setting (#4981)"
   reverts 06845c7
- Revert "refactor(general): omitzero JSON tag in policy structs (#4910)"
  reverts 033b4b1
- Revert "refactor(general): `omitzero` JSON tag (#4907)"
   reverts 5bc467e
- Ref: #5006
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.

1 participant