-
Notifications
You must be signed in to change notification settings - Fork 135
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
increase lint max line-length #2178
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as abuse.
This comment was marked as abuse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range comments (2)
.golangci.yaml (2)
Line range hint
391-408
: Consider a more moderate increase for max-same-issuesThe increase from 3 to 50 for
max-same-issues
is significant. While this reduces noise, it might mask systematic issues that should be addressed.Consider:
- A more moderate value (e.g., 10-20)
- Adding a comment explaining why 50 was chosen
- Creating separate limits for different linters
# Maximum count of issues with the same text. # Set to 0 to disable. # Default: 3 + # Increased to allow for common patterns across the codebase + # TODO: Consider reducing this value after addressing current issues max-same-issues: 50
Line range hint
1-408
: Consider splitting the configuration fileThe configuration file is becoming quite large and complex. Consider splitting it into multiple files for better maintainability:
golangci.base.yaml
: Base configurationgolangci.linters.yaml
: Linter-specific settingsgolangci.rules.yaml
: Exclusion rules and thresholdsThis would make it easier to manage and review changes to specific aspects of the linting configuration.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
📒 Files selected for processing (1)
.golangci.yaml
(2 hunks)
🔇 Additional comments (2)
.golangci.yaml (2)
Line range hint 44-71
: LGTM on exhaustruct exclusions
The exclusion patterns are well-chosen and documented:
- Standard library exclusions cover common HTTP and OS packages
- Third-party exclusions focus on widely-used testing and infrastructure packages
Line range hint 8-11
: LGTM on timeout increase, but monitor CI pipeline duration
The increase from 1m to 3m is reasonable for thorough analysis, especially with the extensive list of enabled linters.
Let's check the CI logs to ensure this doesn't significantly impact pipeline duration:
✅ Verification successful
Timeout increase to 3m in golangci-lint configuration is reasonable
The timeout increase from 1m to 3m is a sensible configuration change that allows for more thorough analysis, especially with multiple linters enabled. While we couldn't verify the exact impact on CI duration, this is a common and safe timeout value for medium to large codebases.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check recent CI job durations to assess impact
gh run list --limit 10 --workflow lint.yml --json durationMS,conclusion \
| jq -r '.[] | "\(.conclusion): \(.durationMS/1000)s"'
Length of output: 364
Script:
#!/bin/bash
# Let's try a different approach to check CI workflow durations
gh run list --limit 10 --workflow lint.yml --json startedAt,conclusion,updatedAt \
| jq -r '.[] | "\(.conclusion): \(if .startedAt != null and .updatedAt != null then (((sub((.updatedAt | fromdateiso8601), (.startedAt | fromdateiso8601)))/60)) else "N/A" end) minutes"'
Length of output: 699
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2178 +/- ##
===========================================
+ Coverage 26.34% 40.42% +14.07%
===========================================
Files 361 4 -357
Lines 16297 47 -16250
Branches 12 12
===========================================
- Hits 4294 19 -4275
+ Misses 11732 28 -11704
+ Partials 271 0 -271
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -147,7 +147,7 @@ linters-settings:
# Max line length, lines longer will be reported.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option.
# Default: 120.
line-length: 150 # Increased maximum line length.
# Tab width in spaces.
# Default: 1
tab-width: 1
Currently running
make lint
runs linting according to the.golangci.yaml
conf. In that file we set a max line-length of 80 which outputs linting errors for lines longer than that and results in failed CI.I propose we increase that limit to at least 120 as it allows more code to be viewed on screen at once as we usually have more horizontal screen space than vertical. Go is also typically not strict on line length.
I would be fine with having no upper limit and make it up to the developer to make sure their code is readable, but lets start with this to get a discussion going.