Skip to content

ci: add golangci-lint #4

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 2 commits into from
Apr 15, 2025
Merged

ci: add golangci-lint #4

merged 2 commits into from
Apr 15, 2025

Conversation

thaJeztah
Copy link
Member

No description provided.

@thaJeztah thaJeztah force-pushed the add_gha branch 10 times, most recently from 13fd0e3 to 9a7255f Compare April 14, 2025 13:19
@thaJeztah thaJeztah changed the title ci: add github actions ci: add golangci-lint Apr 14, 2025
@thaJeztah thaJeztah force-pushed the add_gha branch 4 times, most recently from 3aa8fc8 to 54ee2d2 Compare April 14, 2025 15:29
@thaJeztah
Copy link
Member Author

Something odd; gofumpt is failing on Windows, but can't spot anything wrong. Maybe some issue with the Windows build of it?

Error: archive.go:1:1: File is not properly formatted (gofumpt)
// Package archive provides helper functions for dealing with archive files.
^
Error: archive_other.go:1:1: File is not properly formatted (gofumpt)
//go:build !linux
^
Error: archive_windows.go:1:1: File is not properly formatted (gofumpt)
package archive
^

@thaJeztah
Copy link
Member Author

Ugh, so gofmt is also complaining? I don't see what's wrong though 🤔

  Error: archive.go:1:1: File is not properly formatted (gofmt)
  // Package archive provides helper functions for dealing with archive files.
  ^
  Error: archive_other.go:1:1: File is not properly formatted (gofmt)
  //go:build !linux
  ^
  Error: archive_windows.go:1:1: File is not properly formatted (gofmt)
  package archive
  ^

@thaJeztah thaJeztah force-pushed the add_gha branch 3 times, most recently from e0fa794 to b9185c9 Compare April 14, 2025 16:06
@thaJeztah
Copy link
Member Author

thaJeztah commented Apr 14, 2025

No idea; it seems to barf on every file it found; could it be a newlines issue?

Running [D:\a\_temp\a6315ed3-9a44-4157-9fee-e2f20c2bf47b\golangci-lint-2.1.1-windows-amd64\golangci-lint config path] in [D:\a\go-archive\go-archive] ...
  Running [D:\a\_temp\a6315ed3-9a44-4157-9fee-e2f20c2bf47b\golangci-lint-2.1.1-windows-amd64\golangci-lint config verify] in [D:\a\go-archive\go-archive] ...
  Running [D:\a\_temp\a6315ed3-9a44-4157-9fee-e2f20c2bf47b\golangci-lint-2.1.1-windows-amd64\golangci-lint run  --print-resources-usage --timeout=10m --verbose] in [D:\a\go-archive\go-archive] ...
  Error: archive.go:1:1: File is not properly formatted (gofumpt)
  // Package archive provides helper functions for dealing with archive files.
  ^
  Error: archive_other.go:1:1: File is not properly formatted (gofumpt)
  //go:build !linux
  ^
  Error: archive_test.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: archive_windows.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: archive_windows_test.go:1:1: File is not properly formatted (gofumpt)
  //go:build windows
  ^
  Error: changes.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: changes_other.go:1:1: File is not properly formatted (gofumpt)
  //go:build !linux
  ^
  Error: changes_posix_test.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: changes_test.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: changes_windows.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: chrootarchive\archive.go:1:1: File is not properly formatted (gofumpt)
  package chrootarchive
  ^
  Error: chrootarchive\archive_test.go:1:1: File is not properly formatted (gofumpt)
  package chrootarchive
  ^
  Error: chrootarchive\archive_windows.go:1:1: File is not properly formatted (gofumpt)
  package chrootarchive
  ^
  Error: chrootarchive\diff.go:1:1: File is not properly formatted (gofumpt)
  package chrootarchive
  ^
  Error: chrootarchive\diff_windows.go:1:1: File is not properly formatted (gofumpt)
  package chrootarchive
  ^
  Error: copy.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: copy_windows.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: diff.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: diff_test.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: diff_windows.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: fuzz_test.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: path.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: path_windows.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: path_windows_test.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: time.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: time_windows.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: utils_test.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: whiteouts.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: wrap.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: wrap_test.go:1:1: File is not properly formatted (gofumpt)
  package archive
  ^
  Error: xattr_unsupported.go:1:1: File is not properly formatted (gofumpt)
  //go:build !linux && !darwin && !freebsd && !netbsd
  ^
  31 issues:
  * gofumpt: 31
  level=info msg="golangci-lint has version 2.1.1 built with go1.24.2 from 93dabf90 on 2025-04-12T18:19:05Z"

@thaJeztah
Copy link
Member Author

could it be a newlines issue?

Narrator: it was! I added a .gitattributes to force lf line-endings, and now it's happy

This prevents gofumpt showing false positives.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah marked this pull request as ready for review April 15, 2025 07:11
@thaJeztah
Copy link
Member Author

@vvoland ptal 🤗

@vvoland vvoland merged commit 78ee240 into moby:main Apr 15, 2025
12 checks passed
@thaJeztah thaJeztah deleted the add_gha branch April 15, 2025 19:58
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