Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package golangci-lint for openSUSE:Factory checked in at 2023-03-22 22:30:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/golangci-lint (Old) and /work/SRC/openSUSE:Factory/.golangci-lint.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "golangci-lint" Wed Mar 22 22:30:51 2023 rev:2 rq:1073670 version:1.52.1 Changes: -------- --- /work/SRC/openSUSE:Factory/golangci-lint/golangci-lint.changes 2023-03-19 16:17:02.411456811 +0100 +++ /work/SRC/openSUSE:Factory/.golangci-lint.new.31432/golangci-lint.changes 2023-03-22 22:30:52.646264293 +0100 @@ -1,0 +2,16 @@ +Tue Mar 21 20:11:11 UTC 2023 - jkowalc...@suse.com + +- Update to version 1.52.1: + * fix: combination of --fix and --path-prefix (#3700) + * fix: improve panic management (#3710) + * build(deps): bump actions/setup-go from 3 to 4 (#3707) + * docs: fix typos (#3705) + * docs: Update documentation and assets +- Packaging: _service add set_version to automate version updates + +------------------------------------------------------------------- +Tue Mar 21 11:27:19 UTC 2023 - Bernhard Wiedemann <bwiedem...@suse.com> + +- Use SOURCE_DATE_EPOCH as build date (boo#1047218) + +------------------------------------------------------------------- Old: ---- golangci-lint-1.52.0.tar.xz New: ---- golangci-lint-1.52.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ golangci-lint.spec ++++++ --- /var/tmp/diff_new_pack.Yt3tCd/_old 2023-03-22 22:30:54.182272022 +0100 +++ /var/tmp/diff_new_pack.Yt3tCd/_new 2023-03-22 22:30:54.190272062 +0100 @@ -1,7 +1,7 @@ # # spec file for package golangci-lint # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,17 +15,16 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # -# Remove stripping of Go binaries. + %define __arch_install_post export NO_BRP_STRIP_DEBUG=true # approximate build date for display in golangci-lint version output, exact # timemstap can be obtained by doing an rpm query -%define release_build_date %(date +"%Y-%m-%d") Name: golangci-lint -Version: 1.52.0 +Version: 1.52.1 Release: 0 Summary: A fast Go linters runner -License: GPL-3.0 +License: GPL-3.0-only URL: https://golangci-lint.run Source0: %{name}-%{version}.tar.xz Source1: vendor.tar.xz @@ -43,12 +42,13 @@ %build # Build the binary, use PIE unless on PPC64 +release_build_date=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +"%%Y-%%m-%%d") go build \ -mod=vendor \ %ifnarch ppc64 -buildmode=pie \ %endif - -ldflags "-s -w -X main.date=%{release_build_date}" \ + -ldflags "-s -w -X main.date=${release_build_date}" \ -o %{name} \ cmd/%{name}/main.go ++++++ _service ++++++ --- /var/tmp/diff_new_pack.Yt3tCd/_old 2023-03-22 22:30:54.222272223 +0100 +++ /var/tmp/diff_new_pack.Yt3tCd/_new 2023-03-22 22:30:54.226272243 +0100 @@ -3,12 +3,14 @@ <param name="scm">git</param> <param name="url">https://github.com/golangci/golangci-lint.git</param> <param name="exclude">.git</param> - <param name="revision">v1.52.0</param> + <param name="revision">v1.52.1</param> <param name="versionformat">@PARENT_TAG@</param> <param name="filename">golangci-lint</param> <param name="versionrewrite-pattern">v(.*)</param> <param name="changesgenerate">enable</param> </service> + <service name="set_version" mode="disabled"> + </service> <service name="recompress" mode="disabled"> <param name="file">golangci-lint-*.tar</param> <param name="compression">xz</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.Yt3tCd/_old 2023-03-22 22:30:54.246272344 +0100 +++ /var/tmp/diff_new_pack.Yt3tCd/_new 2023-03-22 22:30:54.250272364 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/golangci/golangci-lint.git</param> - <param name="changesrevision">a12be2d59a0e2d99e1c64efabc55d737f352fc7d</param></service></servicedata> + <param name="changesrevision">d92b38cc3e1a7bbb1d6dd1c5edcf302b2196f81f</param></service></servicedata> (No newline at EOF) ++++++ golangci-lint-1.52.0.tar.xz -> golangci-lint-1.52.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golangci-lint-1.52.0/.github/CONTRIBUTING.md new/golangci-lint-1.52.1/.github/CONTRIBUTING.md --- old/golangci-lint-1.52.0/.github/CONTRIBUTING.md 2023-03-18 11:04:34.000000000 +0100 +++ new/golangci-lint-1.52.1/.github/CONTRIBUTING.md 2023-03-20 21:44:36.000000000 +0100 @@ -1 +1 @@ -See [contibuting quick start](https://golangci-lint.run/contributing/quick-start/) on our website. +See [contributing quick start](https://golangci-lint.run/contributing/quick-start/) on our website. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golangci-lint-1.52.0/.github/workflows/post-release.yml new/golangci-lint-1.52.1/.github/workflows/post-release.yml --- old/golangci-lint-1.52.0/.github/workflows/post-release.yml 2023-03-18 11:04:34.000000000 +0100 +++ new/golangci-lint-1.52.1/.github/workflows/post-release.yml 2023-03-20 21:44:36.000000000 +0100 @@ -12,7 +12,7 @@ steps: - uses: actions/checkout@v3 - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # https://github.com/actions/setup-go#supported-version-syntax # ex: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golangci-lint-1.52.0/.github/workflows/pr-extra.yml new/golangci-lint-1.52.1/.github/workflows/pr-extra.yml --- old/golangci-lint-1.52.0/.github/workflows/pr-extra.yml 2023-03-18 11:04:34.000000000 +0100 +++ new/golangci-lint-1.52.1/.github/workflows/pr-extra.yml 2023-03-20 21:44:36.000000000 +0100 @@ -11,7 +11,7 @@ runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: # https://github.com/actions/setup-go#supported-version-syntax # ex: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golangci-lint-1.52.0/.github/workflows/pr.yml new/golangci-lint-1.52.1/.github/workflows/pr.yml --- old/golangci-lint-1.52.0/.github/workflows/pr.yml 2023-03-18 11:04:34.000000000 +0100 +++ new/golangci-lint-1.52.1/.github/workflows/pr.yml 2023-03-20 21:44:36.000000000 +0100 @@ -14,7 +14,7 @@ runs-on: ubuntu-latest steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # https://github.com/actions/setup-go#supported-version-syntax # ex: @@ -35,7 +35,7 @@ steps: - uses: actions/checkout@v3 - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # https://github.com/actions/setup-go#supported-version-syntax # ex: @@ -56,7 +56,7 @@ steps: - uses: actions/checkout@v3 - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # https://github.com/actions/setup-go#supported-version-syntax # ex: @@ -72,7 +72,7 @@ steps: - uses: actions/checkout@v3 - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # https://github.com/actions/setup-go#supported-version-syntax # ex: @@ -93,7 +93,7 @@ steps: - uses: actions/checkout@v3 - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # https://github.com/actions/setup-go#supported-version-syntax # ex: @@ -120,7 +120,7 @@ - name: Unshallow run: git fetch --prune --unshallow - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # https://github.com/actions/setup-go#supported-version-syntax # ex: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golangci-lint-1.52.0/.github/workflows/tag.yml new/golangci-lint-1.52.1/.github/workflows/tag.yml --- old/golangci-lint-1.52.0/.github/workflows/tag.yml 2023-03-18 11:04:34.000000000 +0100 +++ new/golangci-lint-1.52.1/.github/workflows/tag.yml 2023-03-20 21:44:36.000000000 +0100 @@ -12,7 +12,7 @@ steps: - uses: actions/checkout@v3 - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # https://github.com/actions/setup-go#supported-version-syntax # ex: @@ -42,7 +42,7 @@ - uses: actions/checkout@v3 - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # https://github.com/actions/setup-go#supported-version-syntax # ex: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golangci-lint-1.52.0/CHANGELOG.md new/golangci-lint-1.52.1/CHANGELOG.md --- old/golangci-lint-1.52.0/CHANGELOG.md 2023-03-18 11:04:34.000000000 +0100 +++ new/golangci-lint-1.52.1/CHANGELOG.md 2023-03-20 21:44:36.000000000 +0100 @@ -1,6 +1,43 @@ Follow the news and releases on our [twitter](https://twitter.com/golangci) and our [blog](https://medium.com/golangci). There is the most valuable changes log: +### v1.52.0 + +1. updated linters + * `asciicheck`: from 0.1.1 to 0.2.0 + * `bidichk`: from 0.2.3 to 0.2.4 + * `contextcheck`: from 1.1.3 to 1.1.4 + * `dupword`: from 0.0.9 to 0.0.11 + * `durationcheck`: from 0.0.9 to 0.0.10 + * `errchkjson`: from 0.3.0 to 0.3.1 + * `errname`: from 0.1.7 to 0.1.9 + * `forbidigo`: from 1.4.0 to 1.5.1 + * `gci`: from 0.9.1 to 0.10.1 + * `ginkgolinter`: from 0.8.1 to 0.9.0 + * `go-critic`: from 0.6.7 to 0.7.0 + * `go-errorlint`: from 1.1.0 to 1.4.0 + * `godox`: bump to HEAD + * `lll`: skip go command + * `loggercheck`: from 0.9.3 to 0.9.4 + * `musttag`: from 0.4.5 to 0.5.0 + * `nilnil`: from 0.1.1 to 0.1.3 + * `noctx`: from 0.0.1 to 0.0.2 + * `revive`: from 1.2.5 to 1.3.1 + * `rowserrcheck`: remove limitation related to generics support + * `staticcheck`: from 0.4.2 to 0.4.3 + * `testpackage`: from 1.1.0 to 1.1.1 + * `tparallel`: from 0.2.1 to 0.3.0 + * `wastedassign`: remove limitation related to generics support + * `wrapcheck`: from 2.8.0 to 2.8.1 +2. misc. + * Add TeamCity output format + * Consider path prefix when matching path patterns + * Add Go version to version information +3. Documentation + * Add Tekton in Trusted By page + * Clarify that custom linters are not enabled by default + * Remove description for deprecated "go" option + ### v1.51.2 1. updated linters diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golangci-lint-1.52.0/assets/github-action-config.json new/golangci-lint-1.52.1/assets/github-action-config.json --- old/golangci-lint-1.52.0/assets/github-action-config.json 2023-03-18 11:04:34.000000000 +0100 +++ new/golangci-lint-1.52.1/assets/github-action-config.json 2023-03-20 21:44:36.000000000 +0100 @@ -1,8 +1,8 @@ { "MinorVersionToConfig": { "latest": { - "TargetVersion": "v1.51.2", - "AssetURL": "https://github.com/golangci/golangci-lint/releases/download/v1.51.2/golangci-lint-1.51.2-linux-amd64.tar.gz" + "TargetVersion": "v1.52.0", + "AssetURL": "https://github.com/golangci/golangci-lint/releases/download/v1.52.0/golangci-lint-1.52.0-linux-amd64.tar.gz" }, "v1.10": { "Error": "golangci-lint version 'v1.10' isn't supported: we support only v1.14.0 and later versions" @@ -177,6 +177,10 @@ "TargetVersion": "v1.51.2", "AssetURL": "https://github.com/golangci/golangci-lint/releases/download/v1.51.2/golangci-lint-1.51.2-linux-amd64.tar.gz" }, + "v1.52": { + "TargetVersion": "v1.52.0", + "AssetURL": "https://github.com/golangci/golangci-lint/releases/download/v1.52.0/golangci-lint-1.52.0-linux-amd64.tar.gz" + }, "v1.6": { "Error": "golangci-lint version 'v1.6' isn't supported: we support only v1.14.0 and later versions" }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golangci-lint-1.52.0/docs/gatsby-node.js new/golangci-lint-1.52.1/docs/gatsby-node.js --- old/golangci-lint-1.52.0/docs/gatsby-node.js 2023-03-18 11:04:34.000000000 +0100 +++ new/golangci-lint-1.52.1/docs/gatsby-node.js 2023-03-20 21:44:36.000000000 +0100 @@ -165,7 +165,7 @@ dirs.forEach((dir) => { if (!fs.existsSync(dir)) { - reporter.success(`docs: intialized the ${dir} directory`); + reporter.success(`docs: initialized the ${dir} directory`); fs.mkdirSync(dir); } }); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golangci-lint-1.52.0/docs/template_data.state new/golangci-lint-1.52.1/docs/template_data.state --- old/golangci-lint-1.52.0/docs/template_data.state 2023-03-18 11:04:34.000000000 +0100 +++ new/golangci-lint-1.52.1/docs/template_data.state 2023-03-20 21:44:36.000000000 +0100 @@ -1,2 +1,2 @@ This file stores hash of website templates to trigger Netlify rebuild when something changes, e.g. new linter is added. -c80d06da70dd682f6b984675eb5b193e4a47552fa15e1a732a189901c5505e74 \ No newline at end of file +ceb4fb9c7eda1a42ff620cd28e79cd498405f0d15679634cb5dff399fa9faece \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golangci-lint-1.52.0/pkg/commands/run.go new/golangci-lint-1.52.1/pkg/commands/run.go --- old/golangci-lint-1.52.0/pkg/commands/run.go 2023-03-18 11:04:34.000000000 +0100 +++ new/golangci-lint-1.52.1/pkg/commands/run.go 2023-03-20 21:44:36.000000000 +0100 @@ -23,7 +23,6 @@ "github.com/golangci/golangci-lint/pkg/packages" "github.com/golangci/golangci-lint/pkg/printers" "github.com/golangci/golangci-lint/pkg/result" - "github.com/golangci/golangci-lint/pkg/result/processors" ) const defaultFileMode = 0644 @@ -360,18 +359,12 @@ lintCtx.Log = e.log.Child(logutils.DebugKeyLintersContext) runner, err := lint.NewRunner(e.cfg, e.log.Child(logutils.DebugKeyRunner), - e.goenv, e.EnabledLintersSet, e.lineCache, e.DBManager, lintCtx.Packages) + e.goenv, e.EnabledLintersSet, e.lineCache, e.fileCache, e.DBManager, lintCtx.Packages) if err != nil { return nil, err } - issues, err := runner.Run(ctx, lintersToRun, lintCtx) - if err != nil { - return nil, err - } - - fixer := processors.NewFixer(e.cfg, e.log, e.fileCache) - return fixer.Process(issues), nil + return runner.Run(ctx, lintersToRun, lintCtx) } func (e *Executor) setOutputToDevNull() (savedStdout, savedStderr *os.File) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golangci-lint-1.52.0/pkg/golinters/goanalysis/runner_action.go new/golangci-lint-1.52.1/pkg/golinters/goanalysis/runner_action.go --- old/golangci-lint-1.52.0/pkg/golinters/goanalysis/runner_action.go 2023-03-18 11:04:34.000000000 +0100 +++ new/golangci-lint-1.52.1/pkg/golinters/goanalysis/runner_action.go 2023-03-20 21:44:36.000000000 +0100 @@ -98,6 +98,13 @@ func (act *action) analyzeSafe() { defer func() { if p := recover(); p != nil { + if !act.isroot { + // This line allows to display "hidden" panic with analyzers like buildssa. + // Some linters are dependent of sub-analyzers but when a sub-analyzer fails the linter is not aware of that, + // this results to another panic (ex: "interface conversion: interface {} is nil, not *buildssa.SSA"). + act.r.log.Errorf("%s: panic during analysis: %v, %s", act.a.Name, p, string(debug.Stack())) + } + act.err = errorutil.NewPanicError(fmt.Sprintf("%s: package %q (isInitialPkg: %t, needAnalyzeSource: %t): %s", act.a.Name, act.pkg.Name, act.isInitialPkg, act.needAnalyzeSource, p), debug.Stack()) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golangci-lint-1.52.0/pkg/lint/runner.go new/golangci-lint-1.52.1/pkg/lint/runner.go --- old/golangci-lint-1.52.0/pkg/lint/runner.go 2023-03-18 11:04:34.000000000 +0100 +++ new/golangci-lint-1.52.1/pkg/lint/runner.go 2023-03-20 21:44:36.000000000 +0100 @@ -27,8 +27,10 @@ Log logutils.Log } -func NewRunner(cfg *config.Config, log logutils.Log, goenv *goutil.Env, es *lintersdb.EnabledSet, - lineCache *fsutils.LineCache, dbManager *lintersdb.Manager, pkgs []*gopackages.Package) (*Runner, error) { +func NewRunner(cfg *config.Config, log logutils.Log, goenv *goutil.Env, + es *lintersdb.EnabledSet, + lineCache *fsutils.LineCache, fileCache *fsutils.FileCache, + dbManager *lintersdb.Manager, pkgs []*gopackages.Package) (*Runner, error) { // Beware that some processors need to add the path prefix when working with paths // because they get invoked before the path prefixer (exclude and severity rules) // or process other paths (skip files). @@ -98,6 +100,11 @@ processors.NewSourceCode(lineCache, log.Child(logutils.DebugKeySourceCode)), processors.NewPathShortener(), getSeverityRulesProcessor(&cfg.Severity, log, files), + + // The fixer still needs to see paths for the issues that are relative to the current directory. + processors.NewFixer(cfg, log, fileCache), + + // Now we can modify the issues for output. processors.NewPathPrefixer(cfg.Output.PathPrefix), processors.NewSortResults(cfg), }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golangci-lint-1.52.0/pkg/result/processors/fixer.go new/golangci-lint-1.52.1/pkg/result/processors/fixer.go --- old/golangci-lint-1.52.0/pkg/result/processors/fixer.go 2023-03-18 11:04:34.000000000 +0100 +++ new/golangci-lint-1.52.1/pkg/result/processors/fixer.go 2023-03-20 21:44:36.000000000 +0100 @@ -16,6 +16,8 @@ "github.com/golangci/golangci-lint/pkg/timeutils" ) +var _ Processor = Fixer{} + type Fixer struct { cfg *config.Config log logutils.Log @@ -36,9 +38,9 @@ f.sw.PrintStages() } -func (f Fixer) Process(issues []result.Issue) []result.Issue { +func (f Fixer) Process(issues []result.Issue) ([]result.Issue, error) { if !f.cfg.Issues.NeedFix { - return issues + return issues, nil } outIssues := make([]result.Issue, 0, len(issues)) @@ -67,9 +69,15 @@ } f.printStat() - return outIssues + return outIssues, nil +} + +func (f Fixer) Name() string { + return "fixer" } +func (f Fixer) Finish() {} + func (f Fixer) fixIssuesInFile(filePath string, issues []result.Issue) error { // TODO: don't read the whole file into memory: read line by line; // can't just use bufio.scanner: it has a line length limit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golangci-lint-1.52.0/test/fix_test.go new/golangci-lint-1.52.1/test/fix_test.go --- old/golangci-lint-1.52.0/test/fix_test.go 2023-03-18 11:04:34.000000000 +0100 +++ new/golangci-lint-1.52.1/test/fix_test.go 2023-03-20 21:44:36.000000000 +0100 @@ -14,7 +14,9 @@ // value: "1" const envKeepTempFiles = "GL_KEEP_TEMP_FILES" -func TestFix(t *testing.T) { +func setupTestFix(t *testing.T) []string { + t.Helper() + testshared.SkipOnWindows(t) tmpDir := filepath.Join(testdataDir, "fix.tmp") @@ -33,7 +35,48 @@ testshared.InstallGolangciLint(t) - sources := findSources(t, tmpDir, "in", "*.go") + return findSources(t, tmpDir, "in", "*.go") +} + +func TestFix(t *testing.T) { + sources := setupTestFix(t) + + for _, input := range sources { + input := input + t.Run(filepath.Base(input), func(t *testing.T) { + t.Parallel() + + rc := testshared.ParseTestDirectives(t, input) + if rc == nil { + t.Logf("Skipped: %s", input) + return + } + + testshared.NewRunnerBuilder(t). + WithArgs("--disable-all", + "--print-issued-lines=false", + "--print-linter-name=false", + "--out-format=line-number", + "--fix"). + WithRunContext(rc). + WithTargetPath(input). + Runner(). + Run(). + ExpectExitCode(rc.ExitCode) + + output, err := os.ReadFile(input) + require.NoError(t, err) + + expectedOutput, err := os.ReadFile(filepath.Join(testdataDir, "fix", "out", filepath.Base(input))) + require.NoError(t, err) + + require.Equal(t, string(expectedOutput), string(output)) + }) + } +} + +func TestFix_pathPrefix(t *testing.T) { + sources := setupTestFix(t) for _, input := range sources { input := input @@ -47,13 +90,12 @@ } testshared.NewRunnerBuilder(t). - WithArgs( - "--disable-all", + WithArgs("--disable-all", "--print-issued-lines=false", "--print-linter-name=false", "--out-format=line-number", "--fix", - ). + "--path-prefix=foobar/"). WithRunContext(rc). WithTargetPath(input). Runner(). ++++++ vendor.tar.xz ++++++