-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
FAIL: TestSourcesFromTestdata/go-header_bad.go #3682
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
Comments
@denis-tingaikin FYI |
I want to be precise: the tests don't fail on the branch So I think you are saying that locally the tests are failing. |
Yes, sorry, of course I am about local running. $ git status
On branch master
Your branch is up to date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
.go-header.yml
$ git log -n 1
commit c6231164ade6daa377a08ba2cbd7479302d71404 (HEAD -> master, origin/master, origin/HEAD)
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun Mar 12 13:14:48 2023 +0100
build(deps): bump github.com/Antonboom/nilnil from 0.1.2 to 0.1.3 (#3679)
$ make test | grep FAIL
--- FAIL: TestSourcesFromTestdata (0.00s)
--- FAIL: TestSourcesFromTestdata/go-header_bad.go (0.35s)
FAIL
FAIL github.com/golangci/golangci-lint/test 66.131s
FAIL
make: *** [test] Error 1 |
I think I find the bug but I'm not sure for now: - if t.Year() != time.Now().Year() {
+ if t.UTC().Year() >= time.Now().UTC().Year() { |
I think the bug has been described here: denis-tingaikin/go-header#22 It's coming from this commit denis-tingaikin/go-header@97ef360 and it was related to this issue denis-tingaikin/go-header#5 |
My change makes the linter work but IMO the real fix is to remove the check. It fixes the problem for me locally, @Antonboom can you try it also? - if t, err := target.ModTime(); err == nil {
- if t.Year() != time.Now().Year() {
- return nil
- }
- } T=go-header_bad.go make test_linters |
Yes, it helps 👍 |
@ldez how/what should someone change to I changed the Could the code generate that file at test run time (adding it to |
@mateusoliveira43 It's not a problem inside golangci-lint, please read the thread. |
I've provided a fix for the root cause: denis-tingaikin/go-header#39 Am going to merge the fix next Sunday, so please feel free to add comments or thoughts. |
🎉 denis-tingaikin/go-header#39 (review) Thank you ❤️ |
Fixed by #4396 |
Welcome
Description of the problem
Tests in master fail because of no expected warning from
go-header
.The standalone run is silence too:
Version of golangci-lint
Configuration file
Go environment
Verbose output of running
The text was updated successfully, but these errors were encountered: