Skip to content

Conversation

@nitishfy
Copy link
Member

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

Signed-off-by: nitishfy <justnitish06@gmail.com>
@nitishfy nitishfy requested a review from a team as a code owner October 23, 2025 11:21
@bunnyshell
Copy link

bunnyshell bot commented Oct 23, 2025

❗ Preview Environment deployment failed on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

Copy link
Member

@blakepettersson blakepettersson left a comment

Choose a reason for hiding this comment

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

I don't understand why we can't just use the existing make lint[-local] target?

@nitishfy
Copy link
Member Author

@blakepettersson The main difference is that format-go is designed to handle multi-module repositories, while lint-local only runs golangci-lint once from the root. format-go iterates over every go.mod (excluding tools) and runs golangci-lint --fix inside each module directory (eg. inside gitops-engine/). This ensures all modules get formatted and linted individually, something lint-local won’t cover.

@blakepettersson
Copy link
Member

I see. Could we not amend the lint-local task to instead be this?

go list -f '{{.Dir}}/...' -m | GOGC=$(ARGOCD_LINT_GOGC) GOMAXPROCS=2 xargs golangci-lint run --fix --verbose

Signed-off-by: nitishfy <justnitish06@gmail.com>
@nitishfy
Copy link
Member Author

I'd not personally because of the way format-go target has been written so far. Lint is required every tim,e but not the format. I also noticed that the format target sometimes points out to functions being unus,ed which is not correct every time. If we put it in lint, our lint checks will fail most of the times. You'd use make format-go to fix lint issues in for projects that have multiple go.mod file.

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.84%. Comparing base (05ccc01) to head (6efcd81).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #25047      +/-   ##
==========================================
- Coverage   60.89%   60.84%   -0.05%     
==========================================
  Files         351      351              
  Lines       60489    60489              
==========================================
- Hits        36832    36804      -28     
- Misses      20736    20762      +26     
- Partials     2921     2923       +2     

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

Copy link
Contributor

@ppapapetrou76 ppapapetrou76 left a comment

Choose a reason for hiding this comment

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

I agree that it's better not to introduce yet another make target.
On the other hand, it is required to run the same linter across all folders and subfolders so we can find a solution to improve the existing linter target and enhance it to include all folders with a .mod file.

@blakepettersson
Copy link
Member

I agree that it's better not to introduce yet another make target.
On the other hand, it is required to run the same linter across all folders and subfolders so we can find a solution to improve the existing linter target and enhance it to include all folders with a .mod file.

Yup, my suggested amendment to lint-local would do just that 😄

Copy link
Collaborator

@alexmt alexmt left a comment

Choose a reason for hiding this comment

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

Can you clarify what value does it bring or what problem is it solving?

I'm not agains introducing formatting in general but mass changes makes it difficult to cherry-pick fixes and create unnecessary work for maintainers.

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.

4 participants