Skip to content

ci: run lint on all platforms - #498

Closed
nightcityblade wants to merge 1 commit into
RamenDR:mainfrom
nightcityblade:fix/issue-191
Closed

ci: run lint on all platforms#498
nightcityblade wants to merge 1 commit into
RamenDR:mainfrom
nightcityblade:fix/issue-191

Conversation

@nightcityblade

@nightcityblade nightcityblade commented Aug 10, 2026

Copy link
Copy Markdown

Fixes #191

Supersedes #497, which GitHub auto-closed while its head history was being repaired after the Windows lint failure.

Summary

  • run the Go lint job on Ubuntu, Windows, and macOS
  • use the -latest runner aliases on every platform

Testing

  • go run github.com/rhysd/actionlint/cmd/actionlint@latest -shellcheck= .github/workflows/test.yaml
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2 run ./... — 0 issues
  • go test ./...
  • git diff --check

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Tests

    • Expanded lint validation to run on Ubuntu, Windows, and macOS.
    • Enabled all platform checks to complete even if one fails.
  • Chores

    • Standardized Go files to use LF line endings.

Walkthrough

The pull request enforces LF line endings for Go files and expands the lint workflow from Ubuntu to Ubuntu, Windows, and macOS with fail-fast disabled.

Changes

Cross-platform lint configuration

Layer / File(s) Summary
Lint platform matrix and Go line endings
.gitattributes, .github/workflows/test.yaml
Go files use LF line endings. The lint job runs on Ubuntu, Windows, and macOS without stopping the matrix when one job fails.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: raaizik

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR runs lint on Ubuntu, Windows, and macOS, which satisfies the objective in issue #191.
Out of Scope Changes check ✅ Passed The changes support the stated objectives by adding cross-platform runners and consistent Go line endings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly identifies the main change: running lint on all supported platforms.
Description check ✅ Passed The description directly explains the cross-platform lint changes, line-ending normalization, related issues, and validation steps.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nirs

nirs commented Aug 10, 2026

Copy link
Copy Markdown
Member

@nightcityblade Please stop closing the PR - you seems to something wrong on your side.

When fixing an issue you should amend the relevant commit and force push. There no need to delete the branch on your side (which will close the PR).

@nightcityblade

Copy link
Copy Markdown
Author

You're right—sorry for the churn. I amended from a depth-1 clone without first restoring the parent history, which temporarily produced an unrelated root commit and caused GitHub to auto-close #497. I repaired the branch to a single commit directly on main, verified #498 now contains only the two intended files, and I will not rewrite or delete it again. Thanks for calling this out.

@nirs

nirs commented Aug 10, 2026

Copy link
Copy Markdown
Member

You're right—sorry for the churn. I amended from a depth-1 clone without first restoring the parent history, which temporarily produced an unrelated root commit and caused GitHub to auto-close #497.

Cloning with depth=1 is good for quick clone in CI when you don't need history. For development you always want a full clone.

You can probably find a tutorial on how to work with github projects or ask AI for help.

Comment thread .gitattributes Outdated
@nightcityblade
nightcityblade force-pushed the fix/issue-191 branch 2 times, most recently from 6faeac3 to 8b80eab Compare August 11, 2026 03:11
@nirs

nirs commented Aug 11, 2026

Copy link
Copy Markdown
Member

@nightcityblade The windows lint fails with 3 files:

Error: pkg\build\build.go:1:1: File is not properly formatted (gci)
  // SPDX-FileCopyrightText: The RamenDR authors
  ^
  Error: pkg\config\config.go:1:1: File is not properly formatted (gci)
  // SPDX-FileCopyrightText: The RamenDR authors
  ^
  Error: pkg\console\console.go:1:1: File is not properly formatted (gci)
  // SPDX-FileCopyrightText: The RamenDR authors

Converting newlines in go files in .gitattributes may solve this, but I think this will hide the real issue. Try to compare these files to other files and find why we have an issue in these files. It is also possible that golangci-lint does not show all errors, but more likely these files are different from other files in some way.

@nirs

nirs commented Aug 11, 2026

Copy link
Copy Markdown
Member

@nightcityblade you closed this PR again - we already discuss this. Please do not open a new PR. Find how to reopen this PR if you want to continue working on this.

@nightcityblade

Copy link
Copy Markdown
Author

I’m sorry—I repeated the shallow-history mistake while amending the Windows follow-up, which auto-closed this PR. I immediately restored the branch to the correct single commit and two-file diff, but GitHub would not reopen this PR after pinning the unrelated root SHA. The recovered replacement is #501.

The Windows failure is caused by CRLF conversion across all Go files; only three appeared because golangci-lint defaults max-same-issues to 3. The recovered commit adds *.go text eol=lf, and the CRLF checkout simulation plus golangci-lint fmt --diff, golangci-lint run, and go test ./... are clean.

@nirs

nirs commented Aug 11, 2026

Copy link
Copy Markdown
Member

I’m sorry—I repeated the shallow-history mistake while amending the Windows follow-up, which auto-closed this PR. I immediately restored the branch to the correct single commit and two-file diff, but GitHub would not reopen this PR after pinning the unrelated root SHA. The recovered replacement is #501.

The Windows failure is caused by CRLF conversion across all Go files; only three appeared because golangci-lint defaults max-same-issues to 3. The recovered commit adds *.go text eol=lf, and the CRLF checkout simulation plus golangci-lint fmt --diff, golangci-lint run, and go test ./... are clean.

Do a proper checkout, rebase you changes on the new checkout and force push to the same branch. You should be able to reopen the PR after that.

@nightcityblade

Copy link
Copy Markdown
Author

I restored nightcityblade:fix/issue-191 on the correct history. GitHub's compare API now shows it exactly one commit ahead of current main (ec1fa6c), with only .gitattributes and .github/workflows/test.yaml changed (6 additions, 1 deletion).

I also retried reopening #498, but GitHub still returns Could not open the pull request and leaves this closed PR pinned to the deleted root commit instead of the restored branch ref. Could you please reopen #498 from the maintainer side if that control is available? I will not open another replacement or rewrite the branch further.

@nirs

nirs commented Aug 11, 2026

Copy link
Copy Markdown
Member

@nightcityblade no way to reopen this pull request. I created a new one from your fork.

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.

Run lint on all platforms?

2 participants