├── .custom-gcl.reference.yml
├── .gitattributes
├── .github
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE
│ ├── bug_report.yml
│ ├── config.yml
│ └── feature_request.yml
├── PULL_REQUEST_TEMPLATE.md
├── boring-cyborg.yml
├── dependabot.yml
├── new-linter-checklist.md
├── peril
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── rules
│ │ └── invite-collaborator.ts
│ ├── settings.json
│ ├── tests
│ │ └── invite-collaborator.test.ts
│ └── tsconfig.json
├── stale.yml
└── workflows
│ ├── codeql.yml
│ ├── deploy-documentation.yml
│ ├── new-linter-checklist.yml
│ ├── post-release.yml
│ ├── pr-checks.yml
│ ├── pr-documentation.yml
│ ├── pr-tests.yml
│ └── release.yml
├── .gitignore
├── .golangci.next.reference.yml
├── .golangci.reference.yml
├── .golangci.yml
├── .goreleaser.yml
├── .pre-commit-hooks.yaml
├── CHANGELOG.md
├── LICENSE
├── Makefile
├── README.md
├── assets
├── cli-help.json
├── exclusion-presets.json
├── formatters-info.json
├── github-action-config-v1.json
├── github-action-config-v2.json
├── github-action-config.json
├── go.png
├── goland-white.svg
├── goland.svg
└── linters-info.json
├── build
├── buildx-alpine.Dockerfile
└── buildx.Dockerfile
├── cmd
└── golangci-lint
│ ├── main.go
│ └── plugins.go
├── docs
├── .gitignore
├── LICENSE
├── gatsby-browser.js
├── gatsby-config.js
├── gatsby-node.js
├── gatsby-ssr.js
├── golangci-lint.tape
├── package-lock.json
├── package.json
├── src
│ ├── @rocketseat
│ │ ├── gatsby-theme-docs-core
│ │ │ ├── index.js
│ │ │ ├── src
│ │ │ │ └── hooks
│ │ │ │ │ └── useSidebar.js
│ │ │ └── util
│ │ │ │ ├── url.js
│ │ │ │ └── with-default.js
│ │ └── gatsby-theme-docs
│ │ │ ├── gatsby
│ │ │ ├── wrapPageElement.js
│ │ │ └── wrapRootElement.js
│ │ │ └── src
│ │ │ ├── assets
│ │ │ └── logo.svg
│ │ │ ├── components
│ │ │ ├── Code
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ ├── Docs-wrapper.js
│ │ │ ├── Docs
│ │ │ │ ├── EditGithub.js
│ │ │ │ ├── PostNav
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── styles.js
│ │ │ │ ├── TOC
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── styles.js
│ │ │ │ └── index.js
│ │ │ ├── Header.js
│ │ │ ├── Homepage.js
│ │ │ ├── Layout
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ ├── Logo.js
│ │ │ ├── SEO.js
│ │ │ ├── Sidebar
│ │ │ │ ├── ExternalLink
│ │ │ │ │ └── index.js
│ │ │ │ ├── InternalLink
│ │ │ │ │ └── index.js
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ └── logo.svg
│ │ │ ├── styles
│ │ │ ├── global.js
│ │ │ └── theme.js
│ │ │ ├── templates
│ │ │ ├── docs-query.js
│ │ │ └── homepage-query.js
│ │ │ ├── text
│ │ │ └── index.mdx
│ │ │ └── util
│ │ │ ├── copy-to-clipboard.js
│ │ │ ├── slug.js
│ │ │ └── url.js
│ ├── components
│ │ ├── ResponsiveContainer.js
│ │ └── SearchBar
│ │ │ ├── README.md
│ │ │ ├── algolia.css
│ │ │ ├── index.js
│ │ │ └── styles.css
│ ├── config
│ │ ├── sidebar.yml
│ │ └── site.js
│ ├── docs
│ │ ├── contributing
│ │ │ ├── architecture.mdx
│ │ │ ├── debug.mdx
│ │ │ ├── faq.mdx
│ │ │ ├── new-linters.mdx
│ │ │ ├── quick-start.mdx
│ │ │ ├── website.mdx
│ │ │ └── workflow.mdx
│ │ ├── index.mdx
│ │ ├── plugins
│ │ │ ├── go-plugins.mdx
│ │ │ └── module-plugins.mdx
│ │ ├── product
│ │ │ ├── changelog.mdx
│ │ │ ├── migration-guide.mdx
│ │ │ ├── roadmap.mdx
│ │ │ └── thanks.mdx
│ │ ├── usage
│ │ │ ├── configuration.mdx
│ │ │ ├── false-positives.mdx
│ │ │ ├── formatters.mdx
│ │ │ └── linters.mdx
│ │ └── welcome
│ │ │ ├── annotations.png
│ │ │ ├── colored-line-number.png
│ │ │ ├── faq.mdx
│ │ │ ├── install.mdx
│ │ │ ├── integrations.mdx
│ │ │ └── quick-start.mdx
│ ├── lib
│ │ └── icons.js
│ └── pages
│ │ └── 404.js
└── static
│ ├── CNAME
│ ├── banner.png
│ ├── demo.gif
│ ├── logo-400.png
│ └── logo.png
├── go.mod
├── go.sum
├── install.sh
├── internal
├── cache
│ ├── cache.go
│ ├── cache_test.go
│ └── testdata
│ │ └── hello.go
├── errorutil
│ └── errors.go
├── go
│ ├── LICENSE
│ ├── base
│ │ ├── error_notunix.go
│ │ ├── error_unix.go
│ │ └── readme.md
│ ├── cache
│ │ ├── cache.go
│ │ ├── cache_gcil.go
│ │ ├── cache_test.go
│ │ ├── default.go
│ │ ├── default_gcil.go
│ │ ├── hash.go
│ │ ├── hash_gcil.go
│ │ ├── hash_test.go
│ │ ├── prog.go
│ │ └── readme.md
│ ├── cacheprog
│ │ ├── cacheprog.go
│ │ └── readme.md
│ ├── mmap
│ │ ├── mmap.go
│ │ ├── mmap_other.go
│ │ ├── mmap_unix.go
│ │ ├── mmap_windows.go
│ │ └── readme.md
│ ├── quoted
│ │ ├── quoted.go
│ │ ├── quoted_test.go
│ │ └── readme.md
│ └── testenv
│ │ ├── readme.md
│ │ ├── testenv.go
│ │ ├── testenv_notunix.go
│ │ ├── testenv_notwin.go
│ │ ├── testenv_unix.go
│ │ └── testenv_windows.go
└── x
│ ├── LICENSE
│ └── tools
│ ├── analysisflags
│ ├── readme.md
│ └── url.go
│ ├── analysisinternal
│ ├── analysis.go
│ └── readme.md
│ └── diff
│ ├── diff.go
│ ├── lcs
│ ├── common.go
│ ├── common_test.go
│ ├── doc.go
│ ├── git.sh
│ ├── labels.go
│ ├── old.go
│ ├── old_test.go
│ └── sequence.go
│ ├── myers
│ └── diff.go
│ ├── ndiff.go
│ ├── readme.md
│ └── unified.go
├── jsonschema
├── custom-gcl.jsonschema.json
├── golangci.jsonschema.json
├── golangci.next.jsonschema.json
├── golangci.v1.57.jsonschema.json
├── golangci.v1.58.jsonschema.json
├── golangci.v1.59.jsonschema.json
├── golangci.v1.60.jsonschema.json
├── golangci.v1.61.jsonschema.json
├── golangci.v1.62.jsonschema.json
├── golangci.v1.63.jsonschema.json
├── golangci.v1.64.jsonschema.json
├── golangci.v1.jsonschema.json
└── golangci.v2.0.jsonschema.json
├── pkg
├── commands
│ ├── cache.go
│ ├── config.go
│ ├── config_verify.go
│ ├── config_verify_test.go
│ ├── custom.go
│ ├── flagsets.go
│ ├── fmt.go
│ ├── formatters.go
│ ├── help.go
│ ├── help_formatters.go
│ ├── help_linters.go
│ ├── help_test.go
│ ├── internal
│ │ ├── builder.go
│ │ ├── builder_test.go
│ │ ├── configuration.go
│ │ ├── configuration_test.go
│ │ ├── imports.go
│ │ ├── imports_test.go
│ │ ├── migrate
│ │ │ ├── cloner
│ │ │ │ └── cloner.go
│ │ │ ├── fakeloader
│ │ │ │ ├── config.go
│ │ │ │ └── fakeloader.go
│ │ │ ├── migrate.go
│ │ │ ├── migrate_formatters.go
│ │ │ ├── migrate_issues.go
│ │ │ ├── migrate_linter_names.go
│ │ │ ├── migrate_linter_names_test.go
│ │ │ ├── migrate_linters.go
│ │ │ ├── migrate_linters_exclusions.go
│ │ │ ├── migrate_linters_settings.go
│ │ │ ├── migrate_output.go
│ │ │ ├── migrate_run.go
│ │ │ ├── migrate_severity.go
│ │ │ ├── migrate_test.go
│ │ │ ├── parser
│ │ │ │ └── parser.go
│ │ │ ├── ptr
│ │ │ │ └── ptr.go
│ │ │ ├── testdata
│ │ │ │ ├── json
│ │ │ │ │ ├── empty.golden.json
│ │ │ │ │ └── empty.json
│ │ │ │ ├── toml
│ │ │ │ │ ├── empty.golden.toml
│ │ │ │ │ ├── empty.toml
│ │ │ │ │ ├── linters-settings_goheader.golden.toml
│ │ │ │ │ └── linters-settings_goheader.toml
│ │ │ │ └── yaml
│ │ │ │ │ ├── empty.golden.yml
│ │ │ │ │ ├── empty.yml
│ │ │ │ │ ├── issues_01_a.golden.yml
│ │ │ │ │ ├── issues_01_a.yml
│ │ │ │ │ ├── issues_01_b.golden.yml
│ │ │ │ │ ├── issues_01_b.yml
│ │ │ │ │ ├── issues_02_a.golden.yml
│ │ │ │ │ ├── issues_02_a.yml
│ │ │ │ │ ├── issues_02_b.golden.yml
│ │ │ │ │ ├── issues_02_b.yml
│ │ │ │ │ ├── issues_04_a.golden.yml
│ │ │ │ │ ├── issues_04_a.yml
│ │ │ │ │ ├── issues_04_b.golden.yml
│ │ │ │ │ ├── issues_04_b.yml
│ │ │ │ │ ├── issues_04_c.golden.yml
│ │ │ │ │ ├── issues_04_c.yml
│ │ │ │ │ ├── issues_05_a.golden.yml
│ │ │ │ │ ├── issues_05_a.yml
│ │ │ │ │ ├── issues_05_b.golden.yml
│ │ │ │ │ ├── issues_05_b.yml
│ │ │ │ │ ├── issues_05_c.golden.yml
│ │ │ │ │ ├── issues_05_c.yml
│ │ │ │ │ ├── issues_06_a.golden.yml
│ │ │ │ │ ├── issues_06_a.yml
│ │ │ │ │ ├── issues_06_b.golden.yml
│ │ │ │ │ ├── issues_06_b.yml
│ │ │ │ │ ├── issues_06_c.golden.yml
│ │ │ │ │ ├── issues_06_c.yml
│ │ │ │ │ ├── issues_06_d.golden.yml
│ │ │ │ │ ├── issues_06_d.yml
│ │ │ │ │ ├── issues_06_e.golden.yml
│ │ │ │ │ ├── issues_06_e.yml
│ │ │ │ │ ├── issues_06_f.golden.yml
│ │ │ │ │ ├── issues_06_f.yml
│ │ │ │ │ ├── issues_06_g.golden.yml
│ │ │ │ │ ├── issues_06_g.yml
│ │ │ │ │ ├── issues_06_h.golden.yml
│ │ │ │ │ ├── issues_06_h.yml
│ │ │ │ │ ├── issues_07_a.golden.yml
│ │ │ │ │ ├── issues_07_a.yml
│ │ │ │ │ ├── issues_07_b.golden.yml
│ │ │ │ │ ├── issues_07_b.yml
│ │ │ │ │ ├── issues_08_a.golden.yml
│ │ │ │ │ ├── issues_08_a.yml
│ │ │ │ │ ├── issues_08_b.golden.yml
│ │ │ │ │ ├── issues_08_b.yml
│ │ │ │ │ ├── issues_09_a.golden.yml
│ │ │ │ │ ├── issues_09_a.yml
│ │ │ │ │ ├── issues_09_b.golden.yml
│ │ │ │ │ ├── issues_09_b.yml
│ │ │ │ │ ├── issues_10.golden.yml
│ │ │ │ │ ├── issues_10.yml
│ │ │ │ │ ├── linters-settings_asasalint.golden.yml
│ │ │ │ │ ├── linters-settings_asasalint.yml
│ │ │ │ │ ├── linters-settings_bidichk.golden.yml
│ │ │ │ │ ├── linters-settings_bidichk.yml
│ │ │ │ │ ├── linters-settings_copyloopvar.golden.yml
│ │ │ │ │ ├── linters-settings_copyloopvar.yml
│ │ │ │ │ ├── linters-settings_custom.golden.yml
│ │ │ │ │ ├── linters-settings_custom.yml
│ │ │ │ │ ├── linters-settings_cyclop.golden.yml
│ │ │ │ │ ├── linters-settings_cyclop.yml
│ │ │ │ │ ├── linters-settings_decorder.golden.yml
│ │ │ │ │ ├── linters-settings_decorder.yml
│ │ │ │ │ ├── linters-settings_depguard.golden.yml
│ │ │ │ │ ├── linters-settings_depguard.yml
│ │ │ │ │ ├── linters-settings_dogsled.golden.yml
│ │ │ │ │ ├── linters-settings_dogsled.yml
│ │ │ │ │ ├── linters-settings_dupl.golden.yml
│ │ │ │ │ ├── linters-settings_dupl.yml
│ │ │ │ │ ├── linters-settings_dupword.golden.yml
│ │ │ │ │ ├── linters-settings_dupword.yml
│ │ │ │ │ ├── linters-settings_errcheck.golden.yml
│ │ │ │ │ ├── linters-settings_errcheck.yml
│ │ │ │ │ ├── linters-settings_errchkjson.golden.yml
│ │ │ │ │ ├── linters-settings_errchkjson.yml
│ │ │ │ │ ├── linters-settings_errorlint.golden.yml
│ │ │ │ │ ├── linters-settings_errorlint.yml
│ │ │ │ │ ├── linters-settings_exhaustive.golden.yml
│ │ │ │ │ ├── linters-settings_exhaustive.yml
│ │ │ │ │ ├── linters-settings_exhaustruct.golden.yml
│ │ │ │ │ ├── linters-settings_exhaustruct.yml
│ │ │ │ │ ├── linters-settings_fatcontext.golden.yml
│ │ │ │ │ ├── linters-settings_fatcontext.yml
│ │ │ │ │ ├── linters-settings_forbidigo.golden.yml
│ │ │ │ │ ├── linters-settings_forbidigo.yml
│ │ │ │ │ ├── linters-settings_funlen.golden.yml
│ │ │ │ │ ├── linters-settings_funlen.yml
│ │ │ │ │ ├── linters-settings_gci.golden.yml
│ │ │ │ │ ├── linters-settings_gci.yml
│ │ │ │ │ ├── linters-settings_ginkgolinter.golden.yml
│ │ │ │ │ ├── linters-settings_ginkgolinter.yml
│ │ │ │ │ ├── linters-settings_gochecksumtype.golden.yml
│ │ │ │ │ ├── linters-settings_gochecksumtype.yml
│ │ │ │ │ ├── linters-settings_gocognit.golden.yml
│ │ │ │ │ ├── linters-settings_gocognit.yml
│ │ │ │ │ ├── linters-settings_goconst.golden.yml
│ │ │ │ │ ├── linters-settings_goconst.yml
│ │ │ │ │ ├── linters-settings_gocritic.golden.yml
│ │ │ │ │ ├── linters-settings_gocritic.yml
│ │ │ │ │ ├── linters-settings_gocyclo.golden.yml
│ │ │ │ │ ├── linters-settings_gocyclo.yml
│ │ │ │ │ ├── linters-settings_godot.golden.yml
│ │ │ │ │ ├── linters-settings_godot.yml
│ │ │ │ │ ├── linters-settings_godox.golden.yml
│ │ │ │ │ ├── linters-settings_godox.yml
│ │ │ │ │ ├── linters-settings_gofmt.golden.yml
│ │ │ │ │ ├── linters-settings_gofmt.yml
│ │ │ │ │ ├── linters-settings_gofumpt.golden.yml
│ │ │ │ │ ├── linters-settings_gofumpt.yml
│ │ │ │ │ ├── linters-settings_goheader.golden.yml
│ │ │ │ │ ├── linters-settings_goheader.yml
│ │ │ │ │ ├── linters-settings_goimports.golden.yml
│ │ │ │ │ ├── linters-settings_goimports.yml
│ │ │ │ │ ├── linters-settings_gomoddirectives.golden.yml
│ │ │ │ │ ├── linters-settings_gomoddirectives.yml
│ │ │ │ │ ├── linters-settings_gomodguard.golden.yml
│ │ │ │ │ ├── linters-settings_gomodguard.yml
│ │ │ │ │ ├── linters-settings_gosec.golden.yml
│ │ │ │ │ ├── linters-settings_gosec.yml
│ │ │ │ │ ├── linters-settings_gosimple.golden.yml
│ │ │ │ │ ├── linters-settings_gosimple.yml
│ │ │ │ │ ├── linters-settings_gosmopolitan.golden.yml
│ │ │ │ │ ├── linters-settings_gosmopolitan.yml
│ │ │ │ │ ├── linters-settings_govet.golden.yml
│ │ │ │ │ ├── linters-settings_govet.yml
│ │ │ │ │ ├── linters-settings_grouper.golden.yml
│ │ │ │ │ ├── linters-settings_grouper.yml
│ │ │ │ │ ├── linters-settings_iface.golden.yml
│ │ │ │ │ ├── linters-settings_iface.yml
│ │ │ │ │ ├── linters-settings_importas.golden.yml
│ │ │ │ │ ├── linters-settings_importas.yml
│ │ │ │ │ ├── linters-settings_inamedparam.golden.yml
│ │ │ │ │ ├── linters-settings_inamedparam.yml
│ │ │ │ │ ├── linters-settings_interfacebloat.golden.yml
│ │ │ │ │ ├── linters-settings_interfacebloat.yml
│ │ │ │ │ ├── linters-settings_ireturn.golden.yml
│ │ │ │ │ ├── linters-settings_ireturn.yml
│ │ │ │ │ ├── linters-settings_lll.golden.yml
│ │ │ │ │ ├── linters-settings_lll.yml
│ │ │ │ │ ├── linters-settings_loggercheck.golden.yml
│ │ │ │ │ ├── linters-settings_loggercheck.yml
│ │ │ │ │ ├── linters-settings_maintidx.golden.yml
│ │ │ │ │ ├── linters-settings_maintidx.yml
│ │ │ │ │ ├── linters-settings_makezero.golden.yml
│ │ │ │ │ ├── linters-settings_makezero.yml
│ │ │ │ │ ├── linters-settings_misspell.golden.yml
│ │ │ │ │ ├── linters-settings_misspell.yml
│ │ │ │ │ ├── linters-settings_mnd.golden.yml
│ │ │ │ │ ├── linters-settings_mnd.yml
│ │ │ │ │ ├── linters-settings_musttag.golden.yml
│ │ │ │ │ ├── linters-settings_musttag.yml
│ │ │ │ │ ├── linters-settings_nakedret.golden.yml
│ │ │ │ │ ├── linters-settings_nakedret.yml
│ │ │ │ │ ├── linters-settings_nakedret_zero.golden.yml
│ │ │ │ │ ├── linters-settings_nakedret_zero.yml
│ │ │ │ │ ├── linters-settings_nestif.golden.yml
│ │ │ │ │ ├── linters-settings_nestif.yml
│ │ │ │ │ ├── linters-settings_nilnil.golden.yml
│ │ │ │ │ ├── linters-settings_nilnil.yml
│ │ │ │ │ ├── linters-settings_nlreturn.golden.yml
│ │ │ │ │ ├── linters-settings_nlreturn.yml
│ │ │ │ │ ├── linters-settings_nolintlint.golden.yml
│ │ │ │ │ ├── linters-settings_nolintlint.yml
│ │ │ │ │ ├── linters-settings_nonamedreturns.golden.yml
│ │ │ │ │ ├── linters-settings_nonamedreturns.yml
│ │ │ │ │ ├── linters-settings_paralleltest.golden.yml
│ │ │ │ │ ├── linters-settings_paralleltest.yml
│ │ │ │ │ ├── linters-settings_perfsprint.golden.yml
│ │ │ │ │ ├── linters-settings_perfsprint.yml
│ │ │ │ │ ├── linters-settings_prealloc.golden.yml
│ │ │ │ │ ├── linters-settings_prealloc.yml
│ │ │ │ │ ├── linters-settings_predeclared.golden.yml
│ │ │ │ │ ├── linters-settings_predeclared.yml
│ │ │ │ │ ├── linters-settings_promlinter.golden.yml
│ │ │ │ │ ├── linters-settings_promlinter.yml
│ │ │ │ │ ├── linters-settings_protogetter.golden.yml
│ │ │ │ │ ├── linters-settings_protogetter.yml
│ │ │ │ │ ├── linters-settings_reassign.golden.yml
│ │ │ │ │ ├── linters-settings_reassign.yml
│ │ │ │ │ ├── linters-settings_recvcheck.golden.yml
│ │ │ │ │ ├── linters-settings_recvcheck.yml
│ │ │ │ │ ├── linters-settings_revive.golden.yml
│ │ │ │ │ ├── linters-settings_revive.yml
│ │ │ │ │ ├── linters-settings_rowserrcheck.golden.yml
│ │ │ │ │ ├── linters-settings_rowserrcheck.yml
│ │ │ │ │ ├── linters-settings_sloglint.golden.yml
│ │ │ │ │ ├── linters-settings_sloglint.yml
│ │ │ │ │ ├── linters-settings_spancheck.golden.yml
│ │ │ │ │ ├── linters-settings_spancheck.yml
│ │ │ │ │ ├── linters-settings_staticcheck.golden.yml
│ │ │ │ │ ├── linters-settings_staticcheck.yml
│ │ │ │ │ ├── linters-settings_staticcheck_merge.golden.yml
│ │ │ │ │ ├── linters-settings_staticcheck_merge.yml
│ │ │ │ │ ├── linters-settings_stylecheck.golden.yml
│ │ │ │ │ ├── linters-settings_stylecheck.yml
│ │ │ │ │ ├── linters-settings_tagalign.golden.yml
│ │ │ │ │ ├── linters-settings_tagalign.yml
│ │ │ │ │ ├── linters-settings_tagliatelle.golden.yml
│ │ │ │ │ ├── linters-settings_tagliatelle.yml
│ │ │ │ │ ├── linters-settings_testifylint.golden.yml
│ │ │ │ │ ├── linters-settings_testifylint.yml
│ │ │ │ │ ├── linters-settings_testpackage.golden.yml
│ │ │ │ │ ├── linters-settings_testpackage.yml
│ │ │ │ │ ├── linters-settings_thelper.golden.yml
│ │ │ │ │ ├── linters-settings_thelper.yml
│ │ │ │ │ ├── linters-settings_unconvert.golden.yml
│ │ │ │ │ ├── linters-settings_unconvert.yml
│ │ │ │ │ ├── linters-settings_unparam.golden.yml
│ │ │ │ │ ├── linters-settings_unparam.yml
│ │ │ │ │ ├── linters-settings_unused.golden.yml
│ │ │ │ │ ├── linters-settings_unused.yml
│ │ │ │ │ ├── linters-settings_usestdlibvars.golden.yml
│ │ │ │ │ ├── linters-settings_usestdlibvars.yml
│ │ │ │ │ ├── linters-settings_usetesting.golden.yml
│ │ │ │ │ ├── linters-settings_usetesting.yml
│ │ │ │ │ ├── linters-settings_varnamelen.golden.yml
│ │ │ │ │ ├── linters-settings_varnamelen.yml
│ │ │ │ │ ├── linters-settings_whitespace.golden.yml
│ │ │ │ │ ├── linters-settings_whitespace.yml
│ │ │ │ │ ├── linters-settings_wrapcheck.golden.yml
│ │ │ │ │ ├── linters-settings_wrapcheck.yml
│ │ │ │ │ ├── linters-settings_wsl.golden.yml
│ │ │ │ │ ├── linters-settings_wsl.yml
│ │ │ │ │ ├── linters_01.golden.yml
│ │ │ │ │ ├── linters_01.yml
│ │ │ │ │ ├── linters_02.golden.yml
│ │ │ │ │ ├── linters_02.yml
│ │ │ │ │ ├── linters_03.golden.yml
│ │ │ │ │ ├── linters_03.yml
│ │ │ │ │ ├── linters_04.golden.yml
│ │ │ │ │ ├── linters_04.yml
│ │ │ │ │ ├── linters_05.golden.yml
│ │ │ │ │ ├── linters_05.yml
│ │ │ │ │ ├── linters_06.golden.yml
│ │ │ │ │ ├── linters_06.yml
│ │ │ │ │ ├── linters_07.golden.yml
│ │ │ │ │ ├── linters_07.yml
│ │ │ │ │ ├── linters_08.golden.yml
│ │ │ │ │ ├── linters_08.yml
│ │ │ │ │ ├── linters_09.golden.yml
│ │ │ │ │ ├── linters_09.yml
│ │ │ │ │ ├── linters_10.golden.yml
│ │ │ │ │ ├── linters_10.yml
│ │ │ │ │ ├── linters_11.golden.yml
│ │ │ │ │ ├── linters_11.yml
│ │ │ │ │ ├── linters_12.golden.yml
│ │ │ │ │ ├── linters_12.yml
│ │ │ │ │ ├── linters_13_a.golden.yml
│ │ │ │ │ ├── linters_13_a.yml
│ │ │ │ │ ├── linters_13_b.golden.yml
│ │ │ │ │ ├── linters_13_b.yml
│ │ │ │ │ ├── linters_13_c.golden.yml
│ │ │ │ │ ├── linters_13_c.yml
│ │ │ │ │ ├── linters_13_d.golden.yml
│ │ │ │ │ ├── linters_13_d.yml
│ │ │ │ │ ├── output_01_a.golden.yml
│ │ │ │ │ ├── output_01_a.yml
│ │ │ │ │ ├── output_01_b.golden.yml
│ │ │ │ │ ├── output_01_b.yml
│ │ │ │ │ ├── output_01_c.golden.yml
│ │ │ │ │ ├── output_01_c.yml
│ │ │ │ │ ├── output_01_d.golden.yml
│ │ │ │ │ ├── output_01_d.yml
│ │ │ │ │ ├── output_01_f.golden.yml
│ │ │ │ │ ├── output_01_f.yml
│ │ │ │ │ ├── output_01_g.golden.yml
│ │ │ │ │ ├── output_01_g.yml
│ │ │ │ │ ├── output_01_h.golden.yml
│ │ │ │ │ ├── output_01_h.yml
│ │ │ │ │ ├── output_01_i.golden.yml
│ │ │ │ │ ├── output_01_i.yml
│ │ │ │ │ ├── output_01_j.golden.yml
│ │ │ │ │ ├── output_01_j.yml
│ │ │ │ │ ├── output_01_k.golden.yml
│ │ │ │ │ ├── output_01_k.yml
│ │ │ │ │ ├── output_01_l.golden.yml
│ │ │ │ │ ├── output_01_l.yml
│ │ │ │ │ ├── output_01_m.golden.yml
│ │ │ │ │ ├── output_01_m.yml
│ │ │ │ │ ├── output_01_o.golden.yml
│ │ │ │ │ ├── output_01_o.yml
│ │ │ │ │ ├── output_01_p.golden.yml
│ │ │ │ │ ├── output_01_p.yml
│ │ │ │ │ ├── output_02.golden.yml
│ │ │ │ │ ├── output_02.yml
│ │ │ │ │ ├── output_03.golden.yml
│ │ │ │ │ ├── output_03.yml
│ │ │ │ │ ├── output_04.golden.yml
│ │ │ │ │ ├── output_04.yml
│ │ │ │ │ ├── run_01.golden.yml
│ │ │ │ │ ├── run_01.yml
│ │ │ │ │ ├── run_02_a.golden.yml
│ │ │ │ │ ├── run_02_a.yml
│ │ │ │ │ ├── run_02_b.golden.yml
│ │ │ │ │ ├── run_02_b.yml
│ │ │ │ │ ├── run_03_a.golden.yml
│ │ │ │ │ ├── run_03_a.yml
│ │ │ │ │ ├── run_03_b.golden.yml
│ │ │ │ │ ├── run_03_b.yml
│ │ │ │ │ ├── run_04_a.golden.yml
│ │ │ │ │ ├── run_04_a.yml
│ │ │ │ │ ├── run_04_b.golden.yml
│ │ │ │ │ ├── run_04_b.yml
│ │ │ │ │ ├── run_05.golden.yml
│ │ │ │ │ ├── run_05.yml
│ │ │ │ │ ├── run_06.golden.yml
│ │ │ │ │ ├── run_06.yml
│ │ │ │ │ ├── run_07.golden.yml
│ │ │ │ │ ├── run_07.yml
│ │ │ │ │ ├── run_08.golden.yml
│ │ │ │ │ ├── run_08.yml
│ │ │ │ │ ├── run_09_a.golden.yml
│ │ │ │ │ ├── run_09_a.yml
│ │ │ │ │ ├── run_09_b.golden.yml
│ │ │ │ │ ├── run_09_b.yml
│ │ │ │ │ ├── run_10.golden.yml
│ │ │ │ │ ├── run_10.yml
│ │ │ │ │ ├── severity_01.golden.yml
│ │ │ │ │ ├── severity_01.yml
│ │ │ │ │ ├── severity_02.golden.yml
│ │ │ │ │ ├── severity_02.yml
│ │ │ │ │ ├── severity_03.golden.yml
│ │ │ │ │ ├── severity_03.yml
│ │ │ │ │ ├── unknown-fields.golden.yml
│ │ │ │ │ └── unknown-fields.yml
│ │ │ ├── versionone
│ │ │ │ ├── base_rule.go
│ │ │ │ ├── config.go
│ │ │ │ ├── doc.go
│ │ │ │ ├── issues.go
│ │ │ │ ├── linters.go
│ │ │ │ ├── linters_settings.go
│ │ │ │ ├── output.go
│ │ │ │ ├── run.go
│ │ │ │ └── severity.go
│ │ │ └── versiontwo
│ │ │ │ ├── base_rule.go
│ │ │ │ ├── config.go
│ │ │ │ ├── formatters.go
│ │ │ │ ├── formatters_settings.go
│ │ │ │ ├── issues.go
│ │ │ │ ├── linters.go
│ │ │ │ ├── linters_exclusions.go
│ │ │ │ ├── linters_settings.go
│ │ │ │ ├── output.go
│ │ │ │ ├── output_formats.go
│ │ │ │ ├── run.go
│ │ │ │ └── severity.go
│ │ ├── testdata
│ │ │ └── imports.go
│ │ └── vibra.go
│ ├── linters.go
│ ├── migrate.go
│ ├── root.go
│ ├── run.go
│ └── version.go
├── config
│ ├── base_loader.go
│ ├── base_rule.go
│ ├── config.go
│ ├── config_test.go
│ ├── formatters.go
│ ├── formatters_settings.go
│ ├── issues.go
│ ├── linters.go
│ ├── linters_exclusions.go
│ ├── linters_exclusions_test.go
│ ├── linters_settings.go
│ ├── linters_settings_test.go
│ ├── loader.go
│ ├── output.go
│ ├── output_formats.go
│ ├── output_test.go
│ ├── placeholders.go
│ ├── run.go
│ ├── run_test.go
│ ├── severity.go
│ └── severity_test.go
├── exitcodes
│ └── exitcodes.go
├── fsutils
│ ├── basepath.go
│ ├── filecache.go
│ ├── fsutils.go
│ ├── fsutils_test.go
│ ├── fsutils_unix.go
│ ├── fsutils_windows.go
│ ├── linecache.go
│ ├── path_unix.go
│ └── path_windows.go
├── goanalysis
│ ├── issue.go
│ ├── linter.go
│ ├── load
│ │ └── guard.go
│ ├── metalinter.go
│ ├── pkgerrors
│ │ ├── errors.go
│ │ ├── extract.go
│ │ ├── extract_test.go
│ │ ├── parse.go
│ │ └── parse_test.go
│ ├── position.go
│ ├── runner.go
│ ├── runner_action.go
│ ├── runner_action_cache.go
│ ├── runner_checker.go
│ ├── runner_loadingpackage.go
│ ├── runners.go
│ └── runners_cache.go
├── goformat
│ └── runner.go
├── goformatters
│ ├── analyzer.go
│ ├── formatters.go
│ ├── gci
│ │ ├── gci.go
│ │ └── internal
│ │ │ ├── LICENSE
│ │ │ ├── config
│ │ │ └── config.go
│ │ │ ├── readme.md
│ │ │ └── section
│ │ │ ├── parser.go
│ │ │ ├── section.go
│ │ │ ├── standard.go
│ │ │ └── standard_list.go
│ ├── gofmt
│ │ └── gofmt.go
│ ├── gofumpt
│ │ └── gofumpt.go
│ ├── goimports
│ │ └── goimports.go
│ ├── golines
│ │ └── golines.go
│ ├── internal
│ │ ├── commons.go
│ │ ├── diff.go
│ │ ├── diff_test.go
│ │ └── testdata
│ │ │ ├── add_only.diff
│ │ │ ├── add_only_different_lines.diff
│ │ │ ├── add_only_in_all_diff.diff
│ │ │ ├── add_only_multiple_lines.diff
│ │ │ ├── add_only_on_first_line.diff
│ │ │ ├── add_only_on_first_line_with_shared_original_line.diff
│ │ │ ├── delete_last_line.diff
│ │ │ ├── delete_only_first_lines.diff
│ │ │ ├── gofmt_diff.diff
│ │ │ ├── replace_line.diff
│ │ │ └── replace_line_after_first_line_adding.diff
│ ├── meta_formatter.go
│ └── swaggo
│ │ └── swaggo.go
├── golinters
│ ├── arangolint
│ │ ├── arangolint.go
│ │ ├── arangolint_integration_test.go
│ │ └── testdata
│ │ │ ├── arangolint.go
│ │ │ ├── arangolint_cgo.go
│ │ │ ├── go.mod
│ │ │ └── go.sum
│ ├── asasalint
│ │ ├── asasalint.go
│ │ ├── asasalint_integration_test.go
│ │ └── testdata
│ │ │ ├── asasalint.go
│ │ │ └── asasalint_cgo.go
│ ├── asciicheck
│ │ ├── asciicheck.go
│ │ ├── asciicheck_integration_test.go
│ │ └── testdata
│ │ │ ├── asciicheck.go
│ │ │ └── asciicheck_cgo.go
│ ├── bidichk
│ │ ├── bidichk.go
│ │ ├── bidichk_integration_test.go
│ │ └── testdata
│ │ │ ├── bidichk.go
│ │ │ └── bidichk_cgo.go
│ ├── bodyclose
│ │ ├── bodyclose.go
│ │ ├── bodyclose_integration_test.go
│ │ └── testdata
│ │ │ ├── bodyclose.go
│ │ │ └── bodyclose_cgo.go
│ ├── canonicalheader
│ │ ├── canonicalheader.go
│ │ ├── canonicalheader_test.go
│ │ └── testdata
│ │ │ ├── canonicalheader.go
│ │ │ ├── canonicalheader_cgo.go
│ │ │ └── fix
│ │ │ ├── in
│ │ │ └── canonicalheader.go
│ │ │ └── out
│ │ │ └── canonicalheader.go
│ ├── containedctx
│ │ ├── containedctx.go
│ │ ├── containedctx_integration_test.go
│ │ └── testdata
│ │ │ ├── containedctx.go
│ │ │ └── containedctx_cgo.go
│ ├── contextcheck
│ │ ├── contextcheck.go
│ │ ├── contextcheck_integration_test.go
│ │ └── testdata
│ │ │ ├── contextcheck.go
│ │ │ └── contextcheck_cgo.go
│ ├── copyloopvar
│ │ ├── copyloopvar.go
│ │ ├── copyloopvar_integration_test.go
│ │ └── testdata
│ │ │ ├── copyloopvar.go
│ │ │ ├── copyloopvar.yml
│ │ │ ├── copyloopvar_cgo.go
│ │ │ ├── copyloopvar_custom.go
│ │ │ └── fix
│ │ │ ├── in
│ │ │ └── copyloopvar.go
│ │ │ └── out
│ │ │ └── copyloopvar.go
│ ├── cyclop
│ │ ├── cyclop.go
│ │ ├── cyclop_integration_test.go
│ │ └── testdata
│ │ │ ├── cyclop.go
│ │ │ ├── cyclop.yml
│ │ │ └── cyclop_cgo.go
│ ├── decorder
│ │ ├── decorder.go
│ │ ├── decorder_integration_test.go
│ │ └── testdata
│ │ │ ├── decorder.go
│ │ │ ├── decorder_cgo.go
│ │ │ ├── decorder_custom.go
│ │ │ └── decorder_custom.yml
│ ├── depguard
│ │ ├── depguard.go
│ │ ├── depguard_integration_test.go
│ │ └── testdata
│ │ │ ├── depguard.go
│ │ │ ├── depguard.yml
│ │ │ ├── depguard_additional_guards.go
│ │ │ ├── depguard_additional_guards.yml
│ │ │ ├── depguard_cgo.go
│ │ │ ├── depguard_ignore_file_rules.go
│ │ │ └── depguard_ignore_file_rules.yml
│ ├── dogsled
│ │ ├── dogsled.go
│ │ ├── dogsled_integration_test.go
│ │ └── testdata
│ │ │ ├── dogsled.go
│ │ │ └── dogsled_cgo.go
│ ├── dupl
│ │ ├── dupl.go
│ │ ├── dupl_integration_test.go
│ │ └── testdata
│ │ │ ├── dupl.go
│ │ │ ├── dupl.yml
│ │ │ └── dupl_cgo.go
│ ├── dupword
│ │ ├── dupword.go
│ │ ├── dupword_integration_test.go
│ │ └── testdata
│ │ │ ├── dupword.go
│ │ │ ├── dupword_cgo.go
│ │ │ ├── dupword_ignore_the.go
│ │ │ ├── dupword_ignore_the.yml
│ │ │ └── fix
│ │ │ ├── in
│ │ │ └── dupword.go
│ │ │ └── out
│ │ │ └── dupword.go
│ ├── durationcheck
│ │ ├── durationcheck.go
│ │ ├── durationcheck_integration_test.go
│ │ └── testdata
│ │ │ ├── durationcheck.go
│ │ │ └── durationcheck_cgo.go
│ ├── embeddedstructfieldcheck
│ │ ├── embeddedstructfieldcheck.go
│ │ ├── embeddedstructfieldcheck_integration_test.go
│ │ └── testdata
│ │ │ ├── embeddedstructfieldcheck_comments.go
│ │ │ ├── embeddedstructfieldcheck_mutex.go
│ │ │ ├── embeddedstructfieldcheck_mutex.yml
│ │ │ ├── embeddedstructfieldcheck_simple.go
│ │ │ ├── embeddedstructfieldcheck_special_cases.go
│ │ │ └── fix
│ │ │ ├── in
│ │ │ ├── comments.go
│ │ │ └── simple.go
│ │ │ └── out
│ │ │ ├── comments.go
│ │ │ └── simple.go
│ ├── err113
│ │ ├── err113.go
│ │ ├── err113_integration_test.go
│ │ └── testdata
│ │ │ ├── err113.go
│ │ │ ├── err113_cgo.go
│ │ │ └── fix
│ │ │ ├── in
│ │ │ └── err113.go
│ │ │ └── out
│ │ │ └── err113.go
│ ├── errcheck
│ │ ├── errcheck.go
│ │ ├── errcheck_integration_test.go
│ │ └── testdata
│ │ │ ├── errcheck.go
│ │ │ ├── errcheck_cgo.go
│ │ │ ├── errcheck_exclude_functions.go
│ │ │ ├── errcheck_exclude_functions.yml
│ │ │ ├── errcheck_ignore_default.go
│ │ │ ├── errcheck_ignore_default.yml
│ │ │ ├── errcheck_type_assertions.go
│ │ │ └── errcheck_type_assertions.yml
│ ├── errchkjson
│ │ ├── errchkjson.go
│ │ ├── errchkjson_integration_test.go
│ │ └── testdata
│ │ │ ├── errchkjson.go
│ │ │ ├── errchkjson.yml
│ │ │ ├── errchkjson_cgo.go
│ │ │ ├── errchkjson_check_error_free_encoding.go
│ │ │ ├── errchkjson_check_error_free_encoding.yml
│ │ │ ├── errchkjson_no_exported.go
│ │ │ └── errchkjson_no_exported.yml
│ ├── errname
│ │ ├── errname.go
│ │ ├── errname_integration_test.go
│ │ └── testdata
│ │ │ ├── errname.go
│ │ │ └── errname_cgo.go
│ ├── errorlint
│ │ ├── errorlint.go
│ │ ├── errorlint_integration_test.go
│ │ └── testdata
│ │ │ ├── errorlint.go
│ │ │ ├── errorlint_asserts.go
│ │ │ ├── errorlint_asserts.yml
│ │ │ ├── errorlint_cgo.go
│ │ │ ├── errorlint_comparison.go
│ │ │ ├── errorlint_comparison.yml
│ │ │ ├── errorlint_errorf.go
│ │ │ ├── errorlint_errorf.yml
│ │ │ └── fix
│ │ │ ├── in
│ │ │ └── errorlint.go
│ │ │ └── out
│ │ │ └── errorlint.go
│ ├── exhaustive
│ │ ├── exhaustive.go
│ │ ├── exhaustive_integration_test.go
│ │ └── testdata
│ │ │ ├── exhaustive.go
│ │ │ ├── exhaustive_cgo.go
│ │ │ ├── exhaustive_default.go
│ │ │ ├── exhaustive_default.yml
│ │ │ ├── exhaustive_generated.go
│ │ │ ├── exhaustive_ignore_enum_members.go
│ │ │ └── exhaustive_ignore_enum_members.yml
│ ├── exhaustruct
│ │ ├── exhaustruct.go
│ │ ├── exhaustruct_integration_test.go
│ │ └── testdata
│ │ │ ├── exhaustruct.go
│ │ │ ├── exhaustruct_cgo.go
│ │ │ ├── exhaustruct_custom.go
│ │ │ └── exhaustruct_custom.yml
│ ├── exptostd
│ │ ├── exptostd.go
│ │ ├── exptostd_integration_test.go
│ │ └── testdata
│ │ │ ├── exptostd.go
│ │ │ ├── exptostd_cgo.go
│ │ │ ├── exptostd_go123.go
│ │ │ ├── exptostd_go123_cgo.go
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── exptostd.go
│ │ │ └── out
│ │ │ │ └── exptostd.go
│ │ │ ├── go.mod
│ │ │ └── go.sum
│ ├── fatcontext
│ │ ├── fatcontext.go
│ │ ├── fatcontext_integration_test.go
│ │ └── testdata
│ │ │ ├── fatcontext.go
│ │ │ ├── fatcontext_cgo.go
│ │ │ ├── fatcontext_structpointer.go
│ │ │ ├── fatcontext_structpointer.yml
│ │ │ └── fix
│ │ │ ├── in
│ │ │ └── fatcontext.go
│ │ │ └── out
│ │ │ └── fatcontext.go
│ ├── forbidigo
│ │ ├── forbidigo.go
│ │ ├── forbidigo_integration_test.go
│ │ └── testdata
│ │ │ ├── forbidigo.yml
│ │ │ ├── forbidigo_cgo.go
│ │ │ ├── forbidigo_example.go
│ │ │ ├── forbidigo_example_test.go
│ │ │ ├── forbidigo_include_godoc_examples.yml
│ │ │ ├── forbidigo_include_godoc_examples_test.go
│ │ │ ├── forbidigo_struct.yml
│ │ │ └── forbidigo_struct_config.go
│ ├── forcetypeassert
│ │ ├── forcetypeassert.go
│ │ ├── forcetypeassert_integration_test.go
│ │ └── testdata
│ │ │ ├── forcetypeassert.go
│ │ │ └── forcetypeassert_cgo.go
│ ├── funcorder
│ │ ├── funcorder.go
│ │ ├── funcorder_integration_test.go
│ │ └── testdata
│ │ │ ├── funcorder.go
│ │ │ ├── funcorder_disable_constructor.go
│ │ │ ├── funcorder_disable_constructor.yml
│ │ │ ├── funcorder_struct_method.go
│ │ │ └── funcorder_struct_method.yml
│ ├── funlen
│ │ ├── funlen.go
│ │ ├── funlen_integration_test.go
│ │ └── testdata
│ │ │ ├── funlen.go
│ │ │ ├── funlen_cgo.go
│ │ │ ├── funlen_custom.go
│ │ │ ├── funlen_custom.yml
│ │ │ ├── funlen_ignore_comments.go
│ │ │ └── funlen_ignore_comments.yml
│ ├── gci
│ │ ├── gci.go
│ │ ├── gci_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── gci.go
│ │ │ └── out
│ │ │ │ └── gci.go
│ │ │ ├── gci.go
│ │ │ ├── gci.yml
│ │ │ ├── gci_cgo.go
│ │ │ ├── gci_go124.go
│ │ │ └── gci_go124.yml
│ ├── ginkgolinter
│ │ ├── ginkgolinter.go
│ │ ├── ginkgolinter_integration_test.go
│ │ └── testdata
│ │ │ ├── ginkgolinter.go
│ │ │ ├── ginkgolinter_allow_havelen0.yml
│ │ │ ├── ginkgolinter_cgo.go
│ │ │ ├── ginkgolinter_default.yml
│ │ │ ├── ginkgolinter_havelen0.go
│ │ │ ├── ginkgolinter_suppress_async.go
│ │ │ ├── ginkgolinter_suppress_async.yml
│ │ │ ├── ginkgolinter_suppress_compare.go
│ │ │ ├── ginkgolinter_suppress_compare.yml
│ │ │ ├── ginkgolinter_suppress_err.go
│ │ │ ├── ginkgolinter_suppress_err.yml
│ │ │ ├── ginkgolinter_suppress_focused_containers.go
│ │ │ ├── ginkgolinter_suppress_focused_containers.yml
│ │ │ ├── ginkgolinter_suppress_len.go
│ │ │ ├── ginkgolinter_suppress_len.yml
│ │ │ ├── ginkgolinter_suppress_nil.go
│ │ │ ├── ginkgolinter_suppress_nil.yml
│ │ │ ├── go.mod
│ │ │ └── go.sum
│ ├── gocheckcompilerdirectives
│ │ ├── gocheckcompilerdirectives.go
│ │ ├── gocheckcompilerdirectives_integration_test.go
│ │ └── testdata
│ │ │ ├── gocheckcompilerdirectives.go
│ │ │ └── gocheckcompilerdirectives_cgo.go
│ ├── gochecknoglobals
│ │ ├── gochecknoglobals.go
│ │ ├── gochecknoglobals_integration_test.go
│ │ └── testdata
│ │ │ ├── gochecknoglobals.go
│ │ │ └── gochecknoglobals_cgo.go
│ ├── gochecknoinits
│ │ ├── gochecknoinits.go
│ │ ├── gochecknoinits_integration_test.go
│ │ └── testdata
│ │ │ ├── gochecknoinits.go
│ │ │ └── gochecknoinits_cgo.go
│ ├── gochecksumtype
│ │ ├── gochecksumtype.go
│ │ ├── gochecksumtype_integration_test.go
│ │ └── testdata
│ │ │ ├── gochecksumtype.go
│ │ │ ├── gochecksumtype_cgo.go
│ │ │ ├── gochecksumtype_custom.go
│ │ │ └── gochecksumtype_custom.yml
│ ├── gocognit
│ │ ├── gocognit.go
│ │ ├── gocognit_integration_test.go
│ │ └── testdata
│ │ │ ├── gocognit.go
│ │ │ ├── gocognit.yml
│ │ │ └── gocognit_cgo.go
│ ├── goconst
│ │ ├── goconst.go
│ │ ├── goconst_integration_test.go
│ │ └── testdata
│ │ │ ├── goconst.go
│ │ │ ├── goconst_calls_enabled.go
│ │ │ ├── goconst_calls_enabled.yml
│ │ │ ├── goconst_cgo.go
│ │ │ ├── goconst_dont_ignore_test.go
│ │ │ ├── goconst_eval_and_find_duplicates.go
│ │ │ ├── goconst_eval_and_find_duplicates.yml
│ │ │ ├── goconst_eval_const_expressions.go
│ │ │ ├── goconst_eval_const_expressions.yml
│ │ │ ├── goconst_find_duplicates.go
│ │ │ └── goconst_find_duplicates.yml
│ ├── gocritic
│ │ ├── gocritic.go
│ │ ├── gocritic_integration_test.go
│ │ ├── gocritic_settings.go
│ │ ├── gocritic_settings_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── gocritic.go
│ │ │ └── out
│ │ │ │ └── gocritic.go
│ │ │ ├── gocritic-fix.yml
│ │ │ ├── gocritic.go
│ │ │ ├── gocritic.yml
│ │ │ ├── gocritic_cgo.go
│ │ │ ├── gocritic_importShadow.go
│ │ │ ├── gocritic_inportShadow.yml
│ │ │ └── ruleguard
│ │ │ ├── README.md
│ │ │ ├── preferWriteString.go
│ │ │ ├── rangeExprCopy.go
│ │ │ └── stringsSimplify.go
│ ├── gocyclo
│ │ ├── gocyclo.go
│ │ ├── gocyclo_integration_test.go
│ │ └── testdata
│ │ │ ├── gocyclo.go
│ │ │ ├── gocyclo.yml
│ │ │ └── gocyclo_cgo.go
│ ├── godot
│ │ ├── godot.go
│ │ ├── godot_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── godot.go
│ │ │ └── out
│ │ │ │ └── godot.go
│ │ │ ├── godot.go
│ │ │ └── godot_cgo.go
│ ├── godox
│ │ ├── godox.go
│ │ ├── godox_integration_test.go
│ │ └── testdata
│ │ │ ├── godox.go
│ │ │ ├── godox.yml
│ │ │ └── godox_cgo.go
│ ├── gofmt
│ │ ├── gofmt.go
│ │ ├── gofmt_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ ├── gofmt.go
│ │ │ │ └── gofmt_rewrite_rules.go
│ │ │ └── out
│ │ │ │ ├── gofmt.go
│ │ │ │ └── gofmt_rewrite_rules.go
│ │ │ ├── gofmt.go
│ │ │ ├── gofmt.yml
│ │ │ ├── gofmt_cgo.go
│ │ │ ├── gofmt_no_simplify.go
│ │ │ ├── gofmt_no_simplify.yml
│ │ │ ├── gofmt_rewrite_rules.go
│ │ │ ├── gofmt_rewrite_rules.yml
│ │ │ └── gofmt_too_many_empty_lines.go
│ ├── gofumpt
│ │ ├── gofumpt.go
│ │ ├── gofumpt_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ ├── gofumpt.go
│ │ │ │ └── gofumpt_cgo.go
│ │ │ └── out
│ │ │ │ ├── gofumpt.go
│ │ │ │ └── gofumpt_cgo.go
│ │ │ ├── gofumpt-fix.yml
│ │ │ ├── gofumpt.go
│ │ │ ├── gofumpt.yml
│ │ │ ├── gofumpt_cgo.go
│ │ │ ├── gofumpt_too_many_empty_lines.go
│ │ │ ├── gofumpt_with_extra.go
│ │ │ └── gofumpt_with_extra.yml
│ ├── goheader
│ │ ├── goheader.go
│ │ ├── goheader_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ ├── goheader_1.go
│ │ │ │ ├── goheader_2.go
│ │ │ │ ├── goheader_3.go
│ │ │ │ └── goheader_4.go
│ │ │ └── out
│ │ │ │ ├── goheader_1.go
│ │ │ │ ├── goheader_2.go
│ │ │ │ ├── goheader_3.go
│ │ │ │ └── goheader_4.go
│ │ │ ├── goheader-fix.yml
│ │ │ ├── goheader.yml
│ │ │ ├── goheader_bad.go
│ │ │ ├── goheader_cgo.go
│ │ │ └── goheader_good.go
│ ├── goimports
│ │ ├── goimports.go
│ │ ├── goimports_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ ├── goimports.go
│ │ │ │ └── goimports_cgo.go
│ │ │ └── out
│ │ │ │ ├── goimports.go
│ │ │ │ └── goimports_cgo.go
│ │ │ ├── goimports.go
│ │ │ ├── goimports.yml
│ │ │ ├── goimports_cgo.go
│ │ │ ├── goimports_local.go
│ │ │ └── goimports_local.yml
│ ├── golines
│ │ ├── golines.go
│ │ ├── golines_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ ├── golines-custom.go
│ │ │ │ └── golines.go
│ │ │ └── out
│ │ │ │ ├── golines-custom.go
│ │ │ │ └── golines.go
│ │ │ ├── golines-custom.yml
│ │ │ ├── golines.go
│ │ │ └── golines.yml
│ ├── gomoddirectives
│ │ └── gomoddirectives.go
│ ├── gomodguard
│ │ ├── gomodguard.go
│ │ ├── gomodguard_integration_test.go
│ │ └── testdata
│ │ │ ├── go.mod
│ │ │ ├── go.sum
│ │ │ ├── gomodguard.go
│ │ │ ├── gomodguard.yml
│ │ │ └── gomodguard_cgo.go
│ ├── goprintffuncname
│ │ ├── goprintffuncname.go
│ │ ├── goprintffuncname_integration_test.go
│ │ └── testdata
│ │ │ ├── goprintffuncname.go
│ │ │ └── goprintffuncname_cgo.go
│ ├── gosec
│ │ ├── gosec.go
│ │ ├── gosec_integration_test.go
│ │ ├── gosec_test.go
│ │ └── testdata
│ │ │ ├── gosec.go
│ │ │ ├── gosec.yml
│ │ │ ├── gosec_cgo.go
│ │ │ ├── gosec_global_option.go
│ │ │ ├── gosec_global_option.yml
│ │ │ ├── gosec_nosec.go
│ │ │ ├── gosec_nosec.yml
│ │ │ ├── gosec_rules_config.go
│ │ │ ├── gosec_severity_confidence.go
│ │ │ └── gosec_severity_confidence.yml
│ ├── gosmopolitan
│ │ ├── gosmopolitan.go
│ │ ├── gosmopolitan_integration_test.go
│ │ └── testdata
│ │ │ ├── gosmopolitan.go
│ │ │ ├── gosmopolitan_allow_time_local.go
│ │ │ ├── gosmopolitan_allow_time_local.yml
│ │ │ ├── gosmopolitan_cgo.go
│ │ │ ├── gosmopolitan_dont_ignore_test.go
│ │ │ ├── gosmopolitan_escape_hatches.go
│ │ │ ├── gosmopolitan_escape_hatches.yml
│ │ │ ├── gosmopolitan_scripts.go
│ │ │ └── gosmopolitan_scripts.yml
│ ├── govet
│ │ ├── govet.go
│ │ ├── govet_integration_test.go
│ │ ├── govet_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── govet.go
│ │ │ └── out
│ │ │ │ └── govet.go
│ │ │ ├── govet.go
│ │ │ ├── govet.yml
│ │ │ ├── govet_cgo.go
│ │ │ ├── govet_custom_formatter.go
│ │ │ ├── govet_fieldalignment.go
│ │ │ ├── govet_fieldalignment.yml
│ │ │ ├── govet_fix.yml
│ │ │ ├── govet_ifaceassert.go
│ │ │ └── govet_ifaceassert.yml
│ ├── grouper
│ │ ├── grouper.go
│ │ ├── grouper_integration_test.go
│ │ └── testdata
│ │ │ ├── grouper.go
│ │ │ ├── grouper.yml
│ │ │ └── grouper_cgo.go
│ ├── iface
│ │ ├── iface.go
│ │ ├── iface_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── iface.go
│ │ │ └── out
│ │ │ │ └── iface.go
│ │ │ ├── iface_all.go
│ │ │ ├── iface_all.yml
│ │ │ ├── iface_cgo.go
│ │ │ ├── iface_default.go
│ │ │ ├── iface_fix.yml
│ │ │ ├── iface_identical.go
│ │ │ ├── iface_identical.yml
│ │ │ ├── iface_opaque.go
│ │ │ ├── iface_opaque.yml
│ │ │ ├── iface_unexported.go
│ │ │ ├── iface_unexported.yml
│ │ │ ├── iface_unused.go
│ │ │ └── iface_unused.yml
│ ├── importas
│ │ ├── importas.go
│ │ ├── importas_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── importas.go
│ │ │ └── out
│ │ │ │ └── importas.go
│ │ │ ├── importas.go
│ │ │ ├── importas.yml
│ │ │ ├── importas_cgo.go
│ │ │ ├── importas_several_empty_aliases.go
│ │ │ ├── importas_several_empty_aliases.yml
│ │ │ ├── importas_strict.go
│ │ │ └── importas_strict.yml
│ ├── inamedparam
│ │ ├── inamedparam.go
│ │ ├── inamedparam_integration_test.go
│ │ └── testdata
│ │ │ ├── inamedparam.go
│ │ │ ├── inamedparam_cgo.go
│ │ │ ├── inamedparam_skip_single_param.go
│ │ │ └── inamedparam_skip_single_param.yml
│ ├── ineffassign
│ │ ├── ineffassign.go
│ │ ├── ineffassign_integration_test.go
│ │ └── testdata
│ │ │ ├── ineffassign.go
│ │ │ └── ineffassign_cgo.go
│ ├── interfacebloat
│ │ ├── interfacebloat.go
│ │ ├── interfacebloat_integration_test.go
│ │ └── testdata
│ │ │ ├── interfacebloat.go
│ │ │ └── interfacebloat_cgo.go
│ ├── internal
│ │ ├── commons.go
│ │ └── util.go
│ ├── intrange
│ │ ├── intrange.go
│ │ ├── intrange_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── intrange.go
│ │ │ └── out
│ │ │ │ └── intrange.go
│ │ │ ├── intrange.go
│ │ │ └── intrange_cgo.go
│ ├── ireturn
│ │ ├── ireturn.go
│ │ ├── ireturn_integration_test.go
│ │ └── testdata
│ │ │ ├── ireturn.go
│ │ │ ├── ireturn_allow.go
│ │ │ ├── ireturn_allow.yml
│ │ │ ├── ireturn_cgo.go
│ │ │ ├── ireturn_reject_generics.go
│ │ │ ├── ireturn_reject_generics.yml
│ │ │ ├── ireturn_reject_stdlib.go
│ │ │ └── ireturn_reject_stdlib.yml
│ ├── lll
│ │ ├── lll.go
│ │ ├── lll_integration_test.go
│ │ └── testdata
│ │ │ ├── lll.go
│ │ │ ├── lll.yml
│ │ │ ├── lll_cgo.go
│ │ │ ├── lll_import.yml
│ │ │ ├── lll_import_multi.go
│ │ │ ├── lll_import_single.go
│ │ │ ├── lll_max_scan_token_size.go
│ │ │ └── lll_max_scan_token_size_cgo.go
│ ├── loggercheck
│ │ ├── loggercheck.go
│ │ ├── loggercheck_integration_test.go
│ │ └── testdata
│ │ │ ├── go.mod
│ │ │ ├── go.sum
│ │ │ ├── loggercheck_cgo.go
│ │ │ ├── loggercheck_custom.go
│ │ │ ├── loggercheck_custom.yml
│ │ │ ├── loggercheck_default.go
│ │ │ ├── loggercheck_kitlogonly.go
│ │ │ ├── loggercheck_kitlogonly.yml
│ │ │ ├── loggercheck_logronly.go
│ │ │ ├── loggercheck_logronly.yml
│ │ │ ├── loggercheck_noprintflike.go
│ │ │ ├── loggercheck_noprintflike.yml
│ │ │ ├── loggercheck_requirestringkey.go
│ │ │ ├── loggercheck_requirestringkey.yml
│ │ │ ├── loggercheck_slogonly.go
│ │ │ ├── loggercheck_slogonly.yml
│ │ │ ├── loggercheck_zaponly.go
│ │ │ └── loggercheck_zaponly.yml
│ ├── maintidx
│ │ ├── maintidx.go
│ │ ├── maintidx_integration_test.go
│ │ └── testdata
│ │ │ ├── maintidx.go
│ │ │ ├── maintidx_cgo.go
│ │ │ ├── maintidx_under_100.go
│ │ │ └── maintidx_under_100.yml
│ ├── makezero
│ │ ├── makezero.go
│ │ ├── makezero_integration_test.go
│ │ └── testdata
│ │ │ ├── makezero.go
│ │ │ ├── makezero_always.go
│ │ │ ├── makezero_always.yml
│ │ │ └── makezero_cgo.go
│ ├── mirror
│ │ ├── mirror.go
│ │ ├── mirror_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── mirror.go
│ │ │ └── out
│ │ │ │ └── mirror.go
│ │ │ ├── mirror.go
│ │ │ └── mirror_cgo.go
│ ├── misspell
│ │ ├── misspell.go
│ │ ├── misspell_integration_test.go
│ │ ├── misspell_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── misspell.go
│ │ │ └── out
│ │ │ │ └── misspell.go
│ │ │ ├── misspell.go
│ │ │ ├── misspell.yml
│ │ │ ├── misspell_cgo.go
│ │ │ ├── misspell_custom.go
│ │ │ └── misspell_custom.yml
│ ├── mnd
│ │ ├── mnd.go
│ │ ├── mnd_integration_test.go
│ │ └── testdata
│ │ │ ├── mnd.go
│ │ │ ├── mnd_cgo.go
│ │ │ ├── mnd_custom.go
│ │ │ └── mnd_custom.yml
│ ├── musttag
│ │ ├── musttag.go
│ │ ├── musttag_integration_test.go
│ │ └── testdata
│ │ │ ├── musttag.go
│ │ │ ├── musttag.yml
│ │ │ ├── musttag_cgo.go
│ │ │ └── musttag_custom.go
│ ├── nakedret
│ │ ├── nakedret.go
│ │ ├── nakedret_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── nakedret.go
│ │ │ └── out
│ │ │ │ └── nakedret.go
│ │ │ ├── nakedret.go
│ │ │ └── nakedret_cgo.go
│ ├── nestif
│ │ ├── nestif.go
│ │ ├── nestif_integration_test.go
│ │ └── testdata
│ │ │ ├── nestif.go
│ │ │ ├── nestif.yml
│ │ │ └── nestif_cgo.go
│ ├── nilerr
│ │ ├── nilerr.go
│ │ ├── nilerr_integration_test.go
│ │ └── testdata
│ │ │ ├── nilerr.go
│ │ │ └── nilerr_cgo.go
│ ├── nilnesserr
│ │ ├── nilnesserr.go
│ │ ├── nilnesserr_integration_test.go
│ │ └── testdata
│ │ │ ├── nilnesserr.go
│ │ │ └── nilnesserr_cgo.go
│ ├── nilnil
│ │ ├── nilnil.go
│ │ ├── nilnil_integration_test.go
│ │ └── testdata
│ │ │ ├── nilnil.go
│ │ │ ├── nilnil_cgo.go
│ │ │ ├── nilnil_detect_opposite.go
│ │ │ ├── nilnil_detect_opposite.yml
│ │ │ ├── nilnil_multiple_nils.go
│ │ │ ├── nilnil_multiple_nils.yml
│ │ │ ├── nilnil_pointers_only.go
│ │ │ └── nilnil_pointers_only.yml
│ ├── nlreturn
│ │ ├── nlreturn.go
│ │ ├── nlreturn_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── nlreturn.go
│ │ │ └── out
│ │ │ │ └── nlreturn.go
│ │ │ ├── nlreturn-block-size.go
│ │ │ ├── nlreturn-block-size.yml
│ │ │ ├── nlreturn.go
│ │ │ └── nlreturn_cgo.go
│ ├── noctx
│ │ ├── noctx.go
│ │ ├── noctx_integration_test.go
│ │ └── testdata
│ │ │ ├── noctx.go
│ │ │ └── noctx_cgo.go
│ ├── noinlineerr
│ │ ├── noinlineerr.go
│ │ ├── noinlineerr_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── noinlineerr.go
│ │ │ └── out
│ │ │ │ └── noinlineerr.go
│ │ │ └── noinlineerr.go
│ ├── nolintlint
│ │ ├── internal
│ │ │ ├── README.md
│ │ │ ├── issues.go
│ │ │ ├── nolintlint.go
│ │ │ └── nolintlint_test.go
│ │ ├── nolintlint.go
│ │ ├── nolintlint_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── nolintlint.go
│ │ │ └── out
│ │ │ │ └── nolintlint.go
│ │ │ ├── nolintlint.go
│ │ │ ├── nolintlint.yml
│ │ │ ├── nolintlint_cgo.go
│ │ │ ├── nolintlint_unused.go
│ │ │ └── nolintlint_unused.yml
│ ├── nonamedreturns
│ │ ├── nonamedreturns.go
│ │ ├── nonamedreturns_integration_test.go
│ │ └── testdata
│ │ │ ├── nonamedreturns.go
│ │ │ ├── nonamedreturns_cgo.go
│ │ │ ├── nonamedreturns_custom.go
│ │ │ └── nonamedreturns_custom.yml
│ ├── nosprintfhostport
│ │ ├── nosprintfhostport.go
│ │ ├── nosprintfhostport_integration_test.go
│ │ └── testdata
│ │ │ ├── nosprintfhostport.go
│ │ │ └── nosprintfhostport_cgo.go
│ ├── paralleltest
│ │ ├── paralleltest.go
│ │ ├── paralleltest_integration_test.go
│ │ └── testdata
│ │ │ ├── paralleltest_custom_test.go
│ │ │ ├── paralleltest_custom_test.yml
│ │ │ └── paralleltest_test.go
│ ├── perfsprint
│ │ ├── perfsprint.go
│ │ ├── perfsprint_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── perfsprint.go
│ │ │ └── out
│ │ │ │ └── perfsprint.go
│ │ │ ├── perfsprint.go
│ │ │ ├── perfsprint_cgo.go
│ │ │ ├── perfsprint_custom.go
│ │ │ └── perfsprint_custom.yml
│ ├── prealloc
│ │ ├── prealloc.go
│ │ ├── prealloc_integration_test.go
│ │ └── testdata
│ │ │ ├── prealloc.go
│ │ │ └── prealloc_cgo.go
│ ├── predeclared
│ │ ├── predeclared.go
│ │ ├── predeclared_integration_test.go
│ │ └── testdata
│ │ │ ├── predeclared.go
│ │ │ ├── predeclared_cgo.go
│ │ │ ├── predeclared_custom.go
│ │ │ └── predeclared_custom.yml
│ ├── promlinter
│ │ ├── promlinter.go
│ │ ├── promlinter_integration_test.go
│ │ └── testdata
│ │ │ ├── promlinter.go
│ │ │ └── promlinter_cgo.go
│ ├── protogetter
│ │ ├── protogetter.go
│ │ ├── protogetter_integration_test.go
│ │ └── testdata
│ │ │ ├── go.mod
│ │ │ ├── go.sum
│ │ │ ├── proto
│ │ │ ├── test.go
│ │ │ ├── test.pb.go
│ │ │ ├── test.proto
│ │ │ └── test_grpc.pb.go
│ │ │ ├── protogetter.go
│ │ │ └── protogetter_cgo.go
│ ├── reassign
│ │ ├── reassign.go
│ │ ├── reassign_integration_test.go
│ │ └── testdata
│ │ │ ├── reassign.go
│ │ │ ├── reassign_cgo.go
│ │ │ ├── reassign_patterns.go
│ │ │ └── reassign_patterns.yml
│ ├── recvcheck
│ │ ├── recvcheck.go
│ │ ├── recvcheck_integration_test.go
│ │ └── testdata
│ │ │ ├── recvcheck.go
│ │ │ └── recvcheck_cgo.go
│ ├── revive
│ │ ├── revive.go
│ │ ├── revive_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── revive.go
│ │ │ └── out
│ │ │ │ └── revive.go
│ │ │ ├── revive-fix.yml
│ │ │ ├── revive.go
│ │ │ ├── revive.yml
│ │ │ ├── revive_cgo.go
│ │ │ └── revive_default.go
│ ├── rowserrcheck
│ │ ├── rowserrcheck.go
│ │ ├── rowserrcheck_integration_test.go
│ │ └── testdata
│ │ │ ├── rowserrcheck.go
│ │ │ └── rowserrcheck_cgo.go
│ ├── sloglint
│ │ ├── sloglint.go
│ │ ├── sloglint_integration_test.go
│ │ └── testdata
│ │ │ ├── sloglint.go
│ │ │ ├── sloglint_args_on_sep_lines.go
│ │ │ ├── sloglint_args_on_sep_lines.yml
│ │ │ ├── sloglint_attr_only.go
│ │ │ ├── sloglint_attr_only.yml
│ │ │ ├── sloglint_cgo.go
│ │ │ ├── sloglint_context_only.go
│ │ │ ├── sloglint_context_only.yml
│ │ │ ├── sloglint_forbidden_keys.go
│ │ │ ├── sloglint_forbidden_keys.yml
│ │ │ ├── sloglint_key_naming_case.go
│ │ │ ├── sloglint_key_naming_case.yml
│ │ │ ├── sloglint_kv_only.go
│ │ │ ├── sloglint_kv_only.yml
│ │ │ ├── sloglint_no_raw_keys.go
│ │ │ ├── sloglint_no_raw_keys.yml
│ │ │ ├── sloglint_static_msg.go
│ │ │ └── sloglint_static_msg.yml
│ ├── spancheck
│ │ ├── spancheck.go
│ │ ├── spancheck_integration_test.go
│ │ └── testdata
│ │ │ ├── go.mod
│ │ │ ├── go.sum
│ │ │ ├── spancheck.go
│ │ │ ├── spancheck_cgo.go
│ │ │ ├── spancheck_enable_all.go
│ │ │ ├── spancheck_enable_all.yml
│ │ │ ├── spancheck_keep_default.go
│ │ │ └── spancheck_keep_default.yml
│ ├── sqlclosecheck
│ │ ├── sqlclosecheck.go
│ │ ├── sqlclosecheck_integration_test.go
│ │ └── testdata
│ │ │ ├── sqlclosecheck.go
│ │ │ └── sqlclosecheck_cgo.go
│ ├── staticcheck
│ │ ├── staticcheck.go
│ │ ├── staticcheck_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ ├── gosimple.go
│ │ │ │ ├── staticcheck.go
│ │ │ │ └── stylecheck.go
│ │ │ └── out
│ │ │ │ ├── gosimple.go
│ │ │ │ ├── staticcheck.go
│ │ │ │ └── stylecheck.go
│ │ │ ├── gosimple.go
│ │ │ ├── gosimple.yml
│ │ │ ├── gosimple_cgo.go
│ │ │ ├── staticcheck.go
│ │ │ ├── staticcheck.yml
│ │ │ ├── staticcheck_cgo.go
│ │ │ ├── stylecheck.go
│ │ │ ├── stylecheck.yml
│ │ │ └── stylecheck_cgo.go
│ ├── swaggo
│ │ ├── swaggo.go
│ │ ├── swaggo_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── swaggo.go
│ │ │ └── out
│ │ │ │ └── swaggo.go
│ │ │ ├── swaggo.go
│ │ │ └── swaggo.yml
│ ├── tagalign
│ │ ├── tagalign.go
│ │ ├── tagalign_integration_test.go
│ │ └── testdata
│ │ │ ├── fix
│ │ │ ├── in
│ │ │ │ └── tagalign.go
│ │ │ └── out
│ │ │ │ └── tagalign.go
│ │ │ ├── tagalign.go
│ │ │ ├── tagalign_align_only.go
│ │ │ ├── tagalign_align_only.yml
│ │ │ ├── tagalign_cgo.go
│ │ │ ├── tagalign_order_only.go
│ │ │ ├── tagalign_order_only.yml
│ │ │ ├── tagalign_sort_only.go
│ │ │ ├── tagalign_sort_only.yml
│ │ │ ├── tagalign_strict.go
│ │ │ └── tagalign_strict.yml
│ ├── tagliatelle
│ │ ├── tagliatelle.go
│ │ ├── tagliatelle_integration_test.go
│ │ └── testdata
│ │ │ ├── tagliatelle.go
│ │ │ ├── tagliatelle_cgo.go
│ │ │ ├── tagliatelle_ignored_fields.go
│ │ │ └── tagliatelle_ignored_fields.yml
│ ├── testableexamples
│ │ ├── testableexamples.go
│ │ ├── testableexamples_integration_test.go
│ │ └── testdata
│ │ │ ├── testableexamples_test.go
│ │ │ └── testableexamples_test_cgo.go
│ ├── testifylint
│ │ ├── testdata
│ │ │ ├── fix
│ │ │ │ ├── in
│ │ │ │ │ └── testifylint.go
│ │ │ │ └── out
│ │ │ │ │ └── testifylint.go
│ │ │ ├── testifylint.go
│ │ │ ├── testifylint_bool_compare_only.go
│ │ │ ├── testifylint_bool_compare_only.yml
│ │ │ ├── testifylint_cgo.go
│ │ │ ├── testifylint_formatter_dont_require_string_msg.go
│ │ │ ├── testifylint_formatter_dont_require_string_msg.yml
│ │ │ ├── testifylint_formatter_only.go
│ │ │ ├── testifylint_formatter_only.yml
│ │ │ ├── testifylint_require_error_only.go
│ │ │ └── testifylint_require_error_only.yml
│ │ ├── testifylint.go
│ │ └── testifylint_integration_test.go
│ ├── testpackage
│ │ ├── testdata
│ │ │ └── testpackage_test.go
│ │ ├── testpackage.go
│ │ └── testpackage_integration_test.go
│ ├── thelper
│ │ ├── testdata
│ │ │ ├── thelper.go
│ │ │ ├── thelper.yml
│ │ │ ├── thelper_cgo.go
│ │ │ ├── thelper_fuzz.go
│ │ │ └── thelper_with_options.go
│ │ ├── thelper.go
│ │ └── thelper_integration_test.go
│ ├── tparallel
│ │ ├── testdata
│ │ │ ├── tparallel_cgo.go
│ │ │ ├── tparallel_happy_path_test.go
│ │ │ ├── tparallel_missing_subtest_test.go
│ │ │ └── tparallel_missing_toplevel_test.go
│ │ ├── tparallel.go
│ │ └── tparallel_integration_test.go
│ ├── typecheck.go
│ ├── unconvert
│ │ ├── testdata
│ │ │ ├── unconvert.go
│ │ │ └── unconvert_cgo.go
│ │ ├── unconvert.go
│ │ └── unconvert_integration_test.go
│ ├── unparam
│ │ ├── testdata
│ │ │ ├── unparam.go
│ │ │ └── unparam_cgo.go
│ │ ├── unparam.go
│ │ └── unparam_integration_test.go
│ ├── unused
│ │ ├── testdata
│ │ │ ├── unused.go
│ │ │ └── unused_cgo.go
│ │ ├── unused.go
│ │ └── unused_integration_test.go
│ ├── usestdlibvars
│ │ ├── testdata
│ │ │ ├── fix
│ │ │ │ ├── in
│ │ │ │ │ └── usestdlibvars.go
│ │ │ │ └── out
│ │ │ │ │ └── usestdlibvars.go
│ │ │ ├── usestdlibvars.go
│ │ │ ├── usestdlibvars_cgo.go
│ │ │ ├── usestdlibvars_non_default.go
│ │ │ └── usestdlibvars_non_default.yml
│ │ ├── usestdlibvars.go
│ │ └── usestdlibvars_integration_test.go
│ ├── usetesting
│ │ ├── testdata
│ │ │ ├── fix
│ │ │ │ ├── in
│ │ │ │ │ └── usetesting.go
│ │ │ │ └── out
│ │ │ │ │ └── usetesting.go
│ │ │ ├── usetesting.go
│ │ │ ├── usetesting_cgo.go
│ │ │ ├── usetesting_configuration.go
│ │ │ ├── usetesting_configuration.yml
│ │ │ ├── usetesting_go124.go
│ │ │ ├── usetesting_go124_configuration.go
│ │ │ └── usetesting_go124_configuration.yml
│ │ ├── usetesting.go
│ │ └── usetesting_integration_test.go
│ ├── varnamelen
│ │ ├── testdata
│ │ │ ├── varnamelen.go
│ │ │ └── varnamelen_cgo.go
│ │ ├── varnamelen.go
│ │ └── varnamelen_integration_test.go
│ ├── wastedassign
│ │ ├── testdata
│ │ │ ├── wastedassign.go
│ │ │ └── wastedassign_cgo.go
│ │ ├── wastedassign.go
│ │ └── wastedassign_integration_test.go
│ ├── whitespace
│ │ ├── testdata
│ │ │ ├── fix
│ │ │ │ ├── in
│ │ │ │ │ └── whitespace.go
│ │ │ │ └── out
│ │ │ │ │ └── whitespace.go
│ │ │ ├── whitespace-fix.yml
│ │ │ ├── whitespace.go
│ │ │ ├── whitespace.yml
│ │ │ └── whitespace_cgo.go
│ │ ├── whitespace.go
│ │ └── whitespace_integration_test.go
│ ├── wrapcheck
│ │ ├── testdata
│ │ │ ├── wrapcheck.go
│ │ │ └── wrapcheck_cgo.go
│ │ ├── wrapcheck.go
│ │ └── wrapcheck_integration_test.go
│ ├── wsl
│ │ ├── testdata
│ │ │ ├── fix
│ │ │ │ ├── in
│ │ │ │ │ └── wsl.go
│ │ │ │ └── out
│ │ │ │ │ └── wsl.go
│ │ │ ├── wsl.go
│ │ │ ├── wsl.yml
│ │ │ └── wsl_cgo.go
│ │ ├── wsl.go
│ │ └── wsl_integration_test.go
│ └── zerologlint
│ │ ├── testdata
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── zerologlint.go
│ │ └── zerologlint_cgo.go
│ │ ├── zerologlint.go
│ │ └── zerologlint_integration_test.go
├── goutil
│ ├── env.go
│ ├── version.go
│ └── version_test.go
├── lint
│ ├── context.go
│ ├── linter
│ │ ├── config.go
│ │ ├── context.go
│ │ └── linter.go
│ ├── lintersdb
│ │ ├── builder_linter.go
│ │ ├── builder_plugin_go.go
│ │ ├── builder_plugin_module.go
│ │ ├── manager.go
│ │ ├── manager_test.go
│ │ ├── validator.go
│ │ └── validator_test.go
│ ├── package.go
│ ├── package_test.go
│ └── runner.go
├── logutils
│ ├── log.go
│ ├── logutils.go
│ ├── mock.go
│ ├── out.go
│ └── stderr_log.go
├── printers
│ ├── checkstyle.go
│ ├── checkstyle_test.go
│ ├── codeclimate.go
│ ├── codeclimate_test.go
│ ├── html.go
│ ├── html_test.go
│ ├── json.go
│ ├── json_test.go
│ ├── junitxml.go
│ ├── junitxml_test.go
│ ├── printer.go
│ ├── printer_test.go
│ ├── sarif.go
│ ├── sarif_test.go
│ ├── tab.go
│ ├── tab_test.go
│ ├── teamcity.go
│ ├── teamcity_test.go
│ ├── testdata
│ │ ├── golden-json.json
│ │ ├── golden-line-number.txt
│ │ ├── golden-teamcity.txt
│ │ ├── in-issues.json
│ │ └── in-report-data.json
│ ├── text.go
│ └── text_test.go
├── report
│ ├── data.go
│ └── log.go
├── result
│ ├── issue.go
│ └── processors
│ │ ├── base_rule.go
│ │ ├── cgo.go
│ │ ├── diff.go
│ │ ├── exclusion_generated_file_filter.go
│ │ ├── exclusion_generated_file_filter_test.go
│ │ ├── exclusion_generated_file_matcher.go
│ │ ├── exclusion_generated_file_matcher_test.go
│ │ ├── exclusion_paths.go
│ │ ├── exclusion_paths_test.go
│ │ ├── exclusion_presets.go
│ │ ├── exclusion_rules.go
│ │ ├── exclusion_rules_test.go
│ │ ├── filename_unadjuster.go
│ │ ├── fixer.go
│ │ ├── invalid_issue.go
│ │ ├── invalid_issue_test.go
│ │ ├── issues.go
│ │ ├── max_from_linter.go
│ │ ├── max_from_linter_test.go
│ │ ├── max_per_file_from_linter.go
│ │ ├── max_per_file_from_linter_test.go
│ │ ├── max_same_issues.go
│ │ ├── max_same_issues_test.go
│ │ ├── nolint_filter.go
│ │ ├── nolint_filter_test.go
│ │ ├── path_absoluter.go
│ │ ├── path_prettifier.go
│ │ ├── path_prettifier_test.go
│ │ ├── path_relativity.go
│ │ ├── path_shortener.go
│ │ ├── processor.go
│ │ ├── processor_test.go
│ │ ├── severity.go
│ │ ├── severity_test.go
│ │ ├── sort_results.go
│ │ ├── sort_results_test.go
│ │ ├── source_code.go
│ │ ├── testdata
│ │ ├── exclusion_generated_file_filter
│ │ │ ├── exclude.go
│ │ │ ├── exclude_block_comment.go
│ │ │ ├── exclude_doc.go
│ │ │ ├── exclude_long_line.go
│ │ │ ├── go_strict.go
│ │ │ └── go_strict_invalid.go
│ │ ├── exclusion_rules
│ │ │ ├── case_sensitive.go
│ │ │ └── exclusion_rules.go
│ │ ├── nolint_filter
│ │ │ ├── apply_to_unknown.go
│ │ │ ├── bad_names.go
│ │ │ ├── nolint.go
│ │ │ ├── nolint2.go
│ │ │ ├── unused.go
│ │ │ └── whole_file.go
│ │ └── severity
│ │ │ ├── exclude_rules.go
│ │ │ └── severity_rules.go
│ │ ├── uniq_by_line.go
│ │ └── uniq_by_line_test.go
└── timeutils
│ └── stopwatch.go
├── scripts
├── bench
│ ├── bench_local.sh
│ ├── bench_version.sh
│ └── readme.md
├── gen_github_action_config
│ ├── go.mod
│ ├── go.sum
│ ├── main.go
│ ├── main_test.go
│ ├── testdata
│ │ ├── all-releases-v2.json
│ │ ├── all-releases.json
│ │ ├── github-action-config-v1.json
│ │ ├── github-action-config-v2.json
│ │ └── github-action-config.json
│ └── types.go
├── print_ast
│ └── main.go
└── website
│ ├── copy_jsonschema
│ └── main.go
│ ├── dump_info
│ └── main.go
│ ├── expand_templates
│ ├── .gitignore
│ ├── exclusions.go
│ ├── linters.go
│ ├── linters_test.go
│ ├── main.go
│ ├── plugins.go
│ ├── thanks.go
│ └── thanks_test.go
│ ├── github
│ └── github.go
│ └── types
│ └── types.go
├── test
├── bench
│ └── bench_test.go
├── configuration_file_test.go
├── enabled_linters_test.go
├── fix_test.go
├── linters_test.go
├── output_test.go
├── run_test.go
├── testdata
│ ├── autogenerated
│ │ ├── autogenerated.go
│ │ ├── do_not_edit.go
│ │ ├── go_bindata.go
│ │ ├── mockgen.go
│ │ └── protoc_gen_foo.go
│ ├── cgo
│ │ └── main.go
│ ├── cgo_with_issues
│ │ └── main.go
│ ├── configs
│ │ ├── custom_linter_goplugin.yml
│ │ ├── custom_linter_module.yml
│ │ ├── custom_linter_notype.yml
│ │ ├── default_exclude.yml
│ │ ├── multiple-issues-fix.yml
│ │ ├── output.yml
│ │ └── path-except.yml
│ ├── default_exclude.go
│ ├── fix
│ │ ├── in
│ │ │ └── multiple-issues-fix.go
│ │ └── out
│ │ │ └── multiple-issues-fix.go
│ ├── linedirective
│ │ ├── dupl.yml
│ │ ├── gomodguard.yml
│ │ ├── hello.go
│ │ ├── hello.tmpl
│ │ └── lll.yml
│ ├── minimalpkg
│ │ └── minimalpkg.go
│ ├── nogofiles
│ │ └── test.txt
│ ├── notcompiles
│ │ ├── typecheck.go
│ │ └── typecheck_many_issues.go
│ ├── output.go
│ ├── path_except.go
│ ├── path_except_test.go
│ ├── quicktemplate
│ │ ├── hello.qtpl
│ │ └── hello.qtpl.go
│ ├── sort_results
│ │ └── main.go
│ ├── symlink_loop
│ │ ├── pkg
│ │ │ └── subpkg
│ │ └── realpkg
│ │ │ └── p.go
│ ├── unsafe
│ │ └── pkg.go
│ ├── used_only_in_tests
│ │ ├── a.go
│ │ └── a_test.go
│ ├── withconfig
│ │ ├── .golangci.yml
│ │ └── pkg
│ │ │ └── pkg.go
│ ├── withtests
│ │ ├── p.go
│ │ └── p_test.go
│ └── withxtest
│ │ ├── p.go
│ │ └── p_test.go
├── testdata_etc
│ ├── abspath
│ │ └── with_issue.go
│ └── unused_exported
│ │ ├── golangci.yml
│ │ ├── lib
│ │ ├── bar_test.go
│ │ └── foo.go
│ │ └── main.go
└── testshared
│ ├── analysis.go
│ ├── analysis_test.go
│ ├── directives.go
│ ├── directives_test.go
│ ├── install.go
│ ├── integration
│ ├── fix.go
│ └── run.go
│ ├── runner.go
│ ├── runner_test.go
│ ├── runner_unix.go
│ ├── runner_windows.go
│ └── testdata
│ └── all.go
└── third_party
├── dogsled
└── LICENSE
├── gochecknoglobals
└── LICENSE
├── gochecknoinits
└── LICENSE
├── gometalinter
└── LICENSE
├── lll
└── LICENSE
├── nakedret
└── LICENSE
└── x_tools
└── LICENSE
/.gitattributes:
--------------------------------------------------------------------------------
1 | go.sum linguist-generated
2 | assets/* linguist-generated
3 | * text=auto eol=lf
4 | *.ps1 text eol=crlf
5 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | See [contributing quick start](https://golangci-lint.run/contributing/quick-start/) on our website.
2 |
--------------------------------------------------------------------------------
/.github/boring-cyborg.yml:
--------------------------------------------------------------------------------
1 | firstPRWelcomeComment: Hey, thank you for opening your first Pull Request !
2 |
3 | # Comment to be posted to on first time issues
4 | firstIssueWelcomeComment: >
5 | Hey, thank you for opening your first Issue ! 🙂
6 | If you would like to contribute we have a [guide for contributors](https://golangci-lint.run/contributing/quick-start/).
7 |
--------------------------------------------------------------------------------
/.github/peril/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 |
--------------------------------------------------------------------------------
/.github/peril/README.md:
--------------------------------------------------------------------------------
1 | Based on https://github.com/gatsbyjs/gatsby/tree/HEAD/peril.
2 |
3 | ## Update a code
4 |
5 | ```bash
6 | heroku ps:restart web --app golangci-peril
7 | heroku logs --app golangci-peril -t
8 | ```
9 |
--------------------------------------------------------------------------------
/.github/peril/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "esModuleInterop": false,
4 | "target": "es5",
5 | "module": "commonjs",
6 | "lib": ["es2017"],
7 | "strict": true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/assets/go.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangci/golangci-lint/c24d5d16f0ce4f571606f6aa5617ddccedbd99a6/assets/go.png
--------------------------------------------------------------------------------
/cmd/golangci-lint/plugins.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // This file is used to declare module plugins.
4 |
--------------------------------------------------------------------------------
/docs/gatsby-browser.js:
--------------------------------------------------------------------------------
1 | export { wrapRootElement } from "./src/@rocketseat/gatsby-theme-docs/gatsby/wrapRootElement";
2 | export { wrapPageElement } from "./src/@rocketseat/gatsby-theme-docs/gatsby/wrapPageElement";
3 |
--------------------------------------------------------------------------------
/docs/gatsby-ssr.js:
--------------------------------------------------------------------------------
1 | export { wrapRootElement } from "./src/@rocketseat/gatsby-theme-docs/gatsby/wrapRootElement";
2 | export { wrapPageElement } from "./src/@rocketseat/gatsby-theme-docs/gatsby/wrapPageElement";
3 |
--------------------------------------------------------------------------------
/docs/src/@rocketseat/gatsby-theme-docs-core/index.js:
--------------------------------------------------------------------------------
1 | export { useSidebar } from './src/hooks/useSidebar';
2 |
--------------------------------------------------------------------------------
/docs/src/@rocketseat/gatsby-theme-docs/src/components/Docs-wrapper.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable react/prop-types */
2 | import React from "react";
3 | import Docs from "./Docs";
4 |
5 | export default function Docspage({ data: { mdx }, pageContext }) {
6 | return ;
7 | }
8 |
--------------------------------------------------------------------------------
/docs/src/@rocketseat/gatsby-theme-docs/src/components/Homepage.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import Index from '../text/index.mdx';
3 |
4 | import Layout from './Layout';
5 | import SEO from './SEO';
6 |
7 | export default function Home() {
8 | return (
9 |
10 |
11 |
12 |
13 | );
14 | }
15 |
--------------------------------------------------------------------------------
/docs/src/@rocketseat/gatsby-theme-docs/src/styles/theme.js:
--------------------------------------------------------------------------------
1 | export default {
2 | colors: {
3 | primary: '#59c1ce',
4 | background: '#fff',
5 | sidebar: {
6 | background: '#ffffff',
7 | link: '#999',
8 | heading: '#aaa',
9 | linkActive: '#13131A',
10 | itemActive: '#F5F5FA',
11 | footer: '#A8A8B3',
12 | },
13 | },
14 | };
15 |
--------------------------------------------------------------------------------
/docs/src/@rocketseat/gatsby-theme-docs/src/templates/homepage-query.js:
--------------------------------------------------------------------------------
1 | import HomepageComponent from '../components/Homepage';
2 |
3 | export default HomepageComponent;
4 |
--------------------------------------------------------------------------------
/docs/src/@rocketseat/gatsby-theme-docs/src/util/url.js:
--------------------------------------------------------------------------------
1 | function isExternalUrl(url) {
2 | return new RegExp('^((https?:)?//)', 'i').test(url);
3 | }
4 |
5 | module.exports = { isExternalUrl };
6 |
--------------------------------------------------------------------------------
/docs/src/components/ResponsiveContainer.js:
--------------------------------------------------------------------------------
1 | /** @jsxRuntime classic */
2 | /** @jsx jsx */
3 | import { css, jsx } from "@emotion/react";
4 |
5 | const ResponsiveContainer = ({ children }) => (
6 |
12 | {children}
13 |
14 | );
15 |
16 | export default ResponsiveContainer;
17 |
--------------------------------------------------------------------------------
/docs/src/components/SearchBar/README.md:
--------------------------------------------------------------------------------
1 | The source code copy-pasted from [here](https://github.com/facebook/docusaurus/blob/HEAD/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/).
2 |
3 | Waiting for [the official component](https://github.com/algolia/docsearch/issues/689).
4 |
--------------------------------------------------------------------------------
/docs/src/config/site.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | configPath: `src/config`,
3 | docsPath: `src/docs`,
4 | githubUrl: `https://github.com/golangci/golangci-lint`,
5 | baseDir: `docs`,
6 | };
7 |
--------------------------------------------------------------------------------
/docs/src/docs/product/changelog.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Changelog
3 | ---
4 |
5 | ## Changelog
6 |
7 | {.ChangeLog}
8 |
--------------------------------------------------------------------------------
/docs/src/docs/usage/formatters.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Formatters
3 | ---
4 |
5 | import { FaGithub, FaGitlab, FaArrowUp, FaCog } from "react-icons/fa";
6 |
7 | To see a list of supported formatters and which formatters are enabled/disabled:
8 |
9 | ```bash
10 | golangci-lint help formatters
11 | ```
12 |
13 | ## All Formatters
14 |
15 | {.Formatters}
16 |
17 | ## Formatters Configuration
18 |
19 | { .FormattersExample }
20 |
--------------------------------------------------------------------------------
/docs/src/docs/welcome/annotations.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangci/golangci-lint/c24d5d16f0ce4f571606f6aa5617ddccedbd99a6/docs/src/docs/welcome/annotations.png
--------------------------------------------------------------------------------
/docs/src/docs/welcome/colored-line-number.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangci/golangci-lint/c24d5d16f0ce4f571606f6aa5617ddccedbd99a6/docs/src/docs/welcome/colored-line-number.png
--------------------------------------------------------------------------------
/docs/src/lib/icons.js:
--------------------------------------------------------------------------------
1 | /** @jsxRuntime classic */
2 | /** @jsx jsx */
3 | import { css, jsx } from "@emotion/react";
4 |
5 | export const IconContainer = ({ color, children }) => (
6 |
15 | {children}
16 |
17 | );
18 |
--------------------------------------------------------------------------------
/docs/static/CNAME:
--------------------------------------------------------------------------------
1 | golangci-lint.run
2 |
--------------------------------------------------------------------------------
/docs/static/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangci/golangci-lint/c24d5d16f0ce4f571606f6aa5617ddccedbd99a6/docs/static/banner.png
--------------------------------------------------------------------------------
/docs/static/demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangci/golangci-lint/c24d5d16f0ce4f571606f6aa5617ddccedbd99a6/docs/static/demo.gif
--------------------------------------------------------------------------------
/docs/static/logo-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangci/golangci-lint/c24d5d16f0ce4f571606f6aa5617ddccedbd99a6/docs/static/logo-400.png
--------------------------------------------------------------------------------
/docs/static/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangci/golangci-lint/c24d5d16f0ce4f571606f6aa5617ddccedbd99a6/docs/static/logo.png
--------------------------------------------------------------------------------
/internal/cache/testdata/hello.go:
--------------------------------------------------------------------------------
1 | package testdata
2 |
3 | import "fmt"
4 |
5 | func Hello() {
6 | fmt.Println("hello world")
7 | }
8 |
--------------------------------------------------------------------------------
/internal/go/base/error_notunix.go:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build !unix
6 |
7 | package base
8 |
9 | func IsETXTBSY(err error) bool {
10 | // syscall.ETXTBSY is only meaningful on Unix platforms.
11 | return false
12 | }
13 |
--------------------------------------------------------------------------------
/internal/go/base/error_unix.go:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build unix
6 |
7 | package base
8 |
9 | import (
10 | "errors"
11 | "syscall"
12 | )
13 |
14 | func IsETXTBSY(err error) bool {
15 | return errors.Is(err, syscall.ETXTBSY)
16 | }
17 |
--------------------------------------------------------------------------------
/internal/go/base/readme.md:
--------------------------------------------------------------------------------
1 | # quoted
2 |
3 | Extracted from `go/src/cmd/go/internal/base/` (related to `cache`).
4 |
5 | Only the function `IsETXTBSY` is extracted.
6 |
7 | ## History
8 |
9 | - https://github.com/golangci/golangci-lint/pull/5576
10 | - sync go1.24.1
11 |
--------------------------------------------------------------------------------
/internal/go/cache/cache_gcil.go:
--------------------------------------------------------------------------------
1 | package cache
2 |
3 | import (
4 | "errors"
5 | )
6 |
7 | // IsErrMissing allows to access to the internal error.
8 | // TODO(ldez) the handling of this error inside runner_action.go should be refactored.
9 | func IsErrMissing(err error) bool {
10 | var errENF *entryNotFoundError
11 | return errors.As(err, &errENF)
12 | }
13 |
--------------------------------------------------------------------------------
/internal/go/cache/default_gcil.go:
--------------------------------------------------------------------------------
1 | package cache
2 |
3 | const (
4 | envGolangciLintCache = "GOLANGCI_LINT_CACHE"
5 | envGolangciLintCacheProg = "GOLANGCI_LINT_CACHEPROG"
6 | )
7 |
--------------------------------------------------------------------------------
/internal/go/cache/hash_gcil.go:
--------------------------------------------------------------------------------
1 | package cache
2 |
3 | func SetSalt(b []byte) {
4 | hashSalt = b
5 | }
6 |
--------------------------------------------------------------------------------
/internal/go/cacheprog/readme.md:
--------------------------------------------------------------------------------
1 | # quoted
2 |
3 | Extracted from `go/src/cmd/go/internal/cacheprog/` (related to `cache`).
4 | This is just a copy of the Go code without any changes.
5 |
6 | ## History
7 |
8 | - https://github.com/golangci/golangci-lint/pull/5576
9 | - sync go1.24.1
10 |
--------------------------------------------------------------------------------
/internal/x/tools/analysisflags/readme.md:
--------------------------------------------------------------------------------
1 | # analysisflags
2 |
3 | Extracted from `/go/analysis/internal/analysisflags` (related to `checker`).
4 | This is just a copy of the code without any changes.
5 |
6 | ## History
7 |
8 | - sync with https://github.com/golang/tools/blob/v0.28.0
9 |
--------------------------------------------------------------------------------
/internal/x/tools/analysisinternal/readme.md:
--------------------------------------------------------------------------------
1 | # analysisinternal
2 |
3 | Extracted from `/internal/analysisinternal/` (related to `checker`).
4 | This is just a copy of the code without any changes.
5 |
6 | ## History
7 |
8 | - sync with https://github.com/golang/tools/blob/v0.28.0
9 |
--------------------------------------------------------------------------------
/internal/x/tools/diff/readme.md:
--------------------------------------------------------------------------------
1 | # diff
2 |
3 | Extracted from `/internal/diff/` (related to `fixer`).
4 | This is just a copy of the code without any changes.
5 |
6 | ## History
7 |
8 | - sync with https://github.com/golang/tools/blob/v0.28.0
9 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/ptr/ptr.go:
--------------------------------------------------------------------------------
1 | package ptr
2 |
3 | func Deref[T any](v *T) T {
4 | if v == nil {
5 | var zero T
6 | return zero
7 | }
8 |
9 | return *v
10 | }
11 |
12 | func Pointer[T any](v T) *T { return &v }
13 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/json/empty.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangci/golangci-lint/c24d5d16f0ce4f571606f6aa5617ddccedbd99a6/pkg/commands/internal/migrate/testdata/json/empty.json
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/toml/empty.toml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangci/golangci-lint/c24d5d16f0ce4f571606f6aa5617ddccedbd99a6/pkg/commands/internal/migrate/testdata/toml/empty.toml
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/empty.yml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangci/golangci-lint/c24d5d16f0ce4f571606f6aa5617ddccedbd99a6/pkg/commands/internal/migrate/testdata/yaml/empty.yml
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_01_a.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | exclusions:
4 | paths:
5 | - .*\.my\.go$
6 | - lib/bad.go
7 | - src/external_libs
8 | - autogenerated_by_my_lib
9 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_02_a.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | exclusions:
4 | rules:
5 | - path: (.+)\.go$
6 | text: abcdef
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_02_b.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | exclusions:
4 | rules:
5 | - path: (.+)\.go$
6 | text: (?i)abcdef
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_04_c.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_05_a.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_05_a.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-dirs-use-default: false
6 |
7 | exclude-generated: strict
8 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_05_b.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | exclusions:
4 | generated: disable
5 | formatters:
6 | exclusions:
7 | generated: disable
8 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_05_b.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-dirs-use-default: false
6 |
7 | exclude-generated: disable
8 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_05_c.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | exclusions:
4 | generated: lax
5 | formatters:
6 | exclusions:
7 | generated: lax
8 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_05_c.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-dirs-use-default: false
6 |
7 | exclude-generated: lax
8 |
9 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_a.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_a.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-generated: strict
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-dirs-use-default: false
6 |
7 | exclude-use-default: false
8 |
9 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_b.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | exclusions:
4 | presets:
5 | - comments
6 | - common-false-positives
7 | - legacy
8 | - std-error-handling
9 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_b.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-generated: strict
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-dirs-use-default: false
6 |
7 | exclude-use-default: true
8 |
9 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_c.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_d.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | exclusions:
4 | presets:
5 | - common-false-positives
6 | - legacy
7 | - std-error-handling
8 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_d.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-generated: strict
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-dirs-use-default: false
6 |
7 | exclude-use-default: true
8 | # Related to comments
9 | include:
10 | - EXC0014
11 | - EXC0015
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_e.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | exclusions:
4 | presets:
5 | - comments
6 | - common-false-positives
7 | - std-error-handling
8 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_e.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-generated: strict
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-dirs-use-default: false
6 |
7 | exclude-use-default: true
8 | # Related to legacy
9 | include:
10 | - EXC0005
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_f.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | exclusions:
4 | presets:
5 | - comments
6 | - common-false-positives
7 | - legacy
8 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_f.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-generated: strict
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-dirs-use-default: false
6 |
7 | exclude-use-default: true
8 | # Related to std-error-handling
9 | include:
10 | - EXC0001
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_g.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | exclusions:
4 | presets:
5 | - comments
6 | - legacy
7 | - std-error-handling
8 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_g.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-generated: strict
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-dirs-use-default: false
6 |
7 | exclude-use-default: true
8 | # Related to common-false-positives
9 | include:
10 | - EXC0006
11 | - EXC0007
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_h.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | exclusions:
4 | presets:
5 | - comments
6 | - common-false-positives
7 | - legacy
8 | - std-error-handling
9 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_06_h.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-generated: strict
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-dirs-use-default: false
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_07_a.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | exclusions:
4 | paths:
5 | - third_party$
6 | - builtin$
7 | - examples$
8 | formatters:
9 | exclusions:
10 | paths:
11 | - third_party$
12 | - builtin$
13 | - examples$
14 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_07_a.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 |
7 | exclude-dirs-use-default: true
8 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_07_b.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | default: none
4 | exclusions:
5 | paths:
6 | - third_party$
7 | - builtin$
8 | - examples$
9 | formatters:
10 | enable:
11 | - goimports
12 | exclusions:
13 | paths:
14 | - third_party$
15 | - builtin$
16 | - examples$
17 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_07_b.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 |
7 | exclude-dirs-use-default: true
8 |
9 | linters:
10 | disable-all: true
11 | enable:
12 | - goimports
13 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_08_a.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | issues:
3 | max-issues-per-linter: 0
4 | max-same-issues: 0
5 | uniq-by-line: true
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_08_b.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | issues:
3 | max-issues-per-linter: 66
4 | uniq-by-line: false
5 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_08_b.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | max-issues-per-linter: 66
10 | uniq-by-line: false
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_09_a.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | issues:
3 | new-from-rev: HEAD
4 | new-from-merge-base: main
5 | new-from-patch: path/to/patch/file
6 | whole-files: true
7 | new: true
8 | fix: true
9 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_09_b.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | issues:
3 | new-from-rev: ""
4 | new-from-merge-base: ""
5 | new-from-patch: ""
6 | whole-files: false
7 | new: false
8 | fix: false
9 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/issues_10.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | default: none
4 | formatters:
5 | enable:
6 | - goimports
7 | exclusions:
8 | paths:
9 | - \.(generated\.deepcopy|pb)\.go$
10 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_asasalint.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | asasalint:
5 | exclude:
6 | - Append
7 | - \.Wrapf
8 | use-builtin-exclusions: false
9 | exclusions:
10 | rules:
11 | - linters:
12 | - asasalint
13 | path: (.+)_test\.go
14 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_copyloopvar.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | copyloopvar:
5 | check-alias: true
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_custom.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | custom:
5 | example:
6 | type: module
7 | path: /path/to/example.so
8 | description: This is an example usage of a plugin linter.
9 | original-url: github.com/golangci/example-linter
10 | settings:
11 | foo: bar
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_cyclop.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | cyclop:
5 | max-complexity: 10
6 | package-average: 0.5
7 | exclusions:
8 | rules:
9 | - linters:
10 | - cyclop
11 | path: (.+)_test\.go
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_dogsled.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | dogsled:
5 | max-blank-identifiers: 3
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_dupl.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | dupl:
5 | threshold: 100
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_dupword.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | dupword:
5 | keywords:
6 | - the
7 | - and
8 | - a
9 | ignore:
10 | - 0C0C
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_errcheck.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | errcheck:
5 | disable-default-exclusions: true
6 | check-type-assertions: true
7 | check-blank: true
8 | exclude-functions:
9 | - io/ioutil.ReadFile
10 | - io.Copy(*bytes.Buffer)
11 | - io.Copy(os.Stdout)
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_errchkjson.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | errchkjson:
5 | check-error-free-encoding: true
6 | report-no-exported: false
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_exhaustruct.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | exhaustruct:
5 | include:
6 | - .+\.Test
7 | - example\.com/package\.ExampleStruct[\d]{1,2}
8 | exclude:
9 | - .+/cobra\.Command$
10 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_fatcontext.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | fatcontext:
5 | check-struct-pointers: true
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_funlen.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | funlen:
5 | lines: -1
6 | statements: -1
7 | ignore-comments: true
8 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_gochecksumtype.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | gochecksumtype:
5 | default-signifies-exhaustive: false
6 | include-shared-interfaces: true
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_gocognit.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | gocognit:
5 | min-complexity: 10
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_gocyclo.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | gocyclo:
5 | min-complexity: 10
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_godot.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | godot:
5 | scope: toplevel
6 | exclude:
7 | - '^fixme:'
8 | - '^todo:'
9 | capital: true
10 | period: false
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_godox.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | godox:
5 | keywords:
6 | - NOTE
7 | - OPTIMIZE
8 | - HACK
9 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_gofmt.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | formatters:
3 | settings:
4 | gofmt:
5 | simplify: false
6 | rewrite-rules:
7 | - pattern: interface{}
8 | replacement: any
9 | - pattern: a[b:len(a)]
10 | replacement: a[b:]
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_gofumpt.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | formatters:
3 | settings:
4 | gofumpt:
5 | module-path: github.com/org/project
6 | extra-rules: true
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_goimports.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | formatters:
3 | settings:
4 | goimports:
5 | local-prefixes:
6 | - github.com/org/project
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_iface.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | iface:
5 | enable:
6 | - identical
7 | - unused
8 | - opaque
9 | settings:
10 | unused:
11 | exclude:
12 | - github.com/example/log
13 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_inamedparam.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | inamedparam:
5 | skip-single-param: true
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_interfacebloat.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | interfacebloat:
5 | max: 5
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_ireturn.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | ireturn:
5 | allow:
6 | - anon
7 | - (or|er)$
8 | reject:
9 | - github.com\/user\/package\/v4\.Type
10 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_lll.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | lll:
5 | line-length: 120
6 | tab-width: 1
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_maintidx.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | maintidx:
5 | under: 100
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_makezero.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | makezero:
5 | always: true
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_misspell.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | misspell:
5 | mode: restricted
6 | locale: US
7 | extra-words:
8 | - typo: iff
9 | correction: if
10 | - typo: cancelation
11 | correction: cancellation
12 | ignore-rules:
13 | - someword
14 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_musttag.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | musttag:
5 | functions:
6 | - name: github.com/hashicorp/hcl/v2/hclsimple.DecodeFile
7 | tag: hcl
8 | arg-pos: 2
9 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_nakedret.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | nakedret:
5 | max-func-lines: 31
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_nakedret_zero.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | nakedret:
6 | max-func-lines: 0
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_nestif.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | nestif:
5 | min-complexity: 4
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_nilnil.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | nilnil:
5 | detect-opposite: true
6 | checked-types:
7 | - chan
8 | - func
9 | - iface
10 | - map
11 | - ptr
12 | - uintptr
13 | - unsafeptr
14 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_nlreturn.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | nlreturn:
5 | block-size: 2
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_nolintlint.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | nolintlint:
5 | require-explanation: true
6 | require-specific: true
7 | allow-unused: true
8 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_nonamedreturns.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | nonamedreturns:
5 | report-error-in-defer: true
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_paralleltest.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | paralleltest:
5 | ignore-missing: true
6 | ignore-missing-subtests: true
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_prealloc.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | prealloc:
5 | simple: false
6 | range-loops: false
7 | for-loops: true
8 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_predeclared.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | predeclared:
5 | ignore:
6 | - new
7 | - int
8 | qualified-name: true
9 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_promlinter.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | promlinter:
5 | strict: true
6 | disabled-linters:
7 | - Help
8 | - MetricUnits
9 | - Counter
10 | - HistogramSummaryReserved
11 | - MetricTypeInName
12 | - ReservedChars
13 | - CamelCase
14 | - UnitAbbreviations
15 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_protogetter.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | protogetter:
5 | skip-generated-by:
6 | - protoc-gen-go-my-own-generator
7 | skip-files:
8 | - '*.pb.go'
9 | - '*/vendor/*'
10 | - /full/path/to/file.go
11 | skip-any-generated: true
12 | replace-first-arg-in-append: true
13 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_reassign.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | reassign:
5 | patterns:
6 | - .*
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_recvcheck.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | recvcheck:
5 | disable-builtin: true
6 | exclusions:
7 | - '*.Value'
8 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_rowserrcheck.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | rowserrcheck:
5 | packages:
6 | - github.com/jmoiron/sqlx
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_spancheck.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | spancheck:
5 | checks:
6 | - end
7 | - record-error
8 | - set-status
9 | ignore-check-signatures:
10 | - telemetry.RecordError
11 | extra-start-span-signatures:
12 | - github.com/user/repo/telemetry/trace.Start:opentelemetry
13 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_tagalign.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | tagalign:
5 | align: false
6 | sort: false
7 | order:
8 | - json
9 | - yaml
10 | - yml
11 | - toml
12 | - mapstructure
13 | - binding
14 | - validate
15 | strict: true
16 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_testpackage.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | testpackage:
5 | skip-regexp: (export|internal)_test\.go
6 | allow-packages:
7 | - example
8 | - main
9 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_unconvert.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | unconvert:
5 | fast-math: true
6 | safe: true
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_unparam.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | unparam:
5 | check-exported: true
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_unused.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | unused:
5 | field-writes-are-uses: false
6 | post-statements-are-reads: true
7 | exported-fields-are-used: false
8 | parameters-are-used: false
9 | local-variables-are-used: false
10 | generated-is-used: false
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_usetesting.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | usetesting:
5 | context-background: false
6 | context-todo: false
7 | os-chdir: false
8 | os-mkdir-temp: false
9 | os-setenv: false
10 | os-temp-dir: true
11 | os-create-temp: false
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters-settings_whitespace.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | settings:
4 | whitespace:
5 | multi-if: true
6 | multi-func: true
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters_10.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | enable:
4 | - depguard
5 | - gomoddirectives
6 | - gomodguard
7 | disable:
8 | - errcheck
9 | - govet
10 | - staticcheck
11 | - unused
12 | formatters:
13 | enable:
14 | - gci
15 | - gofmt
16 | - gofumpt
17 | - goimports
18 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters_11.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | default: all
4 | formatters:
5 | enable:
6 | - gofmt
7 | - gofumpt
8 | - goimports
9 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters_12.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | default: none
4 | enable:
5 | - govet
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters_13_a.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters_13_b.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | default: all
4 | formatters:
5 | enable:
6 | - gci
7 | - gofmt
8 | - gofumpt
9 | - goimports
10 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters_13_c.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters_13_c.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | linters:
10 | disable:
11 | - stylecheck
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/linters_13_d.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | linters:
3 | disable:
4 | - staticcheck
5 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_01_g.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | output:
3 | formats:
4 | text:
5 | path: stdout
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_01_h.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | output:
3 | formats:
4 | text:
5 | path: stdout
6 | colors: false
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_01_h.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | output:
10 | formats:
11 | - format: line-number
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_01_i.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | output:
3 | formats:
4 | text:
5 | path: stdout
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_01_j.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | output:
3 | formats:
4 | tab:
5 | path: stdout
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_01_k.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | output:
3 | formats:
4 | tab:
5 | path: stdout
6 | colors: false
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_01_k.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | output:
10 | formats:
11 | - format: tab
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_01_l.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | output:
3 | formats:
4 | tab:
5 | path: stdout
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_01_l.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | output:
10 | formats:
11 | - format: colored-tab
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_01_m.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | output:
3 | formats:
4 | junit-xml:
5 | path: stdout
6 | extended: true
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_01_o.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | output:
3 | formats:
4 | junit-xml:
5 | path: stdout
6 | extended: true
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_01_p.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | output:
3 | formats:
4 | junit-xml:
5 | path: stdout
6 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_01_p.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | output:
10 | formats:
11 | - format: junit-xml
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_02.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_03.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | output:
3 | sort-order:
4 | - linter
5 | - severity
6 | - file
7 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_04.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | output:
3 | path-prefix: foo
4 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/output_04.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | output:
10 | path-prefix: "foo"
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_01.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_01.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | run:
10 | timeout: 5m
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_02_a.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_02_a.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | run:
10 | relative-path-mode: cfg
11 |
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_02_b.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | run:
3 | relative-path-mode: gomod
4 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_02_b.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | run:
10 | relative-path-mode: gomod
11 |
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_03_a.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | run:
3 | issues-exit-code: 2
4 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_03_a.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | run:
10 | issues-exit-code: 2
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_03_b.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | run:
3 | issues-exit-code: 0
4 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_03_b.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | run:
10 | issues-exit-code: 0
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_04_a.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | run:
3 | tests: false
4 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_04_a.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | run:
10 | tests: false
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_04_b.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | run:
3 | tests: true
4 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_04_b.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | run:
10 | tests: true
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_05.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | run:
3 | build-tags:
4 | - mytag
5 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_05.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | run:
10 | build-tags:
11 | - mytag
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_06.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | run:
3 | modules-download-mode: readonly
4 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_06.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | run:
10 | modules-download-mode: readonly
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_07.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | run:
3 | allow-parallel-runners: true
4 | allow-serial-runners: true
5 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_08.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | run:
3 | go: "1.19"
4 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_08.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | run:
10 | go: '1.19'
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_09_a.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | run:
3 | concurrency: 4
4 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_09_a.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | run:
10 | concurrency: 4
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_09_b.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_09_b.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | run:
10 | concurrency: 0
11 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/run_10.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | run:
3 | concurrency: 4
4 | go: "1.19"
5 | relative-path-mode: gomod
6 | build-tags:
7 | - mytag
8 | modules-download-mode: readonly
9 | issues-exit-code: 2
10 | tests: false
11 | allow-parallel-runners: true
12 | allow-serial-runners: true
13 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/severity_01.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | severity:
3 | default: error
4 | rules:
5 | - linters:
6 | - dupl
7 | severity: info
8 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/severity_02.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | severity:
3 | default: error
4 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/severity_02.yml:
--------------------------------------------------------------------------------
1 | issues:
2 | # Only to not generate unrelated elements inside golden.
3 | exclude-use-default: false
4 | # Only to not generate unrelated elements inside golden.
5 | exclude-generated: strict
6 | # Only to not generate unrelated elements inside golden.
7 | exclude-dirs-use-default: false
8 |
9 | severity:
10 | default-severity: error
11 |
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/severity_03.golden.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/testdata/yaml/unknown-fields.yml:
--------------------------------------------------------------------------------
1 | foo:
2 | bar: a
3 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/versionone/base_rule.go:
--------------------------------------------------------------------------------
1 | package versionone
2 |
3 | type BaseRule struct {
4 | Linters []string `mapstructure:"linters"`
5 | Path *string `mapstructure:"path"`
6 | PathExcept *string `mapstructure:"path-except"`
7 | Text *string `mapstructure:"text"`
8 | Source *string `mapstructure:"source"`
9 | }
10 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/versionone/doc.go:
--------------------------------------------------------------------------------
1 | // Package versionone contains a modified copy of v1 configuration.
2 | // The structures are altered to use pointer on builtin types.
3 | // The field version is added to enforce the detection of already migrated file.
4 | package versionone
5 |
--------------------------------------------------------------------------------
/pkg/commands/internal/migrate/versionone/linters.go:
--------------------------------------------------------------------------------
1 | package versionone
2 |
3 | type Linters struct {
4 | Enable []string `mapstructure:"enable"`
5 | Disable []string `mapstructure:"disable"`
6 | EnableAll *bool `mapstructure:"enable-all"`
7 | DisableAll *bool `mapstructure:"disable-all"`
8 | Fast *bool `mapstructure:"fast"`
9 |
10 | Presets []string `mapstructure:"presets"`
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/commands/internal/testdata/imports.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | _ "example.com/foo/bar/test"
5 | _ "example.org/foo/bar/test"
6 | )
7 |
--------------------------------------------------------------------------------
/pkg/fsutils/fsutils_unix.go:
--------------------------------------------------------------------------------
1 | //go:build !windows
2 |
3 | package fsutils
4 |
5 | import "path/filepath"
6 |
7 | func evalSymlinks(path string) (string, error) {
8 | return filepath.EvalSymlinks(path)
9 | }
10 |
--------------------------------------------------------------------------------
/pkg/fsutils/path_unix.go:
--------------------------------------------------------------------------------
1 | //go:build !windows
2 |
3 | package fsutils
4 |
5 | // NormalizePathInRegex it's a noop function on Unix.
6 | func NormalizePathInRegex(path string) string {
7 | return path
8 | }
9 |
--------------------------------------------------------------------------------
/pkg/goformatters/formatters.go:
--------------------------------------------------------------------------------
1 | package goformatters
2 |
3 | type Formatter interface {
4 | Name() string
5 | Format(filename string, src []byte) ([]byte, error)
6 | }
7 |
--------------------------------------------------------------------------------
/pkg/goformatters/gci/internal/readme.md:
--------------------------------------------------------------------------------
1 | Code borrowed from gci and modified to use new std packages.
2 |
3 | https://github.com/daixiang0/gci/pull/227
4 |
--------------------------------------------------------------------------------
/pkg/goformatters/gci/internal/section/section.go:
--------------------------------------------------------------------------------
1 | package section
2 |
3 | import "github.com/daixiang0/gci/pkg/section"
4 |
5 | func DefaultSections() section.SectionList {
6 | return section.SectionList{Standard{}, section.Default{}}
7 | }
8 |
--------------------------------------------------------------------------------
/pkg/goformatters/internal/commons.go:
--------------------------------------------------------------------------------
1 | package internal
2 |
3 | import "github.com/golangci/golangci-lint/v2/pkg/logutils"
4 |
5 | // FormatterLogger must be used only when the context logger is not available.
6 | var FormatterLogger = logutils.NewStderrLog(logutils.DebugKeyFormatter)
7 |
--------------------------------------------------------------------------------
/pkg/goformatters/internal/testdata/add_only.diff:
--------------------------------------------------------------------------------
1 | diff --git a/internal/shared/logutil/log.go b/internal/shared/logutil/log.go
2 | index 258b340..43d04bf 100644
3 | --- a/internal/shared/logutil/log.go
4 | +++ b/internal/shared/logutil/log.go
5 | @@ -1,5 +1,6 @@
6 | package logutil
7 |
8 | +// added line
9 | type Func func(format string, args ...interface{})
10 |
11 | type Log interface {
12 |
--------------------------------------------------------------------------------
/pkg/goformatters/internal/testdata/add_only_in_all_diff.diff:
--------------------------------------------------------------------------------
1 | diff --git a/test.go b/test.go
2 | new file mode 100644
3 | index 0000000..6399915
4 | --- /dev/null
5 | +++ b/test.go
6 | @@ -0,0 +1,3 @@
7 | +package test
8 | +
9 | +// line
10 |
--------------------------------------------------------------------------------
/pkg/goformatters/internal/testdata/add_only_on_first_line.diff:
--------------------------------------------------------------------------------
1 | diff --git a/internal/shared/logutil/log.go b/internal/shared/logutil/log.go
2 | index 258b340..97e6660 100644
3 | --- a/internal/shared/logutil/log.go
4 | +++ b/internal/shared/logutil/log.go
5 | @@ -1,3 +1,4 @@
6 | +// added line
7 | package logutil
8 |
9 | type Func func(format string, args ...interface{})
10 |
--------------------------------------------------------------------------------
/pkg/goformatters/internal/testdata/delete_last_line.diff:
--------------------------------------------------------------------------------
1 | diff --git i/main.go w/main.go
2 | index ef3cbb7..52a7925 100644
3 | --- i/main.go
4 | +++ w/main.go
5 | @@ -7,4 +7,3 @@ import (
6 | func main() {
7 | fmt.Println("hello world")
8 | }
9 | -
10 |
--------------------------------------------------------------------------------
/pkg/goformatters/internal/testdata/delete_only_first_lines.diff:
--------------------------------------------------------------------------------
1 | diff --git a/internal/shared/logutil/log.go b/internal/shared/logutil/log.go
2 | index 258b340..0fb554e 100644
3 | --- a/internal/shared/logutil/log.go
4 | +++ b/internal/shared/logutil/log.go
5 | @@ -1,5 +1,3 @@
6 | -package logutil
7 | -
8 | type Func func(format string, args ...interface{})
9 |
10 | type Log interface {
11 |
--------------------------------------------------------------------------------
/pkg/goformatters/internal/testdata/replace_line.diff:
--------------------------------------------------------------------------------
1 | diff --git a/internal/shared/logutil/log.go b/internal/shared/logutil/log.go
2 | index 258b340..c2a8516 100644
3 | --- a/internal/shared/logutil/log.go
4 | +++ b/internal/shared/logutil/log.go
5 | @@ -1,4 +1,4 @@
6 | -package logutil
7 | +package test2
8 |
9 | type Func func(format string, args ...interface{})
10 |
--------------------------------------------------------------------------------
/pkg/golinters/arangolint/arangolint.go:
--------------------------------------------------------------------------------
1 | package arangolint
2 |
3 | import (
4 | "go.augendre.info/arangolint/pkg/analyzer"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(analyzer.NewAnalyzer()).
12 | WithLoadMode(goanalysis.LoadModeTypesInfo)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/arangolint/arangolint_integration_test.go:
--------------------------------------------------------------------------------
1 | package arangolint
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/asasalint/asasalint_integration_test.go:
--------------------------------------------------------------------------------
1 | package asasalint
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/asciicheck/asciicheck.go:
--------------------------------------------------------------------------------
1 | package asciicheck
2 |
3 | import (
4 | "github.com/tdakkota/asciicheck"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(asciicheck.NewAnalyzer()).
12 | WithLoadMode(goanalysis.LoadModeSyntax)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/asciicheck/asciicheck_integration_test.go:
--------------------------------------------------------------------------------
1 | package asciicheck
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/bidichk/bidichk_integration_test.go:
--------------------------------------------------------------------------------
1 | package bidichk
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/bidichk/testdata/bidichk.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Ebidichk
2 | package testdata
3 |
4 | import "fmt"
5 |
6 | func main() {
7 | fmt.Println("LEFT-TO-RIGHT-OVERRIDE: '', it is between the single quotes, but it is not visible with a regular editor") // want "found dangerous unicode character sequence LEFT-TO-RIGHT-OVERRIDE"
8 | }
9 |
--------------------------------------------------------------------------------
/pkg/golinters/bodyclose/bodyclose.go:
--------------------------------------------------------------------------------
1 | package bodyclose
2 |
3 | import (
4 | "github.com/timakin/bodyclose/passes/bodyclose"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(bodyclose.Analyzer).
12 | WithLoadMode(goanalysis.LoadModeTypesInfo)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/bodyclose/bodyclose_integration_test.go:
--------------------------------------------------------------------------------
1 | package bodyclose
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/bodyclose/testdata/bodyclose.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Ebodyclose
2 | package testdata
3 |
4 | import (
5 | "io/ioutil"
6 | "net/http"
7 | )
8 |
9 | func BodycloseNotClosed() {
10 | resp, _ := http.Get("https://google.com") // want "response body must be closed"
11 | _, _ = ioutil.ReadAll(resp.Body)
12 | }
13 |
--------------------------------------------------------------------------------
/pkg/golinters/canonicalheader/canonicalheader.go:
--------------------------------------------------------------------------------
1 | package canonicalheader
2 |
3 | import (
4 | "github.com/lasiar/canonicalheader"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(canonicalheader.Analyzer).
12 | WithLoadMode(goanalysis.LoadModeTypesInfo)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/containedctx/containedctx.go:
--------------------------------------------------------------------------------
1 | package containedctx
2 |
3 | import (
4 | "github.com/sivchari/containedctx"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(containedctx.Analyzer).
12 | WithLoadMode(goanalysis.LoadModeTypesInfo)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/containedctx/containedctx_integration_test.go:
--------------------------------------------------------------------------------
1 | package containedctx
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/containedctx/testdata/containedctx.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Econtainedctx
2 | package testdata
3 |
4 | import "context"
5 |
6 | type ok struct {
7 | i int
8 | s string
9 | }
10 |
11 | type ng struct {
12 | ctx context.Context // want "found a struct that contains a context.Context field"
13 | }
14 |
15 | type empty struct{}
16 |
--------------------------------------------------------------------------------
/pkg/golinters/contextcheck/contextcheck_integration_test.go:
--------------------------------------------------------------------------------
1 | package contextcheck
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/copyloopvar/testdata/copyloopvar.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | copyloopvar:
6 | check-alias: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/cyclop/cyclop_integration_test.go:
--------------------------------------------------------------------------------
1 | package cyclop
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/cyclop/testdata/cyclop.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | cyclop:
6 | max-complexity: 15
7 |
--------------------------------------------------------------------------------
/pkg/golinters/decorder/decorder_integration_test.go:
--------------------------------------------------------------------------------
1 | package decorder
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/decorder/testdata/decorder.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Edecorder
2 | //golangcitest:expected_exitcode 0
3 | package testdata
4 |
5 | import "math"
6 |
7 | const (
8 | decoh = math.MaxInt64
9 | decoi = 1
10 | )
11 |
12 | var decoj = 1
13 | var decok = 1
14 |
15 | type decol int
16 |
17 | func decom() {
18 | const decon = 1
19 | }
20 |
21 | func init() {}
22 |
--------------------------------------------------------------------------------
/pkg/golinters/decorder/testdata/decorder_custom.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | decorder:
6 | dec-order:
7 | - type
8 | - const
9 | - var
10 | - func
11 | disable-dec-order-check: false
12 | disable-init-func-first-check: false
13 | disable-dec-num-check: false
14 |
--------------------------------------------------------------------------------
/pkg/golinters/depguard/depguard_integration_test.go:
--------------------------------------------------------------------------------
1 | package depguard
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/depguard/testdata/depguard.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | depguard:
6 | rules:
7 | main:
8 | deny:
9 | - pkg: compress
10 | desc: "nope"
11 | - pkg: log
12 | desc: "don't use log"
13 | - pkg: "golang.org/x/tools/go/analysis"
14 | desc: "example import with dot"
15 |
--------------------------------------------------------------------------------
/pkg/golinters/dogsled/dogsled_integration_test.go:
--------------------------------------------------------------------------------
1 | package dogsled
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/dupl/dupl_integration_test.go:
--------------------------------------------------------------------------------
1 | package dupl
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/dupl/testdata/dupl.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | dupl:
6 | threshold: 20
7 |
--------------------------------------------------------------------------------
/pkg/golinters/dupword/testdata/dupword_ignore_the.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | dupword:
6 | ignore:
7 | - "the"
8 |
--------------------------------------------------------------------------------
/pkg/golinters/durationcheck/durationcheck.go:
--------------------------------------------------------------------------------
1 | package durationcheck
2 |
3 | import (
4 | "github.com/charithe/durationcheck"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(durationcheck.Analyzer).
12 | WithLoadMode(goanalysis.LoadModeTypesInfo)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/durationcheck/durationcheck_integration_test.go:
--------------------------------------------------------------------------------
1 | package durationcheck
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/embeddedstructfieldcheck/testdata/embeddedstructfieldcheck_mutex.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | embeddedstructfieldcheck:
6 | forbid-mutex: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/embeddedstructfieldcheck/testdata/embeddedstructfieldcheck_special_cases.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Eembeddedstructfieldcheck
2 | package testdata
3 |
4 | import "time"
5 |
6 | func myFunction() {
7 | type myType struct {
8 | version int
9 | time.Time // want `embedded fields should be listed before regular fields`
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/err113/err113.go:
--------------------------------------------------------------------------------
1 | package err113
2 |
3 | import (
4 | "github.com/Djarvur/go-err113"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(err113.NewAnalyzer()).
12 | WithDesc("Check errors handling expressions").
13 | WithLoadMode(goanalysis.LoadModeTypesInfo)
14 | }
15 |
--------------------------------------------------------------------------------
/pkg/golinters/errcheck/errcheck_integration_test.go:
--------------------------------------------------------------------------------
1 | package errcheck
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/errcheck/testdata/errcheck_exclude_functions.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | errcheck:
6 | check-blank: true
7 | exclude-functions:
8 | - io/ioutil.ReadFile
9 | - io/ioutil.ReadDir
10 |
--------------------------------------------------------------------------------
/pkg/golinters/errcheck/testdata/errcheck_ignore_default.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | errcheck:
6 | check-blank: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/errcheck/testdata/errcheck_type_assertions.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Eerrcheck
2 | //golangcitest:config_path testdata/errcheck_type_assertions.yml
3 | //golangcitest:expected_exitcode 1
4 | package testdata
5 |
6 | func ErrorTypeAssertion(filter map[string]interface{}) bool {
7 | return filter["messages_sent.messageid"].(map[string]interface{})["$ne"] != nil // want "Error return value is not checked"
8 | }
9 |
--------------------------------------------------------------------------------
/pkg/golinters/errcheck/testdata/errcheck_type_assertions.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | errcheck:
6 | check-type-assertions: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/errchkjson/errchkjson_integration_test.go:
--------------------------------------------------------------------------------
1 | package errchkjson
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/errchkjson/testdata/errchkjson.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | issues:
4 | max-issues-per-linter: 100
5 |
--------------------------------------------------------------------------------
/pkg/golinters/errchkjson/testdata/errchkjson_check_error_free_encoding.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | issues:
4 | max-issues-per-linter: 100
5 |
6 | linters:
7 | settings:
8 | errchkjson:
9 | check-error-free-encoding: true
10 |
--------------------------------------------------------------------------------
/pkg/golinters/errchkjson/testdata/errchkjson_no_exported.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | errchkjson:
6 | report-no-exported: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/errname/errname.go:
--------------------------------------------------------------------------------
1 | package errname
2 |
3 | import (
4 | "github.com/Antonboom/errname/pkg/analyzer"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(analyzer.New()).
12 | WithLoadMode(goanalysis.LoadModeTypesInfo)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/errname/errname_integration_test.go:
--------------------------------------------------------------------------------
1 | package errname
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/errorlint/testdata/errorlint_asserts.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | errorlint:
6 | errorf: false
7 | asserts: true
8 | comparison: false
9 |
--------------------------------------------------------------------------------
/pkg/golinters/errorlint/testdata/errorlint_comparison.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | errorlint:
6 | errorf: false
7 | asserts: false
8 | comparison: true
9 |
--------------------------------------------------------------------------------
/pkg/golinters/errorlint/testdata/errorlint_errorf.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | errorlint:
6 | errorf: true
7 | asserts: false
8 | comparison: false
9 |
--------------------------------------------------------------------------------
/pkg/golinters/exhaustive/exhaustive_integration_test.go:
--------------------------------------------------------------------------------
1 | package exhaustive
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/exhaustive/testdata/exhaustive.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Eexhaustive
2 | package testdata
3 |
4 | type Direction int
5 |
6 | const (
7 | North Direction = iota
8 | East
9 | South
10 | West
11 | )
12 |
13 | func processDirection(d Direction) {
14 | switch d { // want "missing cases in switch of type testdata.Direction: testdata.East, testdata.West"
15 | case North, South:
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/pkg/golinters/exhaustive/testdata/exhaustive_default.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | exhaustive:
6 | default-signifies-exhaustive: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/exhaustive/testdata/exhaustive_ignore_enum_members.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | exhaustive:
6 | ignore-enum-members: "West$"
7 |
--------------------------------------------------------------------------------
/pkg/golinters/exhaustruct/exhaustruct_integration_test.go:
--------------------------------------------------------------------------------
1 | package exhaustruct
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/exhaustruct/testdata/exhaustruct_custom.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | exhaustruct:
6 | include:
7 | - .*\.ExhaustructCustom
8 | exclude:
9 | - .*\.ExhaustructCustom[\d]{1,2}
10 |
--------------------------------------------------------------------------------
/pkg/golinters/exptostd/exptostd.go:
--------------------------------------------------------------------------------
1 | package exptostd
2 |
3 | import (
4 | "github.com/ldez/exptostd"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(exptostd.NewAnalyzer()).
12 | WithLoadMode(goanalysis.LoadModeTypesInfo)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/exptostd/testdata/go.mod:
--------------------------------------------------------------------------------
1 | module exptostd
2 |
3 | go 1.23.0
4 |
5 | require golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6
6 |
--------------------------------------------------------------------------------
/pkg/golinters/exptostd/testdata/go.sum:
--------------------------------------------------------------------------------
1 | golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 h1:y5zboxd6LQAqYIhHnB48p0ByQ/GnQx2BE33L8BOHQkI=
2 | golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=
3 |
--------------------------------------------------------------------------------
/pkg/golinters/fatcontext/testdata/fatcontext_structpointer.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | fatcontext:
6 | check-struct-pointers: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/forbidigo/forbidigo_integration_test.go:
--------------------------------------------------------------------------------
1 | package forbidigo
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/forbidigo/testdata/forbidigo.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | forbidigo:
6 | forbid:
7 | - pattern: fmt\.Print.*
8 | - pattern: time.Sleep(# no sleeping!)?
9 |
--------------------------------------------------------------------------------
/pkg/golinters/forbidigo/testdata/forbidigo_example_test.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Eforbidigo
2 | //golangcitest:config_path testdata/forbidigo.yml
3 | //golangcitest:expected_exitcode 0
4 | package testdata
5 |
6 | import "fmt"
7 |
8 | func ExampleForbidigo() {
9 | fmt.Printf("too noisy!!!") // godoc examples are ignored (in *_test.go files only)
10 | }
11 |
--------------------------------------------------------------------------------
/pkg/golinters/forbidigo/testdata/forbidigo_include_godoc_examples.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | forbidigo:
6 | exclude-godoc-examples: false
7 |
--------------------------------------------------------------------------------
/pkg/golinters/forbidigo/testdata/forbidigo_include_godoc_examples_test.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Eforbidigo
2 | //golangcitest:config_path testdata/forbidigo_include_godoc_examples.yml
3 | package testdata
4 |
5 | import "fmt"
6 |
7 | func ExampleForbidigoNoGodoc() {
8 | fmt.Printf("too noisy!!!") // want "use of `fmt.Printf` forbidden by pattern.*"
9 | }
10 |
--------------------------------------------------------------------------------
/pkg/golinters/forbidigo/testdata/forbidigo_struct.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | forbidigo:
6 | analyze-types: true
7 | forbid:
8 | - pattern: fmt\.Print.*
9 | pkg: ^fmt$
10 | - pattern: time.Sleep
11 | msg: no sleeping!
12 |
--------------------------------------------------------------------------------
/pkg/golinters/forcetypeassert/forcetypeassert_integration_test.go:
--------------------------------------------------------------------------------
1 | package forcetypeassert
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/funcorder/funcorder_integration_test.go:
--------------------------------------------------------------------------------
1 | package funcorder
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/funcorder/testdata/funcorder_disable_constructor.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | funcorder:
6 | constructor: false
7 |
--------------------------------------------------------------------------------
/pkg/golinters/funcorder/testdata/funcorder_struct_method.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | funcorder:
6 | struct-method: false
7 |
--------------------------------------------------------------------------------
/pkg/golinters/funlen/funlen_integration_test.go:
--------------------------------------------------------------------------------
1 | package funlen
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/funlen/testdata/funlen_custom.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | funlen:
6 | lines: 20
7 | statements: 10
8 |
--------------------------------------------------------------------------------
/pkg/golinters/funlen/testdata/funlen_ignore_comments.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | funlen:
6 | ignore-comments: false
7 |
--------------------------------------------------------------------------------
/pkg/golinters/gci/testdata/gci.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | formatters:
4 | enable:
5 | - gci
6 | settings:
7 | gci:
8 | sections:
9 | - standard
10 | - prefix(github.com/golangci/golangci-lint,github.com/daixiang0/gci)
11 | - default
12 | custom-order: true
13 |
--------------------------------------------------------------------------------
/pkg/golinters/gci/testdata/gci_go124.go:
--------------------------------------------------------------------------------
1 | //go:build go1.24
2 |
3 | //golangcitest:config_path testdata/gci_go124.yml
4 | //golangcitest:expected_exitcode 0
5 | package testdata
6 |
7 | import (
8 | "crypto/sha3"
9 | "errors"
10 | "fmt"
11 | )
12 |
13 | func _() {
14 | fmt.Print(errors.New("x"))
15 | sha3.New224()
16 | }
17 |
--------------------------------------------------------------------------------
/pkg/golinters/gci/testdata/gci_go124.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | formatters:
4 | enable:
5 | - gci
6 |
--------------------------------------------------------------------------------
/pkg/golinters/ginkgolinter/ginkgolinter_integration_test.go:
--------------------------------------------------------------------------------
1 | package ginkgolinter
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/ginkgolinter/testdata/ginkgolinter_allow_havelen0.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | ginkgolinter:
6 | allow-havelen-zero: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/ginkgolinter/testdata/ginkgolinter_default.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | ginkgolinter: {}
6 |
--------------------------------------------------------------------------------
/pkg/golinters/ginkgolinter/testdata/ginkgolinter_suppress_async.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | ginkgolinter:
6 | suppress-async-assertion: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/ginkgolinter/testdata/ginkgolinter_suppress_compare.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | ginkgolinter:
6 | suppress-compare-assertion: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/ginkgolinter/testdata/ginkgolinter_suppress_err.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | ginkgolinter:
6 | suppress-err-assertion: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/ginkgolinter/testdata/ginkgolinter_suppress_focused_containers.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | ginkgolinter:
6 | forbid-focus-container: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/ginkgolinter/testdata/ginkgolinter_suppress_len.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | ginkgolinter:
6 | suppress-len-assertion: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/ginkgolinter/testdata/ginkgolinter_suppress_nil.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | ginkgolinter:
6 | suppress-nil-assertion: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/gocheckcompilerdirectives/gocheckcompilerdirectives_integration_test.go:
--------------------------------------------------------------------------------
1 | package gocheckcompilerdirectives
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/gochecknoglobals/gochecknoglobals_integration_test.go:
--------------------------------------------------------------------------------
1 | package gochecknoglobals
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/gochecknoinits/gochecknoinits_integration_test.go:
--------------------------------------------------------------------------------
1 | package gochecknoinits
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/gochecknoinits/testdata/gochecknoinits.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Egochecknoinits
2 | package testdata
3 |
4 | import "fmt"
5 |
6 | func init() { // want "don't use `init` function"
7 | fmt.Println()
8 | }
9 |
10 | func Init() {}
11 |
--------------------------------------------------------------------------------
/pkg/golinters/gochecksumtype/gochecksumtype_integration_test.go:
--------------------------------------------------------------------------------
1 | package gochecksumtype
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/gochecksumtype/testdata/gochecksumtype_custom.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | gochecksumtype:
6 | default-signifies-exhaustive: false
7 |
--------------------------------------------------------------------------------
/pkg/golinters/gocognit/gocognit_integration_test.go:
--------------------------------------------------------------------------------
1 | package gocognit
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/gocognit/testdata/gocognit.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | gocognit:
6 | min-complexity: 2
7 |
--------------------------------------------------------------------------------
/pkg/golinters/goconst/goconst_integration_test.go:
--------------------------------------------------------------------------------
1 | package goconst
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/goconst/testdata/goconst_calls_enabled.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | goconst:
6 | ignore-calls: false
7 |
--------------------------------------------------------------------------------
/pkg/golinters/goconst/testdata/goconst_eval_and_find_duplicates.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | goconst:
6 | find-duplicates: true
7 | eval-const-expressions: true
8 | numbers: true
9 |
--------------------------------------------------------------------------------
/pkg/golinters/goconst/testdata/goconst_eval_const_expressions.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | goconst:
6 | eval-const-expressions: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/goconst/testdata/goconst_find_duplicates.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | goconst:
6 | find-duplicates: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/gocritic/testdata/gocritic-fix.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | gocritic:
6 | enabled-checks:
7 | - ruleguard
8 | settings:
9 | ruleguard:
10 | failOn: dsl,import
11 | rules: '${base-path}/ruleguard/rangeExprCopy.go,${base-path}/ruleguard/stringsSimplify.go'
12 |
13 | run:
14 | relative-path-mode: cfg
15 |
--------------------------------------------------------------------------------
/pkg/golinters/gocritic/testdata/gocritic_inportShadow.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | gocritic:
6 | disable-all: true
7 | enabled-checks:
8 | - importShadow
9 |
--------------------------------------------------------------------------------
/pkg/golinters/gocritic/testdata/ruleguard/README.md:
--------------------------------------------------------------------------------
1 | This directory contains ruleguard files that are used in functional tests.
2 |
3 | Helpful:
4 |
5 | - https://go-critic.com/overview.html
6 | - https://github.com/go-critic/go-critic/blob/HEAD/checkers/rules/rules.go
7 |
--------------------------------------------------------------------------------
/pkg/golinters/gocritic/testdata/ruleguard/preferWriteString.go:
--------------------------------------------------------------------------------
1 | //go:build ruleguard
2 |
3 | package ruleguard
4 |
5 | import "github.com/quasilyte/go-ruleguard/dsl"
6 |
7 | func preferWriteString(m dsl.Matcher) {
8 | m.Match(`$w.Write([]byte($s))`).
9 | Where(m["w"].Type.Implements("io.StringWriter")).
10 | Suggest("$w.WriteString($s)").
11 | Report(`$w.WriteString($s) should be preferred to the $$`)
12 | }
13 |
--------------------------------------------------------------------------------
/pkg/golinters/gocyclo/gocyclo_integration_test.go:
--------------------------------------------------------------------------------
1 | package gocyclo
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/gocyclo/testdata/gocyclo.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | gocyclo:
6 | min-complexity: 20
7 |
--------------------------------------------------------------------------------
/pkg/golinters/godox/godox_integration_test.go:
--------------------------------------------------------------------------------
1 | package godox
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/godox/testdata/godox.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | godox:
6 | keywords:
7 | - FIXME
8 | - TODO
9 |
--------------------------------------------------------------------------------
/pkg/golinters/gofmt/testdata/fix/in/gofmt.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/gofmt.yml
2 | //golangcitest:expected_exitcode 0
3 | package p
4 |
5 | func gofmt(a, b int) int {
6 | if a != b {
7 | return 1
8 | }
9 | return 2
10 | }
--------------------------------------------------------------------------------
/pkg/golinters/gofmt/testdata/fix/out/gofmt.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/gofmt.yml
2 | //golangcitest:expected_exitcode 0
3 | package p
4 |
5 | func gofmt(a, b int) int {
6 | if a != b {
7 | return 1
8 | }
9 | return 2
10 | }
11 |
--------------------------------------------------------------------------------
/pkg/golinters/gofmt/testdata/gofmt.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/gofmt.yml
2 | package testdata
3 |
4 | import "fmt"
5 |
6 | func GofmtNotSimplified() {
7 | var x []string
8 | fmt.Print(x[1:len(x)]) // want "File is not properly formatted"
9 | }
10 |
--------------------------------------------------------------------------------
/pkg/golinters/gofmt/testdata/gofmt.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | formatters:
4 | enable:
5 | - gofmt
6 |
--------------------------------------------------------------------------------
/pkg/golinters/gofmt/testdata/gofmt_no_simplify.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/gofmt_no_simplify.yml
2 | package testdata
3 |
4 | import "fmt"
5 |
6 | func GofmtNotSimplifiedOk() {
7 | var x []string
8 | fmt.Print(x[1:len(x)])
9 | }
10 |
11 | func GofmtBadFormat(){ // want "File is not properly formatted"
12 | }
13 |
--------------------------------------------------------------------------------
/pkg/golinters/gofmt/testdata/gofmt_no_simplify.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | formatters:
4 | enable:
5 | - gofmt
6 | settings:
7 | gofmt:
8 | simplify: false
9 |
--------------------------------------------------------------------------------
/pkg/golinters/gofmt/testdata/gofmt_rewrite_rules.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | formatters:
4 | enable:
5 | - gofmt
6 | settings:
7 | gofmt:
8 | rewrite-rules:
9 | - pattern: 'interface{}'
10 | replacement: 'any'
11 | - pattern: 'a[b:len(a)]'
12 | replacement: 'a[b:]'
13 |
--------------------------------------------------------------------------------
/pkg/golinters/gofmt/testdata/gofmt_too_many_empty_lines.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/gofmt.yml
2 | package testdata
3 |
4 | import "fmt"
5 |
6 | // want +4 "File is not properly formatted"
7 | func _() {
8 | fmt.Println("foo")
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/pkg/golinters/gofumpt/testdata/fix/in/gofumpt.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/gofumpt-fix.yml
2 | //golangcitest:expected_exitcode 0
3 | package p
4 |
5 | import "fmt"
6 |
7 | func GofmtNotExtra(bar string, baz string) {
8 | fmt.Print(bar, baz)
9 | }
10 |
--------------------------------------------------------------------------------
/pkg/golinters/gofumpt/testdata/fix/in/gofumpt_cgo.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/gofumpt-fix.yml
2 | //golangcitest:expected_exitcode 0
3 | package p
4 |
5 | /*
6 | #include
7 | #include
8 |
9 | void myprint(char* s) {
10 | printf("%d\n", s);
11 | }
12 | */
13 | import "C"
14 |
15 | import "fmt"
16 |
17 | func GofmtNotExtra(bar string, baz string) {
18 | fmt.Print(bar, baz)
19 | }
20 |
--------------------------------------------------------------------------------
/pkg/golinters/gofumpt/testdata/fix/out/gofumpt.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/gofumpt-fix.yml
2 | //golangcitest:expected_exitcode 0
3 | package p
4 |
5 | import "fmt"
6 |
7 | func GofmtNotExtra(bar, baz string) {
8 | fmt.Print(bar, baz)
9 | }
10 |
--------------------------------------------------------------------------------
/pkg/golinters/gofumpt/testdata/fix/out/gofumpt_cgo.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/gofumpt-fix.yml
2 | //golangcitest:expected_exitcode 0
3 | package p
4 |
5 | /*
6 | #include
7 | #include
8 |
9 | void myprint(char* s) {
10 | printf("%d\n", s);
11 | }
12 | */
13 | import "C"
14 |
15 | import "fmt"
16 |
17 | func GofmtNotExtra(bar, baz string) {
18 | fmt.Print(bar, baz)
19 | }
20 |
--------------------------------------------------------------------------------
/pkg/golinters/gofumpt/testdata/gofumpt-fix.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | formatters:
4 | enable:
5 | - gofumpt
6 | settings:
7 | gofumpt:
8 | extra-rules: true
9 |
--------------------------------------------------------------------------------
/pkg/golinters/gofumpt/testdata/gofumpt.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/gofumpt.yml
2 | package testdata
3 |
4 | import "fmt"
5 |
6 | func GofumptNewLine() {
7 | fmt.Println( "foo" ) // want "File is not properly formatted"
8 | }
9 |
--------------------------------------------------------------------------------
/pkg/golinters/gofumpt/testdata/gofumpt.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | formatters:
4 | enable:
5 | - gofumpt
6 |
--------------------------------------------------------------------------------
/pkg/golinters/gofumpt/testdata/gofumpt_too_many_empty_lines.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/gofumpt.yml
2 | package testdata
3 |
4 | import "fmt"
5 |
6 | // want +4 "File is not properly formatted"
7 | func _() {
8 | fmt.Println("foo")
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/pkg/golinters/gofumpt/testdata/gofumpt_with_extra.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/gofumpt_with_extra.yml
2 | package testdata
3 |
4 | import "fmt"
5 |
6 | func GofmtNotExtra(bar string, baz string) { // want "File is not properly formatted"
7 | fmt.Print("foo")
8 | }
9 |
--------------------------------------------------------------------------------
/pkg/golinters/gofumpt/testdata/gofumpt_with_extra.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | formatters:
4 | enable:
5 | - gofumpt
6 | settings:
7 | gofumpt:
8 | extra-rules: true
9 |
--------------------------------------------------------------------------------
/pkg/golinters/goheader/testdata/fix/in/goheader_1.go:
--------------------------------------------------------------------------------
1 | // Copyright 1999 The Awesome Project Authors
2 |
3 | //golangcitest:args -Egoheader
4 | //golangcitest:expected_exitcode 0
5 | //golangcitest:config_path testdata/goheader-fix.yml
6 | package p
7 |
--------------------------------------------------------------------------------
/pkg/golinters/goheader/testdata/fix/in/goheader_2.go:
--------------------------------------------------------------------------------
1 | /* Copyright 1999 The Awesome Project Authors
2 |
3 | Use of this source code is governed */
4 |
5 | //golangcitest:args -Egoheader
6 | //golangcitest:expected_exitcode 0
7 | //golangcitest:config_path testdata/goheader-fix.yml
8 | package p
9 |
--------------------------------------------------------------------------------
/pkg/golinters/goheader/testdata/fix/in/goheader_3.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 1999 The Awesome
3 |
4 | Use of this source code is governed by LICENSE
5 | */
6 |
7 | //golangcitest:args -Egoheader
8 | //golangcitest:expected_exitcode 0
9 | //golangcitest:config_path testdata/goheader-fix.yml
10 | package p
11 |
--------------------------------------------------------------------------------
/pkg/golinters/goheader/testdata/fix/in/goheader_4.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2024 The Awesome Project Authors
3 |
4 | Use of this source code is governed by LICENSE.md
5 | */
6 |
7 | //golangcitest:args -Egoheader
8 | //golangcitest:expected_exitcode 0
9 | //golangcitest:config_path testdata/goheader-fix.yml
10 | package p
11 |
--------------------------------------------------------------------------------
/pkg/golinters/goheader/testdata/fix/out/goheader_1.go:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Awesome Project Authors
2 | //
3 | // Use of this source code is governed by LICENSE
4 |
5 | //golangcitest:args -Egoheader
6 | //golangcitest:expected_exitcode 0
7 | //golangcitest:config_path testdata/goheader-fix.yml
8 | package p
9 |
--------------------------------------------------------------------------------
/pkg/golinters/goheader/testdata/fix/out/goheader_2.go:
--------------------------------------------------------------------------------
1 | /* Copyright 2024 The Awesome Project Authors
2 |
3 | Use of this source code is governed by LICENSE */
4 |
5 | //golangcitest:args -Egoheader
6 | //golangcitest:expected_exitcode 0
7 | //golangcitest:config_path testdata/goheader-fix.yml
8 | package p
9 |
--------------------------------------------------------------------------------
/pkg/golinters/goheader/testdata/fix/out/goheader_3.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2024 The Awesome Project Authors
3 |
4 | Use of this source code is governed by LICENSE
5 | */
6 |
7 | //golangcitest:args -Egoheader
8 | //golangcitest:expected_exitcode 0
9 | //golangcitest:config_path testdata/goheader-fix.yml
10 | package p
11 |
--------------------------------------------------------------------------------
/pkg/golinters/goheader/testdata/fix/out/goheader_4.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2024 The Awesome Project Authors
3 |
4 | Use of this source code is governed by LICENSE
5 | */
6 |
7 | //golangcitest:args -Egoheader
8 | //golangcitest:expected_exitcode 0
9 | //golangcitest:config_path testdata/goheader-fix.yml
10 | package p
11 |
--------------------------------------------------------------------------------
/pkg/golinters/goheader/testdata/goheader-fix.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | goheader:
6 | values:
7 | const:
8 | AUTHOR: The Awesome Project Authors
9 | template: |-
10 | Copyright 2024 {{ AUTHOR }}
11 |
12 | Use of this source code is governed by LICENSE
13 |
--------------------------------------------------------------------------------
/pkg/golinters/goheader/testdata/goheader.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | goheader:
6 | template: MY {{title}}
7 | values:
8 | const:
9 | title: TITLE.
10 |
--------------------------------------------------------------------------------
/pkg/golinters/goheader/testdata/goheader_bad.go:
--------------------------------------------------------------------------------
1 | /*MY TITLE!*/ // want `Expected:TITLE\., Actual: TITLE!`
2 |
3 | //golangcitest:args -Egoheader
4 | //golangcitest:config_path testdata/goheader.yml
5 | package testdata
6 |
--------------------------------------------------------------------------------
/pkg/golinters/goheader/testdata/goheader_good.go:
--------------------------------------------------------------------------------
1 | /*MY TITLE.*/
2 |
3 | //golangcitest:args -Egoheader
4 | //golangcitest:config_path testdata/goheader.yml
5 | //golangcitest:expected_exitcode 0
6 | package testdata
7 |
--------------------------------------------------------------------------------
/pkg/golinters/goimports/testdata/fix/in/goimports.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/goimports.yml
2 | //golangcitest:expected_exitcode 0
3 | package p
4 |
5 | import (
6 | "os"
7 | "fmt"
8 | )
9 |
10 | func goimports(a, b int) int {
11 | if a != b {
12 | return 1
13 | }
14 | return 2
15 | }
16 |
--------------------------------------------------------------------------------
/pkg/golinters/goimports/testdata/fix/out/goimports.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/goimports.yml
2 | //golangcitest:expected_exitcode 0
3 | package p
4 |
5 | func goimports(a, b int) int {
6 | if a != b {
7 | return 1
8 | }
9 | return 2
10 | }
11 |
--------------------------------------------------------------------------------
/pkg/golinters/goimports/testdata/fix/out/goimports_cgo.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/goimports.yml
2 | //golangcitest:expected_exitcode 0
3 | package p
4 |
5 | /*
6 | #include
7 | #include
8 |
9 | void myprint(char* s) {
10 | printf("%d\n", s);
11 | }
12 | */
13 | import "C"
14 |
15 | func goimports(a, b int) int {
16 | if a != b {
17 | return 1
18 | }
19 | return 2
20 | }
21 |
--------------------------------------------------------------------------------
/pkg/golinters/goimports/testdata/goimports.go:
--------------------------------------------------------------------------------
1 | //golangcitest:config_path testdata/goimports.yml
2 | package testdata
3 |
4 | import (
5 | "fmt" // want "File is not properly formatted"
6 | "github.com/golangci/golangci-lint/v2/pkg/config"
7 | )
8 |
9 | func Bar() {
10 | fmt.Print("x")
11 | _ = config.Config{}
12 | }
13 |
--------------------------------------------------------------------------------
/pkg/golinters/goimports/testdata/goimports.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | formatters:
4 | enable:
5 | - goimports
6 |
--------------------------------------------------------------------------------
/pkg/golinters/goimports/testdata/goimports_local.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | formatters:
4 | enable:
5 | - goimports
6 | settings:
7 | goimports:
8 | local-prefixes:
9 | - github.com/golangci/golangci-lint
10 |
--------------------------------------------------------------------------------
/pkg/golinters/golines/testdata/golines-custom.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | formatters:
4 | enable:
5 | - golines
6 | settings:
7 | golines:
8 | # override many settings
9 | max-len: 80
10 | tab-len: 8
11 | reformat-tags: false
12 |
--------------------------------------------------------------------------------
/pkg/golinters/golines/testdata/golines.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | formatters:
4 | enable:
5 | - golines
6 |
--------------------------------------------------------------------------------
/pkg/golinters/gomodguard/gomodguard_integration_test.go:
--------------------------------------------------------------------------------
1 | package gomodguard
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/gomodguard/testdata/go.mod:
--------------------------------------------------------------------------------
1 | module gomodguard
2 |
3 | go 1.23.0
4 |
5 | require (
6 | golang.org/x/mod v0.24.0
7 | gopkg.in/yaml.v3 v3.0.1
8 | )
9 |
--------------------------------------------------------------------------------
/pkg/golinters/goprintffuncname/goprintffuncname.go:
--------------------------------------------------------------------------------
1 | package goprintffuncname
2 |
3 | import (
4 | "github.com/golangci/go-printf-func-name/pkg/analyzer"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(analyzer.Analyzer).
12 | WithLoadMode(goanalysis.LoadModeSyntax)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/goprintffuncname/goprintffuncname_integration_test.go:
--------------------------------------------------------------------------------
1 | package goprintffuncname
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/goprintffuncname/testdata/goprintffuncname.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Egoprintffuncname
2 | package testdata
3 |
4 | func PrintfLikeFuncWithBadName(format string, args ...interface{}) { // want "printf-like formatting function 'PrintfLikeFuncWithBadName' should be named 'PrintfLikeFuncWithBadNamef'"
5 | }
6 |
--------------------------------------------------------------------------------
/pkg/golinters/gosec/gosec_integration_test.go:
--------------------------------------------------------------------------------
1 | package gosec
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/gosec/testdata/gosec.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | gosec:
6 | includes:
7 | - G306
8 | - G101
9 | config:
10 | G306: "0666"
11 | G101:
12 | pattern: "(?i)simple"
13 | ignore_entropy: false
14 | entropy_threshold: "80.0"
15 | per_char_threshold: "3.0"
16 | truncate: "32"
17 |
--------------------------------------------------------------------------------
/pkg/golinters/gosec/testdata/gosec_global_option.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | gosec:
6 | config:
7 | global:
8 | nosec: true
9 |
--------------------------------------------------------------------------------
/pkg/golinters/gosec/testdata/gosec_nosec.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Egosec
2 | //golangcitest:config_path testdata/gosec_nosec.yml
3 | package testdata
4 |
5 | import (
6 | "crypto/md5" // want "G501: Blocklisted import crypto/md5: weak cryptographic primitive"
7 | "log"
8 | )
9 |
10 | func Gosec() {
11 | // #nosec G401
12 | h := md5.New()
13 | log.Print(h)
14 | }
15 |
--------------------------------------------------------------------------------
/pkg/golinters/gosec/testdata/gosec_nosec.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | gosec:
6 | config:
7 | global:
8 | nosec: false
9 |
--------------------------------------------------------------------------------
/pkg/golinters/gosec/testdata/gosec_severity_confidence.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | gosec:
6 | severity: "medium"
7 | confidence: "medium"
8 |
--------------------------------------------------------------------------------
/pkg/golinters/gosmopolitan/gosmopolitan_integration_test.go:
--------------------------------------------------------------------------------
1 | package gosmopolitan
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/gosmopolitan/testdata/gosmopolitan_allow_time_local.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Egosmopolitan
2 | //golangcitest:config_path testdata/gosmopolitan_allow_time_local.yml
3 | //golangcitest:expected_exitcode 0
4 | package testdata
5 |
6 | import (
7 | "time"
8 | )
9 |
10 | func main() {
11 | _ = time.Local
12 | }
13 |
--------------------------------------------------------------------------------
/pkg/golinters/gosmopolitan/testdata/gosmopolitan_allow_time_local.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | gosmopolitan:
6 | allow-time-local: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/gosmopolitan/testdata/gosmopolitan_dont_ignore_test.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Egosmopolitan
2 | package testdata
3 |
4 | import (
5 | "time"
6 | )
7 |
8 | func main() {
9 | _ = "开启检查测试文件" // want `string literal contains rune in Han script`
10 | _ = time.Local // want `usage of time.Local`
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/gosmopolitan/testdata/gosmopolitan_escape_hatches.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | gosmopolitan:
6 | escape-hatches:
7 | - 'command-line-arguments.A'
8 | - 'command-line-arguments.B'
9 | - 'command-line-arguments.C'
10 | - 'command-line-arguments.D'
11 | - 'fmt.Println'
12 |
--------------------------------------------------------------------------------
/pkg/golinters/gosmopolitan/testdata/gosmopolitan_scripts.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | gosmopolitan:
6 | watch-for-scripts:
7 | - Hiragana
8 | - Katakana
9 | - Latin
10 |
--------------------------------------------------------------------------------
/pkg/golinters/govet/testdata/govet.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | govet:
6 | enable:
7 | - shadow
8 |
--------------------------------------------------------------------------------
/pkg/golinters/govet/testdata/govet_fieldalignment.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | govet:
6 | enable:
7 | - fieldalignment
8 |
--------------------------------------------------------------------------------
/pkg/golinters/govet/testdata/govet_fix.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | govet:
6 | enable:
7 | - assign
8 | - composites
9 | - fieldalignment
10 | - findcall
11 | - printf
12 | - sigchanyzer
13 | - sortslice
14 | - stringintconv
15 | - timeformat
16 | - unreachable
17 |
--------------------------------------------------------------------------------
/pkg/golinters/govet/testdata/govet_ifaceassert.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | govet:
6 | enable:
7 | - ifaceassert
8 |
--------------------------------------------------------------------------------
/pkg/golinters/grouper/grouper_integration_test.go:
--------------------------------------------------------------------------------
1 | package grouper
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/grouper/testdata/grouper.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Egrouper
2 | //golangcitest:config_path testdata/grouper.yml
3 | package testdata
4 |
5 | import "fmt" // want "should only use grouped 'import' declarations"
6 |
7 | func dummy() { fmt.Println("dummy") }
8 |
--------------------------------------------------------------------------------
/pkg/golinters/grouper/testdata/grouper.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | grouper:
6 | import-require-grouping: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/iface/testdata/iface_all.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | iface:
6 | enable:
7 | - unused
8 | - identical
9 | - opaque
10 |
--------------------------------------------------------------------------------
/pkg/golinters/iface/testdata/iface_fix.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | iface:
6 | enable:
7 | - unused
8 | - opaque
9 |
--------------------------------------------------------------------------------
/pkg/golinters/iface/testdata/iface_identical.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | iface:
6 | enable:
7 | - identical
8 |
--------------------------------------------------------------------------------
/pkg/golinters/iface/testdata/iface_opaque.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | iface:
6 | enable:
7 | - opaque
8 |
--------------------------------------------------------------------------------
/pkg/golinters/iface/testdata/iface_unexported.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | iface:
6 | enable:
7 | - unexported
8 |
--------------------------------------------------------------------------------
/pkg/golinters/iface/testdata/iface_unused.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | iface:
6 | enable:
7 | - unused
8 |
--------------------------------------------------------------------------------
/pkg/golinters/importas/testdata/importas.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | importas:
6 | alias:
7 | - pkg: fmt
8 | alias: fff
9 | - pkg: os
10 | alias: std_os
11 | - pkg: golang.org/x/tools/go/analysis
12 | alias: ananas
13 |
--------------------------------------------------------------------------------
/pkg/golinters/importas/testdata/importas_several_empty_aliases.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Eimportas
2 | //golangcitest:config_path testdata/importas_several_empty_aliases.yml
3 | //golangcitest:expected_exitcode 0
4 | package testdata
5 |
6 | import (
7 | "fmt"
8 | "math"
9 | "os"
10 | )
11 |
12 | func _() {
13 | fmt.Println("a")
14 | fmt.Fprint(os.Stderr, "b")
15 | println(math.MaxInt)
16 | }
17 |
--------------------------------------------------------------------------------
/pkg/golinters/importas/testdata/importas_several_empty_aliases.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | importas:
6 | alias:
7 | - pkg: fmt
8 | alias: ''
9 | - pkg: os
10 | alias: ''
11 | - pkg: math
12 | alias: ''
13 |
--------------------------------------------------------------------------------
/pkg/golinters/importas/testdata/importas_strict.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | importas:
6 | no-unaliased: true
7 | alias:
8 | - pkg: fmt
9 | alias: fff
10 | - pkg: os
11 | alias: std_os
12 | - pkg: golang.org/x/tools/go/analysis
13 | alias: ananas
14 |
--------------------------------------------------------------------------------
/pkg/golinters/inamedparam/inamedparam_integration_test.go:
--------------------------------------------------------------------------------
1 | package inamedparam
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/inamedparam/testdata/inamedparam_skip_single_param.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | inamedparam:
6 | skip-single-param: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/ineffassign/ineffassign_integration_test.go:
--------------------------------------------------------------------------------
1 | package ineffassign
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/ineffassign/testdata/ineffassign.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Eineffassign
2 | package testdata
3 |
4 | import "math"
5 |
6 | func _() {
7 | x := math.MinInt8
8 | for {
9 | _ = x
10 | x = 0 // want "ineffectual assignment to x"
11 | x = 0
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/interfacebloat/interfacebloat_integration_test.go:
--------------------------------------------------------------------------------
1 | package interfacebloat
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/internal/commons.go:
--------------------------------------------------------------------------------
1 | package internal
2 |
3 | import "github.com/golangci/golangci-lint/v2/pkg/logutils"
4 |
5 | // LinterLogger must be use only when the context logger is not available.
6 | var LinterLogger = logutils.NewStderrLog(logutils.DebugKeyLinter)
7 |
--------------------------------------------------------------------------------
/pkg/golinters/intrange/intrange.go:
--------------------------------------------------------------------------------
1 | package intrange
2 |
3 | import (
4 | "github.com/ckaznocha/intrange"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(intrange.Analyzer).
12 | WithLoadMode(goanalysis.LoadModeTypesInfo)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/intrange/testdata/fix/out/intrange.go:
--------------------------------------------------------------------------------
1 | //go:build go1.22
2 |
3 | //golangcitest:args -Eintrange
4 | //golangcitest:expected_exitcode 0
5 | package testdata
6 |
7 | import "math"
8 |
9 | func CheckIntrange() {
10 | for range 10 {
11 | }
12 |
13 | for range uint8(math.MaxInt8) {
14 | }
15 |
16 | for i := 0; i < 10; i += 2 {
17 | }
18 |
19 | for i := 0; i < 10; i++ {
20 | i += 1
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/pkg/golinters/ireturn/ireturn_integration_test.go:
--------------------------------------------------------------------------------
1 | package ireturn
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/ireturn/testdata/ireturn.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Eireturn
2 | package testdata
3 |
4 | type (
5 | IreturnDoer interface{ Do() }
6 | ireturnDoer struct{}
7 | )
8 |
9 | func New() IreturnDoer { return new(ireturnDoer) } // want `New returns interface \(command-line-arguments.IreturnDoer\)`
10 | func (d *ireturnDoer) Do() { /*...*/ }
11 |
12 | func Newer() *ireturnDoer { return new(ireturnDoer) }
13 |
--------------------------------------------------------------------------------
/pkg/golinters/ireturn/testdata/ireturn_allow.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | ireturn:
6 | allow:
7 | - IreturnAllowDoer
8 |
--------------------------------------------------------------------------------
/pkg/golinters/ireturn/testdata/ireturn_reject_generics.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | ireturn:
6 | reject:
7 | - generic
8 |
--------------------------------------------------------------------------------
/pkg/golinters/ireturn/testdata/ireturn_reject_stdlib.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | ireturn:
6 | reject:
7 | - stdlib
8 |
--------------------------------------------------------------------------------
/pkg/golinters/lll/lll_integration_test.go:
--------------------------------------------------------------------------------
1 | package lll
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/lll/testdata/lll.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | lll:
6 | tab-width: 4
7 |
--------------------------------------------------------------------------------
/pkg/golinters/lll/testdata/lll_import.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | lll:
6 | tab-width: 4
7 | line-length: 60
8 |
--------------------------------------------------------------------------------
/pkg/golinters/lll/testdata/lll_import_single.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Elll
2 | //golangcitest:config_path testdata/lll_import.yml
3 | //golangcitest:expected_exitcode 0
4 | package testdata
5 |
6 | import veryLongImportAliasNameForTest "github.com/golangci/golangci-lint/v2/internal/golinters"
7 |
8 | func LllSingleImport() {
9 | _ = veryLongImportAliasNameForTest.NewLLL(nil)
10 | }
11 |
--------------------------------------------------------------------------------
/pkg/golinters/loggercheck/loggercheck_integration_test.go:
--------------------------------------------------------------------------------
1 | package loggercheck
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/loggercheck/testdata/go.mod:
--------------------------------------------------------------------------------
1 | module loggercheck
2 |
3 | go 1.21.0
4 |
5 | require (
6 | github.com/go-kit/log v0.2.1
7 | github.com/go-logr/logr v1.4.3
8 | go.uber.org/zap v1.27.0
9 | k8s.io/klog/v2 v2.130.1
10 | )
11 |
12 | require (
13 | github.com/go-logfmt/logfmt v0.6.0 // indirect
14 | go.uber.org/multierr v1.11.0 // indirect
15 | )
16 |
--------------------------------------------------------------------------------
/pkg/golinters/loggercheck/testdata/loggercheck_kitlogonly.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | loggercheck:
6 | kitlog: true
7 | klog: false
8 | logr: false
9 | slog: false
10 | zap: false
11 |
--------------------------------------------------------------------------------
/pkg/golinters/loggercheck/testdata/loggercheck_logronly.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | loggercheck:
6 | logr: true
7 | klog: false
8 | slog: false
9 | zap: false
10 |
--------------------------------------------------------------------------------
/pkg/golinters/loggercheck/testdata/loggercheck_noprintflike.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | loggercheck:
6 | no-printf-like: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/loggercheck/testdata/loggercheck_requirestringkey.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | loggercheck:
6 | require-string-key: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/loggercheck/testdata/loggercheck_slogonly.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | loggercheck:
6 | logr: false
7 | klog: false
8 | slog: true
9 | zap: false
10 |
--------------------------------------------------------------------------------
/pkg/golinters/loggercheck/testdata/loggercheck_zaponly.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | loggercheck:
6 | logr: false
7 | klog: false
8 | slog: false
9 | zap: true
10 |
--------------------------------------------------------------------------------
/pkg/golinters/maintidx/maintidx_integration_test.go:
--------------------------------------------------------------------------------
1 | package maintidx
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/maintidx/testdata/maintidx_under_100.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | maintidx:
6 | under: 100
7 |
--------------------------------------------------------------------------------
/pkg/golinters/makezero/makezero_integration_test.go:
--------------------------------------------------------------------------------
1 | package makezero
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/makezero/testdata/makezero_always.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | makezero:
6 | always: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/mirror/testdata/fix/in/mirror.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Emirror
2 | //golangcitest:expected_exitcode 0
3 | package testdata
4 |
5 | import (
6 | "unicode/utf8"
7 | )
8 |
9 | func foobar() {
10 | _ = utf8.RuneCount([]byte("foobar"))
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/mirror/testdata/fix/out/mirror.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Emirror
2 | //golangcitest:expected_exitcode 0
3 | package testdata
4 |
5 | import (
6 | "unicode/utf8"
7 | )
8 |
9 | func foobar() {
10 | _ = utf8.RuneCountInString("foobar")
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/misspell/testdata/misspell.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Emisspell
2 | //golangcitest:config_path testdata/misspell.yml
3 | package testdata
4 |
5 | func Misspell() {
6 | // comment with incorrect spelling: occured // want "`occured` is a misspelling of `occurred`"
7 | }
8 |
9 | // the word langauge should be ignored here: it's set in config
10 | // the word Dialogue should be ignored here: it's set in config
11 |
--------------------------------------------------------------------------------
/pkg/golinters/misspell/testdata/misspell.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | misspell:
6 | locale: US
7 | ignore-rules:
8 | - langauge
9 | - Dialogue
10 |
--------------------------------------------------------------------------------
/pkg/golinters/misspell/testdata/misspell_custom.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | misspell:
6 | extra-words:
7 | - typo: "iff"
8 | correction: "if"
9 | - typo: "cancelation"
10 | correction: "cancellation"
11 |
--------------------------------------------------------------------------------
/pkg/golinters/mnd/mnd_integration_test.go:
--------------------------------------------------------------------------------
1 | package mnd
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/mnd/testdata/mnd_custom.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | mnd:
6 | ignored-numbers:
7 | - '5'
8 |
--------------------------------------------------------------------------------
/pkg/golinters/musttag/musttag_integration_test.go:
--------------------------------------------------------------------------------
1 | package musttag
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/musttag/testdata/musttag.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | musttag:
6 | functions:
7 | - name: encoding/asn1.Marshal
8 | tag: asn1
9 | arg-pos: 0
10 | - name: encoding/asn1.Unmarshal
11 | tag: asn1
12 | arg-pos: 1
13 |
--------------------------------------------------------------------------------
/pkg/golinters/nestif/nestif_integration_test.go:
--------------------------------------------------------------------------------
1 | package nestif
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/nestif/testdata/nestif.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | nestif:
6 | min-complexity: 1
7 |
--------------------------------------------------------------------------------
/pkg/golinters/nilerr/nilerr_integration_test.go:
--------------------------------------------------------------------------------
1 | package nilerr
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/nilnesserr/nilnesserr_integration_test.go:
--------------------------------------------------------------------------------
1 | package nilnesserr
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/nilnil/nilnil_integration_test.go:
--------------------------------------------------------------------------------
1 | package nilnil
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/nilnil/testdata/nilnil_detect_opposite.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | nilnil:
6 | detect-opposite: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/nilnil/testdata/nilnil_multiple_nils.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | nilnil:
6 | only-two: false
7 |
--------------------------------------------------------------------------------
/pkg/golinters/nilnil/testdata/nilnil_pointers_only.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | nilnil:
6 | checked-types:
7 | - ptr
8 | - uintptr
9 |
--------------------------------------------------------------------------------
/pkg/golinters/nlreturn/testdata/nlreturn-block-size.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | nlreturn:
6 | block-size: 2
7 |
--------------------------------------------------------------------------------
/pkg/golinters/noctx/noctx.go:
--------------------------------------------------------------------------------
1 | package noctx
2 |
3 | import (
4 | "github.com/sonatard/noctx"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(noctx.Analyzer).
12 | WithDesc("Detects function and method with missing usage of context.Context").
13 | WithLoadMode(goanalysis.LoadModeTypesInfo)
14 | }
15 |
--------------------------------------------------------------------------------
/pkg/golinters/noctx/noctx_integration_test.go:
--------------------------------------------------------------------------------
1 | package noctx
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/noinlineerr/noinlineerr.go:
--------------------------------------------------------------------------------
1 | package noinlineerr
2 |
3 | import (
4 | "github.com/AlwxSin/noinlineerr"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(noinlineerr.NewAnalyzer()).
12 | WithLoadMode(goanalysis.LoadModeTypesInfo)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/nolintlint/testdata/nolintlint.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | nolintlint:
6 | require-explanation: true
7 | require-specific: true
8 |
--------------------------------------------------------------------------------
/pkg/golinters/nolintlint/testdata/nolintlint_unused.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | nolintlint:
6 | allow-unused: false
7 |
--------------------------------------------------------------------------------
/pkg/golinters/nonamedreturns/nonamedreturns_integration_test.go:
--------------------------------------------------------------------------------
1 | package nonamedreturns
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/nonamedreturns/testdata/nonamedreturns_custom.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | nonamedreturns:
6 | report-error-in-defer: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/nosprintfhostport/nosprintfhostport.go:
--------------------------------------------------------------------------------
1 | package nosprintfhostport
2 |
3 | import (
4 | "github.com/stbenjam/no-sprintf-host-port/pkg/analyzer"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(analyzer.Analyzer).
12 | WithLoadMode(goanalysis.LoadModeSyntax)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/nosprintfhostport/nosprintfhostport_integration_test.go:
--------------------------------------------------------------------------------
1 | package nosprintfhostport
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/paralleltest/paralleltest_integration_test.go:
--------------------------------------------------------------------------------
1 | package paralleltest
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/paralleltest/testdata/paralleltest_custom_test.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | paralleltest:
6 | ignore-missing: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/perfsprint/testdata/perfsprint_custom.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | perfsprint:
6 | int-conversion: false
7 | err-error: true
8 | errorf: false
9 | sprintf1: false
10 |
--------------------------------------------------------------------------------
/pkg/golinters/prealloc/prealloc_integration_test.go:
--------------------------------------------------------------------------------
1 | package prealloc
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/prealloc/testdata/prealloc.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Eprealloc
2 | package testdata
3 |
4 | func Prealloc(source []int) []int {
5 | var dest []int // want "Consider pre-allocating `dest`"
6 | for _, v := range source {
7 | dest = append(dest, v)
8 | }
9 |
10 | return dest
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/predeclared/predeclared_integration_test.go:
--------------------------------------------------------------------------------
1 | package predeclared
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/predeclared/testdata/predeclared_custom.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | predeclared:
6 | ignore:
7 | - real
8 | - recover
9 | qualified-name: true
10 |
--------------------------------------------------------------------------------
/pkg/golinters/promlinter/promlinter_integration_test.go:
--------------------------------------------------------------------------------
1 | package promlinter
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/protogetter/protogetter_integration_test.go:
--------------------------------------------------------------------------------
1 | package protogetter
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/reassign/reassign_integration_test.go:
--------------------------------------------------------------------------------
1 | package reassign
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/reassign/testdata/reassign.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Ereassign
2 | package testdata
3 |
4 | import (
5 | "io"
6 | "net/http"
7 | )
8 |
9 | func reassignTest() {
10 | http.DefaultClient = nil
11 | http.DefaultTransport = nil
12 | io.EOF = nil // want `reassigning variable EOF in other package io`
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/reassign/testdata/reassign_patterns.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | reassign:
6 | patterns:
7 | - DefaultClient
8 | - DefaultTransport
9 |
--------------------------------------------------------------------------------
/pkg/golinters/recvcheck/recvcheck_integration_test.go:
--------------------------------------------------------------------------------
1 | package recvcheck_test
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/recvcheck/testdata/recvcheck.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Erecvcheck
2 | package testdata
3 |
4 | import "fmt"
5 |
6 | type Bar struct{} // want `the methods of "Bar" use pointer receiver and non-pointer receiver.`
7 |
8 | func (b Bar) A() {
9 | fmt.Println("A")
10 | }
11 |
12 | func (b *Bar) B() {
13 | fmt.Println("B")
14 | }
15 |
--------------------------------------------------------------------------------
/pkg/golinters/revive/testdata/fix/in/revive.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Erevive
2 | //golangcitest:config_path testdata/revive-fix.yml
3 | //golangcitest:expected_exitcode 0
4 | package in
5 |
6 | import (
7 | "errors"
8 | "fmt"
9 | "math"
10 | )
11 |
12 | func _() error {
13 | return errors.New(fmt.Sprintf("foo: %d", math.MaxInt))
14 | }
15 |
--------------------------------------------------------------------------------
/pkg/golinters/revive/testdata/fix/out/revive.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Erevive
2 | //golangcitest:config_path testdata/revive-fix.yml
3 | //golangcitest:expected_exitcode 0
4 | package in
5 |
6 | import (
7 | "errors"
8 | "fmt"
9 | "math"
10 | )
11 |
12 | func _() error {
13 | return fmt.Errorf("foo: %d", math.MaxInt)
14 | }
15 |
--------------------------------------------------------------------------------
/pkg/golinters/revive/testdata/revive-fix.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | revive:
6 | severity: warning
7 | rules:
8 | - name: errorf
9 | - name: range
10 |
--------------------------------------------------------------------------------
/pkg/golinters/rowserrcheck/rowserrcheck_integration_test.go:
--------------------------------------------------------------------------------
1 | package rowserrcheck
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/sloglint/sloglint_integration_test.go:
--------------------------------------------------------------------------------
1 | package sloglint
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/sloglint/testdata/sloglint.go:
--------------------------------------------------------------------------------
1 | //go:build go1.21
2 |
3 | //golangcitest:args -Esloglint
4 | package testdata
5 |
6 | import "log/slog"
7 |
8 | func test() {
9 | slog.Info("msg", "foo", 1, "bar", 2)
10 | slog.Info("msg", slog.Int("foo", 1), slog.Int("bar", 2))
11 |
12 | slog.Info("msg", "foo", 1, slog.Int("bar", 2)) // want `key-value pairs and attributes should not be mixed`
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/sloglint/testdata/sloglint_args_on_sep_lines.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | sloglint:
6 | args-on-sep-lines: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/sloglint/testdata/sloglint_attr_only.go:
--------------------------------------------------------------------------------
1 | //go:build go1.21
2 |
3 | //golangcitest:args -Esloglint
4 | //golangcitest:config_path testdata/sloglint_attr_only.yml
5 | package testdata
6 |
7 | import "log/slog"
8 |
9 | func test() {
10 | slog.Info("msg", slog.Int("foo", 1), slog.Int("bar", 2))
11 |
12 | slog.Info("msg", "foo", 1, "bar", 2) // want `key-value pairs should not be used`
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/sloglint/testdata/sloglint_attr_only.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | sloglint:
6 | attr-only: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/sloglint/testdata/sloglint_context_only.go:
--------------------------------------------------------------------------------
1 | //go:build go1.21
2 |
3 | //golangcitest:args -Esloglint
4 | //golangcitest:config_path testdata/sloglint_context_only.yml
5 | package testdata
6 |
7 | import (
8 | "context"
9 | "log/slog"
10 | )
11 |
12 | func test() {
13 | slog.InfoContext(context.Background(), "msg")
14 |
15 | slog.Info("msg") // want `InfoContext should be used instead`
16 | }
17 |
--------------------------------------------------------------------------------
/pkg/golinters/sloglint/testdata/sloglint_context_only.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | sloglint:
6 | context: "all"
7 |
--------------------------------------------------------------------------------
/pkg/golinters/sloglint/testdata/sloglint_forbidden_keys.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | sloglint:
6 | forbidden-keys:
7 | - foo_bar
8 |
--------------------------------------------------------------------------------
/pkg/golinters/sloglint/testdata/sloglint_key_naming_case.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | sloglint:
6 | key-naming-case: snake
7 |
--------------------------------------------------------------------------------
/pkg/golinters/sloglint/testdata/sloglint_kv_only.go:
--------------------------------------------------------------------------------
1 | //go:build go1.21
2 |
3 | //golangcitest:args -Esloglint
4 | //golangcitest:config_path testdata/sloglint_kv_only.yml
5 | package testdata
6 |
7 | import "log/slog"
8 |
9 | func test() {
10 | slog.Info("msg", "foo", 1, "bar", 2)
11 |
12 | slog.Info("msg", slog.Int("foo", 1), slog.Int("bar", 2)) // want `attributes should not be used`
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/sloglint/testdata/sloglint_kv_only.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | sloglint:
6 | kv-only: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/sloglint/testdata/sloglint_no_raw_keys.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | sloglint:
6 | no-raw-keys: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/sloglint/testdata/sloglint_static_msg.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | sloglint:
6 | static-msg: true
7 |
--------------------------------------------------------------------------------
/pkg/golinters/spancheck/spancheck_integration_test.go:
--------------------------------------------------------------------------------
1 | package spancheck
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/spancheck/testdata/go.mod:
--------------------------------------------------------------------------------
1 | module spancheck
2 |
3 | go 1.23.0
4 |
5 | require (
6 | go.opentelemetry.io/otel v1.36.0
7 | go.opentelemetry.io/otel/trace v1.36.0
8 | )
9 |
10 | require (
11 | github.com/go-logr/logr v1.4.3 // indirect
12 | github.com/go-logr/stdr v1.2.2 // indirect
13 | go.opentelemetry.io/auto/sdk v1.1.0 // indirect
14 | go.opentelemetry.io/otel/metric v1.36.0 // indirect
15 | )
16 |
--------------------------------------------------------------------------------
/pkg/golinters/spancheck/testdata/spancheck_enable_all.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | spancheck:
6 | checks:
7 | - "end"
8 | - "record-error"
9 | - "set-status"
10 | ignore-check-signatures:
11 | - "recordErr"
12 |
--------------------------------------------------------------------------------
/pkg/golinters/spancheck/testdata/spancheck_keep_default.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | spancheck:
6 | extra-start-span-signatures:
7 | - dummy:opentelemetry
8 |
--------------------------------------------------------------------------------
/pkg/golinters/sqlclosecheck/sqlclosecheck.go:
--------------------------------------------------------------------------------
1 | package sqlclosecheck
2 |
3 | import (
4 | "github.com/ryanrolds/sqlclosecheck/pkg/analyzer"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(analyzer.NewAnalyzer()).
12 | WithLoadMode(goanalysis.LoadModeTypesInfo)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/sqlclosecheck/sqlclosecheck_integration_test.go:
--------------------------------------------------------------------------------
1 | package sqlclosecheck
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/staticcheck/testdata/fix/in/gosimple.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Estaticcheck
2 | //golangcitest:config_path testdata/gosimple.yml
3 | //golangcitest:expected_exitcode 0
4 | package testdata
5 |
6 | func _(src []string) {
7 | var dst []string
8 | for i, x := range src {
9 | dst[i] = x
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/staticcheck/testdata/fix/in/staticcheck.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Estaticcheck
2 | //golangcitest:config_path testdata/staticcheck.yml
3 | //golangcitest:expected_exitcode 0
4 | package testdata
5 |
6 | import "sort"
7 |
8 | func _(a []string) {
9 | a = sort.StringSlice(a)
10 | }
11 |
--------------------------------------------------------------------------------
/pkg/golinters/staticcheck/testdata/fix/in/stylecheck.go:
--------------------------------------------------------------------------------
1 | // Package testdata ...
2 | //
3 | //golangcitest:args -Estaticcheck
4 | //golangcitest:config_path testdata/stylecheck.yml
5 | //golangcitest:expected_exitcode 0
6 | package testdata
7 |
8 | func _(x int) {
9 | if 42 == x {
10 |
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/pkg/golinters/staticcheck/testdata/fix/out/gosimple.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Estaticcheck
2 | //golangcitest:config_path testdata/gosimple.yml
3 | //golangcitest:expected_exitcode 0
4 | package testdata
5 |
6 | func _(src []string) {
7 | var dst []string
8 | copy(dst, src)
9 | }
10 |
--------------------------------------------------------------------------------
/pkg/golinters/staticcheck/testdata/fix/out/staticcheck.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Estaticcheck
2 | //golangcitest:config_path testdata/staticcheck.yml
3 | //golangcitest:expected_exitcode 0
4 | package testdata
5 |
6 | import "sort"
7 |
8 | func _(a []string) {
9 | sort.Strings(a)
10 | }
11 |
--------------------------------------------------------------------------------
/pkg/golinters/staticcheck/testdata/fix/out/stylecheck.go:
--------------------------------------------------------------------------------
1 | // Package testdata ...
2 | //
3 | //golangcitest:args -Estaticcheck
4 | //golangcitest:config_path testdata/stylecheck.yml
5 | //golangcitest:expected_exitcode 0
6 | package testdata
7 |
8 | func _(x int) {
9 | if x == 42 {
10 |
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/pkg/golinters/staticcheck/testdata/gosimple.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | staticcheck:
6 | checks:
7 | - all
8 | - '-SA*'
9 | - '-ST*'
10 | - '-QF*'
11 |
12 |
--------------------------------------------------------------------------------
/pkg/golinters/staticcheck/testdata/staticcheck.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | staticcheck:
6 | checks:
7 | - all
8 | - '-ST*'
9 | - '-S*'
10 | - '-QF*'
11 |
--------------------------------------------------------------------------------
/pkg/golinters/staticcheck/testdata/stylecheck.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | staticcheck:
6 | checks:
7 | - all
8 | - '-SA*'
9 | - '-S*'
10 | - '-QF*'
11 |
12 |
--------------------------------------------------------------------------------
/pkg/golinters/swaggo/testdata/swaggo.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | formatters:
4 | enable:
5 | - swaggo
6 |
--------------------------------------------------------------------------------
/pkg/golinters/tagalign/testdata/tagalign_align_only.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | tagalign:
6 | sort: false
7 |
--------------------------------------------------------------------------------
/pkg/golinters/tagalign/testdata/tagalign_order_only.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | tagalign:
6 | align: false
7 | order:
8 | - "xml"
9 | - "json"
10 | - "yaml"
11 |
--------------------------------------------------------------------------------
/pkg/golinters/tagalign/testdata/tagalign_sort_only.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | tagalign:
6 | align: false
7 | sort: true
8 |
--------------------------------------------------------------------------------
/pkg/golinters/tagalign/testdata/tagalign_strict.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | tagalign:
6 | align: true
7 | sort: true
8 | strict: true
9 |
--------------------------------------------------------------------------------
/pkg/golinters/tagliatelle/tagliatelle_integration_test.go:
--------------------------------------------------------------------------------
1 | package tagliatelle
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/tagliatelle/testdata/tagliatelle_ignored_fields.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | tagliatelle:
6 | case:
7 | ignored-fields:
8 | - CommonServiceFooItem
9 |
--------------------------------------------------------------------------------
/pkg/golinters/testableexamples/testableexamples.go:
--------------------------------------------------------------------------------
1 | package testableexamples
2 |
3 | import (
4 | "github.com/maratori/testableexamples/pkg/testableexamples"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(testableexamples.NewAnalyzer()).
12 | WithLoadMode(goanalysis.LoadModeSyntax)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/testableexamples/testableexamples_integration_test.go:
--------------------------------------------------------------------------------
1 | package testableexamples
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/testifylint/testdata/testifylint_bool_compare_only.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | testifylint:
6 | disable-all: true
7 | enable:
8 | - bool-compare
9 | bool-compare:
10 | ignore-custom-types: true
11 |
--------------------------------------------------------------------------------
/pkg/golinters/testifylint/testdata/testifylint_formatter_dont_require_string_msg.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | testifylint:
6 | disable-all: true
7 | enable:
8 | - formatter
9 | formatter:
10 | check-format-string: false
11 | require-f-funcs: false
12 | require-string-msg: false
13 |
--------------------------------------------------------------------------------
/pkg/golinters/testifylint/testdata/testifylint_formatter_only.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | testifylint:
6 | disable-all: true
7 | enable:
8 | - formatter
9 | formatter:
10 | check-format-string: false
11 | require-f-funcs: true
12 | require-string-msg: true
13 |
--------------------------------------------------------------------------------
/pkg/golinters/testifylint/testdata/testifylint_require_error_only.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | testifylint:
6 | disable-all: true
7 | enable:
8 | - require-error
9 | require-error:
10 | fn-pattern: ^NoError$
11 |
--------------------------------------------------------------------------------
/pkg/golinters/testpackage/testdata/testpackage_test.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Etestpackage
2 | package testdata // want "package should be `testdata_test` instead of `testdata`"
3 |
--------------------------------------------------------------------------------
/pkg/golinters/testpackage/testpackage_integration_test.go:
--------------------------------------------------------------------------------
1 | package testpackage
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/thelper/testdata/thelper.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | thelper:
6 | test:
7 | name: false
8 | begin: true
9 |
--------------------------------------------------------------------------------
/pkg/golinters/thelper/thelper_integration_test.go:
--------------------------------------------------------------------------------
1 | package thelper
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/tparallel/testdata/tparallel_happy_path_test.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Etparallel
2 | //golangcitest:expected_exitcode 0
3 | package testdata
4 |
5 | import (
6 | "testing"
7 | )
8 |
9 | func TestValidHappyPath(t *testing.T) {
10 | t.Parallel()
11 | t.Run("", func(t *testing.T) {
12 | t.Parallel()
13 | })
14 | }
15 |
16 | func TestValidNoSubTest(t *testing.T) {
17 | t.Parallel()
18 | }
19 |
--------------------------------------------------------------------------------
/pkg/golinters/tparallel/testdata/tparallel_missing_subtest_test.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Etparallel
2 | package testdata
3 |
4 | import (
5 | "testing"
6 | )
7 |
8 | func TestSubtests(t *testing.T) { // want "TestSubtests's subtests should call t.Parallel"
9 | t.Parallel()
10 |
11 | t.Run("", func(t *testing.T) {
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/tparallel/testdata/tparallel_missing_toplevel_test.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Etparallel
2 | package testdata
3 |
4 | import (
5 | "testing"
6 | )
7 |
8 | func TestTopLevel(t *testing.T) { // want "TestTopLevel should call t.Parallel on the top level as well as its subtests"
9 | t.Run("", func(t *testing.T) {
10 | t.Parallel()
11 | })
12 | }
13 |
--------------------------------------------------------------------------------
/pkg/golinters/tparallel/tparallel.go:
--------------------------------------------------------------------------------
1 | package tparallel
2 |
3 | import (
4 | "github.com/moricho/tparallel"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(tparallel.Analyzer).
12 | WithLoadMode(goanalysis.LoadModeTypesInfo)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/tparallel/tparallel_integration_test.go:
--------------------------------------------------------------------------------
1 | package tparallel
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/unconvert/unconvert_integration_test.go:
--------------------------------------------------------------------------------
1 | package unconvert
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/unparam/testdata/unparam.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Eunparam
2 | package testdata
3 |
4 | func unparamUnused(a, b uint) uint { // want "unparamUnused - b is unused"
5 | a++
6 | return a
7 | }
8 |
--------------------------------------------------------------------------------
/pkg/golinters/unparam/unparam_integration_test.go:
--------------------------------------------------------------------------------
1 | package unparam
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/unused/unused_integration_test.go:
--------------------------------------------------------------------------------
1 | package unused
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/usestdlibvars/testdata/fix/in/usestdlibvars.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Eusestdlibvars
2 | //golangcitest:expected_exitcode 0
3 | package testdata
4 |
5 | import "net/http"
6 |
7 | func _200() {
8 | _ = 200
9 | }
10 |
11 | func _200_1() {
12 | var w http.ResponseWriter
13 | w.WriteHeader(200) // want `"200" can be replaced by http.StatusOK`
14 | }
15 |
--------------------------------------------------------------------------------
/pkg/golinters/usestdlibvars/testdata/fix/out/usestdlibvars.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Eusestdlibvars
2 | //golangcitest:expected_exitcode 0
3 | package testdata
4 |
5 | import "net/http"
6 |
7 | func _200() {
8 | _ = 200
9 | }
10 |
11 | func _200_1() {
12 | var w http.ResponseWriter
13 | w.WriteHeader(http.StatusOK) // want `"200" can be replaced by http.StatusOK`
14 | }
15 |
--------------------------------------------------------------------------------
/pkg/golinters/usestdlibvars/testdata/usestdlibvars.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Eusestdlibvars
2 | package testdata
3 |
4 | import "net/http"
5 |
6 | func _200() {
7 | _ = 200
8 | }
9 |
10 | func _200_1() {
11 | var w http.ResponseWriter
12 | w.WriteHeader(200) // want `"200" can be replaced by http.StatusOK`
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/usetesting/testdata/usetesting_configuration.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | usetesting:
6 | os-create-temp: false
7 | os-mkdir-temp: false
8 | os-setenv: true
9 | os-temp-dir: true
10 | os-chdir: false
11 | context-background: false
12 | context-todo: false
13 |
--------------------------------------------------------------------------------
/pkg/golinters/usetesting/testdata/usetesting_go124_configuration.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | usetesting:
6 | os-create-temp: false
7 | os-mkdir-temp: false
8 | os-setenv: true
9 | os-temp-dir: true
10 | os-chdir: false
11 | context-background: false
12 | context-todo: false
13 |
--------------------------------------------------------------------------------
/pkg/golinters/varnamelen/testdata/varnamelen.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Evarnamelen
2 | package testdata
3 |
4 | import "math"
5 |
6 | func varnamelen() {
7 | x := math.MinInt8 // want "variable name 'x' is too short for the scope of its usage"
8 | x++
9 | x++
10 | x++
11 | x++
12 | x++
13 | x++
14 | x++
15 | x++
16 | x++
17 | }
18 |
--------------------------------------------------------------------------------
/pkg/golinters/varnamelen/varnamelen_integration_test.go:
--------------------------------------------------------------------------------
1 | package varnamelen
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/wastedassign/wastedassign_integration_test.go:
--------------------------------------------------------------------------------
1 | package wastedassign
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/whitespace/testdata/whitespace-fix.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | whitespace:
6 | multi-if: true
7 | multi-func: true
8 |
--------------------------------------------------------------------------------
/pkg/golinters/whitespace/testdata/whitespace.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | whitespace:
6 | multi-if: true
7 | multi-func: true
8 |
--------------------------------------------------------------------------------
/pkg/golinters/wrapcheck/testdata/wrapcheck.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Ewrapcheck
2 | package testdata
3 |
4 | import (
5 | "encoding/json"
6 | )
7 |
8 | func do() error {
9 | _, err := json.Marshal(struct{}{})
10 | if err != nil {
11 | return err // want "error returned from external package is unwrapped"
12 | }
13 |
14 | return nil
15 | }
16 |
--------------------------------------------------------------------------------
/pkg/golinters/wrapcheck/wrapcheck_integration_test.go:
--------------------------------------------------------------------------------
1 | package wrapcheck
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/golinters/wsl/testdata/wsl.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | wsl:
6 | allow-cuddle-declarations: false
7 |
--------------------------------------------------------------------------------
/pkg/golinters/zerologlint/testdata/go.mod:
--------------------------------------------------------------------------------
1 | module zerologlint
2 |
3 | go 1.23.0
4 |
5 | require github.com/rs/zerolog v1.34.0
6 |
7 | require (
8 | github.com/mattn/go-colorable v0.1.14 // indirect
9 | github.com/mattn/go-isatty v0.0.20 // indirect
10 | golang.org/x/sys v0.33.0 // indirect
11 | )
12 |
--------------------------------------------------------------------------------
/pkg/golinters/zerologlint/zerologlint.go:
--------------------------------------------------------------------------------
1 | package zerologlint
2 |
3 | import (
4 | "github.com/ykadowak/zerologlint"
5 |
6 | "github.com/golangci/golangci-lint/v2/pkg/goanalysis"
7 | )
8 |
9 | func New() *goanalysis.Linter {
10 | return goanalysis.
11 | NewLinterFromAnalyzer(zerologlint.Analyzer).
12 | WithLoadMode(goanalysis.LoadModeTypesInfo)
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/golinters/zerologlint/zerologlint_integration_test.go:
--------------------------------------------------------------------------------
1 | package zerologlint
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFromTestdata(t *testing.T) {
10 | integration.RunTestdata(t)
11 | }
12 |
--------------------------------------------------------------------------------
/pkg/logutils/out.go:
--------------------------------------------------------------------------------
1 | package logutils
2 |
3 | import (
4 | "github.com/fatih/color"
5 | colorable "github.com/mattn/go-colorable"
6 | )
7 |
8 | var (
9 | StdOut = color.Output // https://github.com/golangci/golangci-lint/issues/14
10 | StdErr = colorable.NewColorableStderr()
11 | )
12 |
--------------------------------------------------------------------------------
/pkg/result/processors/processor.go:
--------------------------------------------------------------------------------
1 | package processors
2 |
3 | import (
4 | "github.com/golangci/golangci-lint/v2/pkg/result"
5 | )
6 |
7 | const typeCheckName = "typecheck"
8 |
9 | type Processor interface {
10 | Process(issues []result.Issue) ([]result.Issue, error)
11 | Name() string
12 | Finish()
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/result/processors/testdata/exclusion_generated_file_filter/exclude.go:
--------------------------------------------------------------------------------
1 | // first line
2 | // second line
3 |
4 | // third line
5 |
6 | package exclusion_generated_file_filter // this text also
7 | // and this text also
8 |
--------------------------------------------------------------------------------
/pkg/result/processors/testdata/exclusion_generated_file_filter/exclude_block_comment.go:
--------------------------------------------------------------------------------
1 | /*
2 | * first line
3 | *
4 | * second line
5 | * third line
6 | */
7 |
8 | // and this text also
9 |
10 | /*
11 | this type of block comment also
12 | */
13 |
14 | /* this one line comment also */
15 |
16 | package exclusion_generated_file_filter
17 |
--------------------------------------------------------------------------------
/pkg/result/processors/testdata/exclusion_generated_file_filter/exclude_doc.go:
--------------------------------------------------------------------------------
1 | package exclusion_generated_file_filter
2 |
3 | // DO NOT EDIT
4 |
5 | import "fmt"
6 |
7 | //nolint:all
8 | func PrintString(s string) {
9 | fmt.Printf("%s", s)
10 | }
11 |
--------------------------------------------------------------------------------
/pkg/result/processors/testdata/exclusion_generated_file_filter/go_strict.go:
--------------------------------------------------------------------------------
1 | // foo foo foo.
2 | // foo foo foo.
3 | // foo foo foo.
4 |
5 | // Code generated by example — DO NOT EDIT.
6 |
7 | package exclusion_generated_file_filter
8 |
--------------------------------------------------------------------------------
/pkg/result/processors/testdata/exclusion_generated_file_filter/go_strict_invalid.go:
--------------------------------------------------------------------------------
1 | package exclusion_generated_file_filter
2 |
3 | // Code generated by example; DO NOT EDIT.
4 | func _() {
5 |
6 | }
7 |
--------------------------------------------------------------------------------
/pkg/result/processors/testdata/exclusion_rules/case_sensitive.go:
--------------------------------------------------------------------------------
1 | package exclusion_rules
2 |
3 | // GO:generate long line that will be excluded by default processor but will not be affected by case-sensitive one because of capital GO
4 |
--------------------------------------------------------------------------------
/pkg/result/processors/testdata/exclusion_rules/exclusion_rules.go:
--------------------------------------------------------------------------------
1 | package exclusion_rules
2 |
3 | //go:generate --long line --with a --lot of --arguments --that we --would like --to exclude --from lll --issues --by exclude-rules
4 |
5 | // long line that we don't want to exclude from lll issues. Use the similar pattern: go:generate. This line should be reported by lll
6 |
--------------------------------------------------------------------------------
/pkg/result/processors/testdata/nolint_filter/apply_to_unknown.go:
--------------------------------------------------------------------------------
1 | package nolint_filter
2 |
3 | func bar() {
4 | _ = 0 // nolint: foobar
5 | }
6 |
--------------------------------------------------------------------------------
/pkg/result/processors/testdata/nolint_filter/nolint2.go:
--------------------------------------------------------------------------------
1 | package nolint_filter
2 |
3 | import (
4 | "bytes"
5 | "io"
6 | )
7 |
8 | func noTransitiveExpanding() {
9 | //nolint:errcheck
10 | var buf io.Writer = &bytes.Buffer{}
11 | buf.Write([]byte("123"))
12 | }
13 |
14 | func nolintFuncByInlineCommentDoesNotWork() { //nolint:errcheck
15 | var buf io.Writer = &bytes.Buffer{}
16 | buf.Write([]byte("123"))
17 | }
18 |
--------------------------------------------------------------------------------
/pkg/result/processors/testdata/nolint_filter/unused.go:
--------------------------------------------------------------------------------
1 | package nolint_filter
2 |
3 | var nolintMisspell int //nolint:misspell
4 |
5 | var nolintMisspellUnusedOK int //nolint:misspell,nolintlint
6 |
--------------------------------------------------------------------------------
/pkg/result/processors/testdata/nolint_filter/whole_file.go:
--------------------------------------------------------------------------------
1 | //nolint:errcheck
2 | package nolint_filter
3 |
4 | func RetError() error {
5 | return nil
6 | }
7 |
8 | func MissedErrorCheck1() {
9 | RetErr()
10 | }
11 |
12 | func jo(v, w bool) bool {
13 | return v == w || v == w
14 | }
15 |
--------------------------------------------------------------------------------
/pkg/result/processors/testdata/severity/exclude_rules.go:
--------------------------------------------------------------------------------
1 | package severity
2 |
3 | //go:generate --long line --with a --lot of --arguments --that we --would like --to exclude --from lll --issues --by exclude-rules
4 |
5 | // long line that we don't want to exclude from lll issues. Use the similar pattern: go:generate. This line should be reported by lll
6 |
--------------------------------------------------------------------------------
/pkg/result/processors/testdata/severity/severity_rules.go:
--------------------------------------------------------------------------------
1 | package severity
2 |
3 | //go:dosomething
4 |
--------------------------------------------------------------------------------
/scripts/website/expand_templates/.gitignore:
--------------------------------------------------------------------------------
1 | ConfigurationFile.md
2 | FormattersSettings.md
3 | LintersSettings.md
4 |
--------------------------------------------------------------------------------
/scripts/website/expand_templates/plugins.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "os"
6 | )
7 |
8 | func getPluginReference() (string, error) {
9 | reference, err := os.ReadFile(".custom-gcl.reference.yml")
10 | if err != nil {
11 | return "", fmt.Errorf("can't read .custom-gcl.reference.yml: %w", err)
12 | }
13 |
14 | return string(reference), nil
15 | }
16 |
--------------------------------------------------------------------------------
/test/fix_test.go:
--------------------------------------------------------------------------------
1 | package test
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/golangci/golangci-lint/v2/test/testshared/integration"
7 | )
8 |
9 | func TestFix(t *testing.T) {
10 | integration.RunFix(t)
11 | }
12 |
13 | func TestFix_pathPrefix(t *testing.T) {
14 | integration.RunFixPathPrefix(t)
15 | }
16 |
--------------------------------------------------------------------------------
/test/testdata/autogenerated/autogenerated.go:
--------------------------------------------------------------------------------
1 | // Code generated by ... DO NOT EDIT.
2 | package p
3 |
4 | var vvv int
5 |
--------------------------------------------------------------------------------
/test/testdata/autogenerated/do_not_edit.go:
--------------------------------------------------------------------------------
1 | // DO NOT EDIT Code generated by something
2 | package p
3 |
4 | func unusedFunc() {}
5 |
--------------------------------------------------------------------------------
/test/testdata/autogenerated/go_bindata.go:
--------------------------------------------------------------------------------
1 | // Code generated by go-bindata.
2 | // sources:
3 | // bar.baz
4 | // x/y.z
5 | // DO NOT EDIT!
6 | package p
7 |
8 | var vv int
9 |
--------------------------------------------------------------------------------
/test/testdata/autogenerated/mockgen.go:
--------------------------------------------------------------------------------
1 | // Code generated by MockGen. DO NOT EDIT.
2 | // Source: ./app/analyze/executors/executor.go
3 |
4 | package p
5 |
6 | func UnusedFunc2() {}
7 |
--------------------------------------------------------------------------------
/test/testdata/autogenerated/protoc_gen_foo.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-foo
2 | // source: bar.proto
3 | // DO NOT EDIT!!!
4 | package p
5 |
6 | var v int
7 |
--------------------------------------------------------------------------------
/test/testdata/cgo/main.go:
--------------------------------------------------------------------------------
1 | // Package cgoexample ...
2 | package cgoexample
3 |
4 | /*
5 | #include
6 | #include
7 |
8 | void myprint(char* s) {
9 | printf("%d\n", s);
10 | }
11 | */
12 | import "C"
13 |
14 | import (
15 | "unsafe"
16 | )
17 |
18 | // Example ...
19 | func Example() {
20 | cs := C.CString("Hello from stdio\n")
21 | C.myprint(cs)
22 | C.free(unsafe.Pointer(cs))
23 | }
24 |
--------------------------------------------------------------------------------
/test/testdata/configs/custom_linter_goplugin.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | custom:
6 | foo:
7 | type: "goplugin"
8 | path: "bin/linter/myplugin.so"
9 | description: I am a Go plugin system-based custom linter.
10 | settings:
11 | message: hello
12 |
--------------------------------------------------------------------------------
/test/testdata/configs/custom_linter_module.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | custom:
6 | foo:
7 | type: "module"
8 | description: I am a module-based custom linter.
9 | settings:
10 | message: hello
11 |
--------------------------------------------------------------------------------
/test/testdata/configs/custom_linter_notype.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | custom:
6 | foo:
7 | path: "bin/linter/myplugin.so"
8 | description: >
9 | I didn't specify the type, so I am a Go plugin system-based custom linter.
10 | As such, I need to be specified the path.
11 | settings:
12 | message: hello
13 |
--------------------------------------------------------------------------------
/test/testdata/configs/default_exclude.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | staticcheck:
6 | checks:
7 | - all
8 |
9 | exclusions:
10 | presets:
11 | - std-error-handling
12 | - common-false-positives
13 | - legacy
14 |
15 | run:
16 | relative-path-mode: wd
17 |
--------------------------------------------------------------------------------
/test/testdata/configs/multiple-issues-fix.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | formatters:
4 | enable:
5 | - gofumpt
6 | settings:
7 | gofumpt:
8 | extra-rules: true
9 |
10 | run:
11 | relative-path-mode: wd
12 |
--------------------------------------------------------------------------------
/test/testdata/configs/output.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | misspell:
6 | locale: US
7 | ignore-rules:
8 | - langauge
9 | - Dialogue
10 |
11 | run:
12 | relative-path-mode: wd
13 |
--------------------------------------------------------------------------------
/test/testdata/fix/in/multiple-issues-fix.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Emisspell
2 | //golangcitest:config_path testdata/configs/multiple-issues-fix.yml
3 | //golangcitest:expected_exitcode 0
4 | package p
5 |
6 | import "fmt"
7 |
8 | func main() {
9 | //standard greeting
10 | fmt.Println("hello world")
11 | // langauge
12 | }
13 |
--------------------------------------------------------------------------------
/test/testdata/fix/out/multiple-issues-fix.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Emisspell
2 | //golangcitest:config_path testdata/configs/multiple-issues-fix.yml
3 | //golangcitest:expected_exitcode 0
4 | package p
5 |
6 | import "fmt"
7 |
8 | func main() {
9 | // standard greeting
10 | fmt.Println("hello world")
11 | // language
12 | }
13 |
--------------------------------------------------------------------------------
/test/testdata/linedirective/dupl.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | dupl:
6 | threshold: 10
7 |
--------------------------------------------------------------------------------
/test/testdata/linedirective/gomodguard.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | gomodguard:
6 | allowed:
7 | domains:
8 | - github.com
9 |
--------------------------------------------------------------------------------
/test/testdata/linedirective/hello.tmpl:
--------------------------------------------------------------------------------
1 | # This is a template file for some code generator, and is not a valid go source file.
2 |
--------------------------------------------------------------------------------
/test/testdata/linedirective/lll.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | settings:
5 | lll:
6 | line-length: 50
7 |
--------------------------------------------------------------------------------
/test/testdata/minimalpkg/minimalpkg.go:
--------------------------------------------------------------------------------
1 | // Package minimalpkg ...
2 | package minimalpkg
3 |
4 | // SomeTestFunc ...
5 | func SomeTestFunc() {}
6 |
--------------------------------------------------------------------------------
/test/testdata/nogofiles/test.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangci/golangci-lint/c24d5d16f0ce4f571606f6aa5617ddccedbd99a6/test/testdata/nogofiles/test.txt
--------------------------------------------------------------------------------
/test/testdata/notcompiles/typecheck.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Etypecheck
2 | package testdata
3 |
4 | fun NotCompiles() { // want "expected declaration, found.* fun"
5 | }
6 |
--------------------------------------------------------------------------------
/test/testdata/output.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Emisspell
2 | //golangcitest:config_path testdata/configs/output.yml
3 | package testdata
4 |
5 | func Misspell() {
6 | // comment with incorrect spelling: occured // want "`occured` is a misspelling of `occurred`"
7 | }
8 |
9 | // the word langauge should be ignored here: it's set in config
10 | // the word Dialogue should be ignored here: it's set in config
11 |
--------------------------------------------------------------------------------
/test/testdata/path_except.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Eforbidigo
2 | //golangcitest:config_path testdata/configs/path-except.yml
3 | //golangcitest:expected_exitcode 0
4 | package testdata
5 |
6 | import (
7 | "fmt"
8 | "time"
9 | )
10 |
11 | func Forbidigo() {
12 | fmt.Printf("too noisy!!!")
13 | time.Sleep(time.Nanosecond)
14 | }
15 |
--------------------------------------------------------------------------------
/test/testdata/quicktemplate/hello.qtpl:
--------------------------------------------------------------------------------
1 | All text outside function templates is treated as comments,
2 | i.e. it is just ignored by quicktemplate compiler (`qtc`). It is for humans.
3 |
4 | Hello is a simple template function.
5 | {% func Hello(name string) %}
6 | Hello, {%s name %}!
7 | {% endfunc %}
8 |
--------------------------------------------------------------------------------
/test/testdata/sort_results/main.go:
--------------------------------------------------------------------------------
1 | package sortresults
2 |
3 | import (
4 | "database/sql"
5 | "errors"
6 | )
7 |
8 | func returnError() error {
9 | return errors.New("sss")
10 | }
11 |
12 | var db *sql.DB
13 |
14 | func Example() {
15 | returnError()
16 | }
17 |
--------------------------------------------------------------------------------
/test/testdata/symlink_loop/pkg/subpkg:
--------------------------------------------------------------------------------
1 | ../
--------------------------------------------------------------------------------
/test/testdata/symlink_loop/realpkg/p.go:
--------------------------------------------------------------------------------
1 | package p
2 |
--------------------------------------------------------------------------------
/test/testdata/unsafe/pkg.go:
--------------------------------------------------------------------------------
1 | // Package pkg ...
2 | package pkg
3 |
4 | import (
5 | "log"
6 | "unsafe"
7 | )
8 |
9 | // F ...
10 | func F() {
11 | x := 123 // of type int
12 | p := unsafe.Pointer(&x)
13 | pp := &p // of type *unsafe.Pointer
14 | p = unsafe.Pointer(pp)
15 | log.Print(p)
16 | }
17 |
--------------------------------------------------------------------------------
/test/testdata/used_only_in_tests/a.go:
--------------------------------------------------------------------------------
1 | package p
2 |
3 | func f() bool {
4 | return true
5 | }
6 |
--------------------------------------------------------------------------------
/test/testdata/used_only_in_tests/a_test.go:
--------------------------------------------------------------------------------
1 | package p
2 |
3 | import "testing"
4 |
5 | func TestF(t *testing.T) {
6 | if !f() {
7 | t.Fail()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/test/testdata/withconfig/.golangci.yml:
--------------------------------------------------------------------------------
1 | InternalTest: true
--------------------------------------------------------------------------------
/test/testdata/withconfig/pkg/pkg.go:
--------------------------------------------------------------------------------
1 | package pkg
2 |
3 | func SomeTestFunc() {}
4 |
--------------------------------------------------------------------------------
/test/testdata/withtests/p.go:
--------------------------------------------------------------------------------
1 | package withtests
2 |
3 | import "fmt"
4 |
5 | func init() {
6 | fmt.Printf("init")
7 | }
8 |
--------------------------------------------------------------------------------
/test/testdata/withtests/p_test.go:
--------------------------------------------------------------------------------
1 | package withtests
2 |
3 | import (
4 | "fmt"
5 | "testing"
6 | )
7 |
8 | func TestSomething(t *testing.T) {
9 | if true {
10 | return
11 | } else {
12 | fmt.Printf("test")
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/test/testdata/withxtest/p.go:
--------------------------------------------------------------------------------
1 | package p
2 |
--------------------------------------------------------------------------------
/test/testdata/withxtest/p_test.go:
--------------------------------------------------------------------------------
1 | package p_test
2 |
3 | import "fmt"
4 |
5 | func WithGolintIssues(b bool) { //nolint:staticcheck
6 | if b {
7 | return
8 | } else {
9 | fmt.Print("1")
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/test/testdata_etc/abspath/with_issue.go:
--------------------------------------------------------------------------------
1 | package abspath
2 |
3 | import "fmt"
4 |
5 | func f() {
6 | if true {
7 | return
8 | } else {
9 | fmt.Print("")
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/test/testdata_etc/unused_exported/golangci.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | linters:
4 | default: none
5 | enable:
6 | - unused
7 |
--------------------------------------------------------------------------------
/test/testdata_etc/unused_exported/lib/bar_test.go:
--------------------------------------------------------------------------------
1 | package lib
2 |
--------------------------------------------------------------------------------
/test/testdata_etc/unused_exported/lib/foo.go:
--------------------------------------------------------------------------------
1 | package lib
2 |
3 | import (
4 | "fmt"
5 | )
6 |
7 | func PublicFunc() {
8 | privateFunc()
9 | }
10 |
11 | func privateFunc() {
12 | fmt.Println("side effect")
13 | }
14 |
--------------------------------------------------------------------------------
/test/testdata_etc/unused_exported/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "github.com/golangci/golangci-lint/v2/test/testdata_etc/unused_exported/lib"
5 | )
6 |
7 | func main() {
8 | lib.PublicFunc()
9 | }
10 |
--------------------------------------------------------------------------------
/test/testshared/testdata/all.go:
--------------------------------------------------------------------------------
1 | //golangcitest:args -Efoo --simple --hello=world
2 | //golangcitest:config_path testdata/example.yml
3 | //golangcitest:expected_linter bar
4 | //golangcitest:expected_exitcode 0
5 | package testdata
6 |
7 | import "fmt"
8 |
9 | func main() {
10 | fmt.Println("Hello")
11 | }
12 |
--------------------------------------------------------------------------------