这是indexloc提供的服务,不要输入任何密码
Skip to content

fix: linter issues #842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025
Merged

fix: linter issues #842

merged 1 commit into from
Jun 18, 2025

Conversation

danielgtaylor
Copy link
Owner

This should fix the broken build.

@Copilot Copilot AI review requested due to automatic review settings June 18, 2025 04:03
Copy link
Contributor

@Copilot 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 fixes linter errors by cleaning up imports and tightening test assertions to prevent the broken build.

  • Swapped assert.NoError for require.NoError in tests for early test exit on error.
  • Removed unused fmt import and replaced fmt.Errorf with errors.New in core code.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
autopatch/autopatch_test.go Replaced assert.NoError with require.NoError and added import
autopatch/autopatch.go Changed error creation to errors.New and removed fmt import

@@ -520,7 +521,7 @@ func TestReplaceNulls(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
result, err := replaceNulls([]byte(tc.input), settings)
assert.NoError(t, err)
require.NoError(t, err)
assert.JSONEq(t, tc.expected, string(result))
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

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

[nitpick] Since you're using require.NoError to fail fast, consider switching assert.JSONEq to require.JSONEq for consistency and immediate failure on JSON mismatches.

Suggested change
assert.JSONEq(t, tc.expected, string(result))
require.JSONEq(t, tc.expected, string(result))

Copilot uses AI. Check for mistakes.

Copy link

codecov bot commented Jun 18, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.04%. Comparing base (21709a0) to head (d2c6e8c).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
autopatch/autopatch.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #842      +/-   ##
==========================================
- Coverage   93.08%   93.04%   -0.05%     
==========================================
  Files          23       23              
  Lines        5307     5390      +83     
==========================================
+ Hits         4940     5015      +75     
- Misses        314      319       +5     
- Partials       53       56       +3     

☔ 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.

@danielgtaylor danielgtaylor merged commit 2c9df7e into main Jun 18, 2025
5 of 7 checks passed
@danielgtaylor danielgtaylor deleted the fix-lint-issues branch June 18, 2025 04:05
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