Skip to content
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

linter: fix go-header check #319

Merged
merged 1 commit into from Jan 5, 2023
Merged

Conversation

fgiudici
Copy link
Member

@fgiudici fgiudici commented Jan 5, 2023

Starting with 2023 we started having false go-header positives. This was due to two things:

  1. we need to add history during the checkout, as the go-header linter
    checks if the header in the sources should include the current year
    using 'git log' (if it fails, would check the file stats, but that
    has been just checked out, so will match current year for sure).
  2. the current golangci-lint v1.50.1 is more sensible to the yaml
    syntax, in particular to the curly braces: the parser will work
    correctly if the curly braces have a space before (and after) the
    expression to be evaluated.

Signed-off-by: Francesco Giudici francesco.giudici@suse.com

Starting with 2023 we started having false go-header positives.
This was due to two things:
1) we need to add history during the checkout, as the go-header linter
   checks if the header in the sources should include the current year
   using 'git log' (if it fails, would check the file stats, but that
   has been just checked out, so will match current year for sure).
2) the current golangci-lint v1.50.1 is more sensible to the yaml
   syntax, in particular to the curly braces: the parser will work
   correctly if the curly braces have a space before (and after) the
   expression to be evaluated.

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
@github-actions github-actions bot added the area/build build related changes label Jan 5, 2023
Copy link
Contributor

@Itxaka Itxaka left a comment

Choose a reason for hiding this comment

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

Good catch, this has been a pita

@codecov
Copy link

codecov bot commented Jan 5, 2023

Codecov Report

Base: 49.63% // Head: 49.71% // Increases project coverage by +0.08% 🎉

Coverage data is based on head (b8dacf7) compared to base (c4bb975).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #319      +/-   ##
==========================================
+ Coverage   49.63%   49.71%   +0.08%     
==========================================
  Files          31       31              
  Lines        3536     3536              
==========================================
+ Hits         1755     1758       +3     
+ Misses       1628     1626       -2     
+ Partials      153      152       -1     
Impacted Files Coverage Δ
pkg/server/register.go 63.44% <0.00%> (+0.70%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fgiudici
Copy link
Member Author

fgiudici commented Jan 5, 2023

Good catch, this has been a pita

it drove me crazy to understand why it was failing... banged my head on this for almost 2 days 😅

@fgiudici fgiudici merged commit 43538d1 into rancher:main Jan 5, 2023
@fgiudici fgiudici deleted the fix_goheader_linter branch January 9, 2023 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build build related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants