diff --git a/.github/contributors/.gitignore b/.github/contributors/.gitignore deleted file mode 100644 index e3ac9bcac450..000000000000 --- a/.github/contributors/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/cache/ -/node_modules/ -*.log -*.tsbuildinfo -/*.js -/contributors.json \ No newline at end of file diff --git a/.github/contributors/.prettierrc.json b/.github/contributors/.prettierrc.json deleted file mode 100644 index 9fe5c358e0bc..000000000000 --- a/.github/contributors/.prettierrc.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "endOfLine": "lf", - "semi": false, - "singleQuote": false, - "tabWidth": 2, - "trailingComma": "es5", - "printWidth": 140, - "parser": "typescript" - } \ No newline at end of file diff --git a/.github/contributors/def.d.ts b/.github/contributors/def.d.ts deleted file mode 100644 index 6200a5adc01b..000000000000 --- a/.github/contributors/def.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare module "name-your-contributors" - -declare module "@octokit/graphql" diff --git a/.github/contributors/generate.ts b/.github/contributors/generate.ts deleted file mode 100644 index beef913ba7ff..000000000000 --- a/.github/contributors/generate.ts +++ /dev/null @@ -1,143 +0,0 @@ -import nyc from "name-your-contributors" -import graphql from "@octokit/graphql" -import * as fs from "fs" -import { ContributorInfo, DataJSON } from "./info" - -type WeightedContributor = { - login: string - weight: number -} - -type Contribution = { - login: string - count: number -} - -const buildWeights = (contributorStats: any[]): Map => { - const loginToTotalWeight: Map = new Map() - - const addContributions = (weight: number, contributions: Contribution[], onlyExisting: boolean) => { - for (const contr of contributions) { - if (onlyExisting && !loginToTotalWeight.has(contr.login)) { - continue - } - loginToTotalWeight.set(contr.login, (loginToTotalWeight.get(contr.login) || 0) + contr.count * weight) - } - } - - for (const stat of contributorStats) { - // totally every pull or commit should account as 10 - addContributions(5, stat.prCreators, false) - addContributions(5, stat.commitAuthors, false) // some commits are out pull requests - } - - for (const stat of contributorStats) { - addContributions(2, stat.prCommentators, true) - addContributions(2, stat.issueCreators, true) - addContributions(2, stat.issueCommentators, true) - addContributions(2, stat.reviewers, true) - addContributions(0.3, stat.reactors, true) - } - - return loginToTotalWeight -} - -const buildContributorInfo = async (contributors: WeightedContributor[]): Promise => { - const query = `{ - ${contributors.map((c, i) => `user${i}: user(login: "${c.login}") {...UserFragment}`).join(`\n`)} - } - fragment UserFragment on User { - login - name - websiteUrl - avatarUrl - }` - - try { - const resp = await graphql.graphql(query, { - headers: { - authorization: `token ${process.env.GITHUB_TOKEN}`, - }, - }) - - return contributors.map((_, i) => resp[`user${i}`]).filter((v) => v) - } catch (err) { - if (err.errors && err.data) { - console.warn(`github errors:`, err.errors) - return contributors.map((_, i) => err.data[`user${i}`]).filter((v) => v) - } - throw err - } -} - -const buildCoreTeamInfo = async (): Promise => { - const query = `{ - organization(login:"golangci"){ - team(slug:"core-team"){ - members { - nodes { - login - name - websiteUrl - avatarUrl - } - } - } - } - }` - const resp = await graphql.graphql(query, { - headers: { - authorization: `token ${process.env.GITHUB_TOKEN}`, - }, - }) - - return resp.organization.team.members.nodes -} - -const main = async () => { - try { - const repos = [`golangci-lint`, `golangci-lint-action`] - const promises = repos.map((repo) => - nyc.repoContributors({ - token: process.env.GITHUB_TOKEN, - user: `golangci`, - repo, - before: new Date(), - after: new Date(0), - commits: true, - reactions: true, - }) - ) - const contributorStats = await Promise.all(promises) - console.info(`Got stat for repos ${repos}`) - const loginToWeight = buildWeights(contributorStats) - const weightedContributors: WeightedContributor[] = [] - loginToWeight.forEach((weight, login) => weightedContributors.push({ login, weight })) - - weightedContributors.sort((a, b) => b.weight - a.weight) - const coreTeamInfo = await buildCoreTeamInfo() - const contributorsInfo = await buildContributorInfo(weightedContributors) - const exclude: any = { - golangcidev: true, - CLAassistant: true, - renovate: true, - fossabot: true, - golangcibot: true, - kortschak: true, - "golangci-releaser": true, - } - - const res: DataJSON = { - contributors: contributorsInfo.filter((c) => !exclude[c.login] && !coreTeamInfo.find((ct) => ct.login === c.login)), - coreTeam: coreTeamInfo.sort((a, b) => (loginToWeight.get(b.login) || 0) - (loginToWeight.get(a.login) || 0)), - } - console.info(res) - fs.writeFileSync("contributors.json", JSON.stringify(res, null, 2)) - } catch (err) { - console.error(`Failed to get repo contributors`, err) - process.exit(1) - } - console.info(`Success`) -} - -main() diff --git a/.github/contributors/info.ts b/.github/contributors/info.ts deleted file mode 100644 index fbb768f7a292..000000000000 --- a/.github/contributors/info.ts +++ /dev/null @@ -1,11 +0,0 @@ -export type ContributorInfo = { - login: string - name: string - avatarUrl: string - websiteUrl: string -} - -export type DataJSON = { - contributors: ContributorInfo[] - coreTeam: ContributorInfo[] -} diff --git a/.github/contributors/package-lock.json b/.github/contributors/package-lock.json deleted file mode 100644 index c14723a8d966..000000000000 --- a/.github/contributors/package-lock.json +++ /dev/null @@ -1,1541 +0,0 @@ -{ - "name": "contributors", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "version": "1.0.0", - "license": "MIT", - "dependencies": { - "@octokit/graphql": "^4.4.0", - "@types/node": "^14.0.1", - "name-your-contributors": "^3.8.3", - "typescript": "^3.9.2" - } - }, - "node_modules/@octokit/endpoint": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.1.tgz", - "integrity": "sha512-pOPHaSz57SFT/m3R5P8MUu4wLPszokn5pXcB/pzavLTQf2jbU+6iayTvzaY6/BiotuRS0qyEUkx3QglT4U958A==", - "dependencies": { - "@octokit/types": "^2.11.1", - "is-plain-object": "^3.0.0", - "universal-user-agent": "^5.0.0" - } - }, - "node_modules/@octokit/graphql": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.4.0.tgz", - "integrity": "sha512-Du3hAaSROQ8EatmYoSAJjzAz3t79t9Opj/WY1zUgxVUGfIKn0AEjg+hlOLscF6fv6i/4y/CeUvsWgIfwMkTccw==", - "dependencies": { - "@octokit/request": "^5.3.0", - "@octokit/types": "^2.0.0", - "universal-user-agent": "^5.0.0" - } - }, - "node_modules/@octokit/request": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.2.tgz", - "integrity": "sha512-zKdnGuQ2TQ2vFk9VU8awFT4+EYf92Z/v3OlzRaSh4RIP0H6cvW1BFPXq4XYvNez+TPQjqN+0uSkCYnMFFhcFrw==", - "dependencies": { - "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.0.0", - "@octokit/types": "^2.11.1", - "deprecation": "^2.0.0", - "is-plain-object": "^3.0.0", - "node-fetch": "^2.3.0", - "once": "^1.4.0", - "universal-user-agent": "^5.0.0" - } - }, - "node_modules/@octokit/request-error": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.0.tgz", - "integrity": "sha512-rtYicB4Absc60rUv74Rjpzek84UbVHGHJRu4fNVlZ1mCcyUPPuzFfG9Rn6sjHrd95DEsmjSt1Axlc699ZlbDkw==", - "dependencies": { - "@octokit/types": "^2.0.0", - "deprecation": "^2.0.0", - "once": "^1.4.0" - } - }, - "node_modules/@octokit/types": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", - "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", - "dependencies": { - "@types/node": ">= 8" - } - }, - "node_modules/@types/node": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.1.tgz", - "integrity": "sha512-FAYBGwC+W6F9+huFIDtn43cpy7+SzG+atzRiTfdp3inUKL2hXnd4rG8hylJLIh4+hqrQy1P17kvJByE/z825hA==" - }, - "node_modules/array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "engines": { - "node": ">=4" - } - }, - "node_modules/camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "dependencies": { - "camelcase": "^4.1.0", - "map-obj": "^2.0.0", - "quick-lru": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "engines": { - "node": ">=4.8" - } - }, - "node_modules/csv-writer": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/csv-writer/-/csv-writer-1.2.0.tgz", - "integrity": "sha512-ZU7eZ26y7oIOXwFHhTNnT/tF6RXMdQnuTGofzNTe1cvXacZm3Ixd7Oa9mOp2f1t39Ezfzg0h5tqfOjXM180BOg==" - }, - "node_modules/currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "dependencies": { - "array-find-index": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/decamelize-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", - "dependencies": { - "decamelize": "^1.1.0", - "map-obj": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/decamelize-keys/node_modules/map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, - "node_modules/execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dependencies": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" - }, - "node_modules/hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" - }, - "node_modules/indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "engines": { - "node": ">=4" - } - }, - "node_modules/is": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/is/-/is-0.2.7.tgz", - "integrity": "sha1-OzSixI81mXLzUEKEkZOucmS2NWI=", - "engines": { - "node": "*" - } - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" - }, - "node_modules/is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-plain-object": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", - "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", - "dependencies": { - "isobject": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "node_modules/isobject": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", - "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" - }, - "node_modules/load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "dependencies": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/macos-release": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz", - "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==", - "engines": { - "node": ">=6" - } - }, - "node_modules/map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", - "engines": { - "node": ">=4" - } - }, - "node_modules/meow": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", - "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", - "dependencies": { - "camelcase-keys": "^4.0.0", - "decamelize-keys": "^1.0.0", - "loud-rejection": "^1.0.0", - "minimist": "^1.1.3", - "minimist-options": "^3.0.1", - "normalize-package-data": "^2.3.4", - "read-pkg-up": "^3.0.0", - "redent": "^2.0.0", - "trim-newlines": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" - }, - "node_modules/minimist-options": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", - "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", - "dependencies": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0" - }, - "engines": { - "node": ">= 4" - } - }, - "node_modules/mkdirp-no-bin": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp-no-bin/-/mkdirp-no-bin-0.5.1.tgz", - "integrity": "sha1-NMYjGW02+y7i5WGrYHMFYy4AYZ8=" - }, - "node_modules/moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", - "engines": { - "node": "*" - } - }, - "node_modules/month-before-after": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/month-before-after/-/month-before-after-1.0.0.tgz", - "integrity": "sha512-fJDbhg6BBpZj4e+0GZMPEtMbp8SAh9/XtK75BoBRenftz7OQJKIf56G5CIH7tjYkklJnNxzjY30+CzTPcgH6AA==", - "dependencies": { - "moment": "^2.24.0" - } - }, - "node_modules/name-your-contributors": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/name-your-contributors/-/name-your-contributors-3.8.3.tgz", - "integrity": "sha512-b1grTAd6wvuvXx4MDJlXbZEZBhGuTX6x/FsnN1PGXSkMRqntTC5/Q+XsMq1bjfTty6cQDbtgdJ5DGoCiKFjudQ==", - "dependencies": { - "csv-writer": "1.2.0", - "meow": "^4.0.0", - "month-before-after": "^1.0.0", - "persistent-cache": "^1.1.1" - }, - "bin": { - "name-your-contributors": "src/cli.js" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" - }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node.extend": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/node.extend/-/node.extend-1.0.8.tgz", - "integrity": "sha1-urBDefc4P0WHmQyd8Htqf2Xbdys=", - "engines": [ - "node >= 0.4.0" - ], - "dependencies": { - "is": "~0.2.6", - "object-keys": "~0.4.0" - } - }, - "node_modules/node.flow": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/node.flow/-/node.flow-1.2.3.tgz", - "integrity": "sha1-4cRKgq7KjXi0WKd/s9xkLy66Jkk=", - "engines": [ - "node >= 0.4.0" - ], - "dependencies": { - "node.extend": "1.0.8" - } - }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dependencies": { - "path-key": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/object-keys": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/os-name": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", - "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", - "dependencies": { - "macos-release": "^2.2.0", - "windows-release": "^3.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "engines": { - "node": ">=4" - } - }, - "node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "engines": { - "node": ">=4" - } - }, - "node_modules/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dependencies": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "engines": { - "node": ">=4" - } - }, - "node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "engines": { - "node": ">=4" - } - }, - "node_modules/path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" - }, - "node_modules/path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dependencies": { - "pify": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/persistent-cache": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/persistent-cache/-/persistent-cache-1.1.1.tgz", - "integrity": "sha1-ndiBPghcSrowmHsI4RqcqGpipUw=", - "dependencies": { - "mkdirp-no-bin": "^0.5.1", - "rmdir": "^1.2.0" - } - }, - "node_modules/pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "engines": { - "node": ">=4" - } - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/quick-lru": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", - "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dependencies": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dependencies": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "dependencies": { - "indent-string": "^3.0.0", - "strip-indent": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "dependencies": { - "path-parse": "^1.0.6" - } - }, - "node_modules/rmdir": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/rmdir/-/rmdir-1.2.0.tgz", - "integrity": "sha1-T+A1fLBhaMJY5z6WgJPcTooPMlM=", - "engines": [ - "node >= 0.8.0" - ], - "dependencies": { - "node.flow": "1.2.3" - } - }, - "node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" - }, - "node_modules/spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" - }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "engines": { - "node": ">=4" - } - }, - "node_modules/strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "engines": { - "node": ">=4" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "node_modules/trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", - "engines": { - "node": ">=4" - } - }, - "node_modules/typescript": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.2.tgz", - "integrity": "sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/universal-user-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz", - "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==", - "dependencies": { - "os-name": "^3.1.0" - } - }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/windows-release": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.0.tgz", - "integrity": "sha512-2HetyTg1Y+R+rUgrKeUEhAG/ZuOmTrI1NBb3ZyAGQMYmOJjBBPe4MTodghRkmLJZHwkuPi02anbeGP+Zf401LQ==", - "dependencies": { - "execa": "^1.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - } - }, - "dependencies": { - "@octokit/endpoint": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.1.tgz", - "integrity": "sha512-pOPHaSz57SFT/m3R5P8MUu4wLPszokn5pXcB/pzavLTQf2jbU+6iayTvzaY6/BiotuRS0qyEUkx3QglT4U958A==", - "requires": { - "@octokit/types": "^2.11.1", - "is-plain-object": "^3.0.0", - "universal-user-agent": "^5.0.0" - } - }, - "@octokit/graphql": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.4.0.tgz", - "integrity": "sha512-Du3hAaSROQ8EatmYoSAJjzAz3t79t9Opj/WY1zUgxVUGfIKn0AEjg+hlOLscF6fv6i/4y/CeUvsWgIfwMkTccw==", - "requires": { - "@octokit/request": "^5.3.0", - "@octokit/types": "^2.0.0", - "universal-user-agent": "^5.0.0" - } - }, - "@octokit/request": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.2.tgz", - "integrity": "sha512-zKdnGuQ2TQ2vFk9VU8awFT4+EYf92Z/v3OlzRaSh4RIP0H6cvW1BFPXq4XYvNez+TPQjqN+0uSkCYnMFFhcFrw==", - "requires": { - "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.0.0", - "@octokit/types": "^2.11.1", - "deprecation": "^2.0.0", - "is-plain-object": "^3.0.0", - "node-fetch": "^2.3.0", - "once": "^1.4.0", - "universal-user-agent": "^5.0.0" - } - }, - "@octokit/request-error": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.0.tgz", - "integrity": "sha512-rtYicB4Absc60rUv74Rjpzek84UbVHGHJRu4fNVlZ1mCcyUPPuzFfG9Rn6sjHrd95DEsmjSt1Axlc699ZlbDkw==", - "requires": { - "@octokit/types": "^2.0.0", - "deprecation": "^2.0.0", - "once": "^1.4.0" - } - }, - "@octokit/types": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", - "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", - "requires": { - "@types/node": ">= 8" - } - }, - "@types/node": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.1.tgz", - "integrity": "sha512-FAYBGwC+W6F9+huFIDtn43cpy7+SzG+atzRiTfdp3inUKL2hXnd4rG8hylJLIh4+hqrQy1P17kvJByE/z825hA==" - }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=" - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" - }, - "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "requires": { - "camelcase": "^4.1.0", - "map-obj": "^2.0.0", - "quick-lru": "^1.0.0" - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "csv-writer": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/csv-writer/-/csv-writer-1.2.0.tgz", - "integrity": "sha512-ZU7eZ26y7oIOXwFHhTNnT/tF6RXMdQnuTGofzNTe1cvXacZm3Ixd7Oa9mOp2f1t39Ezfzg0h5tqfOjXM180BOg==" - }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "requires": { - "array-find-index": "^1.0.1" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, - "decamelize-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", - "requires": { - "decamelize": "^1.1.0", - "map-obj": "^1.0.0" - }, - "dependencies": { - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" - } - } - }, - "deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "requires": { - "once": "^1.4.0" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "requires": { - "locate-path": "^2.0.0" - } - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "requires": { - "pump": "^3.0.0" - } - }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" - }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=" - }, - "is": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/is/-/is-0.2.7.tgz", - "integrity": "sha1-OzSixI81mXLzUEKEkZOucmS2NWI=" - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" - }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" - }, - "is-plain-object": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", - "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", - "requires": { - "isobject": "^4.0.0" - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "isobject": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", - "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==" - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } - }, - "macos-release": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz", - "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==" - }, - "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=" - }, - "meow": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", - "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", - "requires": { - "camelcase-keys": "^4.0.0", - "decamelize-keys": "^1.0.0", - "loud-rejection": "^1.0.0", - "minimist": "^1.1.3", - "minimist-options": "^3.0.1", - "normalize-package-data": "^2.3.4", - "read-pkg-up": "^3.0.0", - "redent": "^2.0.0", - "trim-newlines": "^2.0.0" - } - }, - "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" - }, - "minimist-options": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", - "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", - "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0" - } - }, - "mkdirp-no-bin": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp-no-bin/-/mkdirp-no-bin-0.5.1.tgz", - "integrity": "sha1-NMYjGW02+y7i5WGrYHMFYy4AYZ8=" - }, - "moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==" - }, - "month-before-after": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/month-before-after/-/month-before-after-1.0.0.tgz", - "integrity": "sha512-fJDbhg6BBpZj4e+0GZMPEtMbp8SAh9/XtK75BoBRenftz7OQJKIf56G5CIH7tjYkklJnNxzjY30+CzTPcgH6AA==", - "requires": { - "moment": "^2.24.0" - } - }, - "name-your-contributors": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/name-your-contributors/-/name-your-contributors-3.8.3.tgz", - "integrity": "sha512-b1grTAd6wvuvXx4MDJlXbZEZBhGuTX6x/FsnN1PGXSkMRqntTC5/Q+XsMq1bjfTty6cQDbtgdJ5DGoCiKFjudQ==", - "requires": { - "csv-writer": "1.2.0", - "meow": "^4.0.0", - "month-before-after": "^1.0.0", - "persistent-cache": "^1.1.1" - } - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" - }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "node.extend": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/node.extend/-/node.extend-1.0.8.tgz", - "integrity": "sha1-urBDefc4P0WHmQyd8Htqf2Xbdys=", - "requires": { - "is": "~0.2.6", - "object-keys": "~0.4.0" - } - }, - "node.flow": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/node.flow/-/node.flow-1.2.3.tgz", - "integrity": "sha1-4cRKgq7KjXi0WKd/s9xkLy66Jkk=", - "requires": { - "node.extend": "1.0.8" - } - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "requires": { - "path-key": "^2.0.0" - } - }, - "object-keys": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "os-name": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", - "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", - "requires": { - "macos-release": "^2.2.0", - "windows-release": "^3.1.0" - } - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "requires": { - "pify": "^3.0.0" - } - }, - "persistent-cache": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/persistent-cache/-/persistent-cache-1.1.1.tgz", - "integrity": "sha1-ndiBPghcSrowmHsI4RqcqGpipUw=", - "requires": { - "mkdirp-no-bin": "^0.5.1", - "rmdir": "^1.2.0" - } - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "quick-lru": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", - "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=" - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } - }, - "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "requires": { - "indent-string": "^3.0.0", - "strip-indent": "^2.0.0" - } - }, - "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "requires": { - "path-parse": "^1.0.6" - } - }, - "rmdir": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/rmdir/-/rmdir-1.2.0.tgz", - "integrity": "sha1-T+A1fLBhaMJY5z6WgJPcTooPMlM=", - "requires": { - "node.flow": "1.2.3" - } - }, - "semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" - }, - "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" - }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" - }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" - }, - "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=" - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=" - }, - "typescript": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.2.tgz", - "integrity": "sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==" - }, - "universal-user-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz", - "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==", - "requires": { - "os-name": "^3.1.0" - } - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "requires": { - "isexe": "^2.0.0" - } - }, - "windows-release": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.0.tgz", - "integrity": "sha512-2HetyTg1Y+R+rUgrKeUEhAG/ZuOmTrI1NBb3ZyAGQMYmOJjBBPe4MTodghRkmLJZHwkuPi02anbeGP+Zf401LQ==", - "requires": { - "execa": "^1.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - } - } -} diff --git a/.github/contributors/package.json b/.github/contributors/package.json deleted file mode 100644 index 25d22d79c9fb..000000000000 --- a/.github/contributors/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "contributors", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "gen": "tsc && node --trace-warnings ./generate.js", - "rewrite_readme": "tsc && node --trace-warnings ./rewrite_readme.js", - "all": "npm run gen && npm run rewrite_readme" - }, - "author": "", - "license": "MIT", - "type": "module", - "dependencies": { - "@octokit/graphql": "^4.4.0", - "@types/node": "^14.0.1", - "name-your-contributors": "^3.8.3", - "typescript": "^3.9.2" - } -} diff --git a/.github/contributors/rewrite_readme.ts b/.github/contributors/rewrite_readme.ts deleted file mode 100644 index 3417b2ea90ff..000000000000 --- a/.github/contributors/rewrite_readme.ts +++ /dev/null @@ -1,100 +0,0 @@ -import * as fs from "fs" -import * as path from "path" -import { ContributorInfo, DataJSON } from "./info" - -const main = async () => { - const readmePath = path.join(`..`, `..`, `README.md`) - const contentBuf = fs.readFileSync(readmePath) - const beginPattern = `\n` - const endPattern = `\n` - - const beginIndex = contentBuf.indexOf(beginPattern) - const endIndex = contentBuf.indexOf(endPattern) - if (beginIndex < 0 || endIndex < 0 || beginIndex >= endIndex) { - throw new Error(`no valid patterns in readme: beginIndex=${beginIndex}, endIndex=${endIndex}`) - } - - const contributors = buildContributorsContent() - const rewrittenContent = - contentBuf.slice(0, beginIndex + beginPattern.length).toString() + contributors + contentBuf.slice(endIndex).toString() - - // it's not atomic, TODO: use rename - fs.writeFileSync(readmePath, rewrittenContent) -} - -const colPerRow = 7 -const rowsVisible = 5 - -const buildContributorsTable = (contributors: ContributorInfo[]): string => { - type Contributors = ContributorInfo[] - const rows: Contributors[] = [] - for (let i = 0; i < contributors.length; ) { - rows.push(contributors.slice(i, i + colPerRow)) - i += colPerRow - } - - return ` -${rows - .map( - (row) => - `\n${row - .map( - (c) => - ` ` - ) - .join(`\n`)}\n` - ) - .join(`\n`)} -

${ - c.name ? c.name : `@${c.login}` - }
` -} - -const buildContributorsContent = (): string => { - const data: DataJSON = JSON.parse(fs.readFileSync(`contributors.json`).toString()) - - const visibleCount = colPerRow * rowsVisible - const hiddenCount = data.contributors.length - visibleCount - - return ` - -### Core Team - -
-About core team - -The GolangCI Core Team is a group of contributors who have demonstrated a lasting enthusiasm for the project and community. -The GolangCI Core Team has GitHub admin privileges on the repo. - -#### Responsibilities - -The Core Team has the following responsibilities: - -1. Being available to answer high-level questions about vision and future. -2. Being available to review longstanding/forgotten pull requests. -3. Occasionally check issues, offer input, and categorize with GitHub issue labels. -4. Looking out for up-and-coming members of the GolangCI community who might want to serve as Core Team members. -5. Note that the Core Team – and all GolangCI contributors – are open-source volunteers; membership on the Core Team is expressly not an obligation. The Core Team is distinguished as leaders in the community and while they are a good group to turn to when someone needs an answer to a question, they are still volunteering their time, and may not be available to help immediately. - -
- -${buildContributorsTable(data.coreTeam)} - -### Team - -${buildContributorsTable(data.contributors.slice(0, visibleCount))} - -
-And ${hiddenCount} more our team members - -${buildContributorsTable(data.contributors.slice(visibleCount))} - -
- - -` -} - -main() diff --git a/.github/contributors/tsconfig.json b/.github/contributors/tsconfig.json deleted file mode 100644 index 16d9c5118f2e..000000000000 --- a/.github/contributors/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "esModuleInterop": false, - "target": "es2015", - "module": "es2015", - "lib": ["es2015"], - "strict": true, - "incremental": true - } -} diff --git a/.github/peril/package-lock.json b/.github/peril/package-lock.json index b206957d34f8..4bb363ae5281 100644 --- a/.github/peril/package-lock.json +++ b/.github/peril/package-lock.json @@ -1145,9 +1145,9 @@ } }, "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.5.tgz", + "integrity": "sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==", "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index 951c70b7572f..c8b68958bae3 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -9,41 +9,9 @@ env: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - GO_VERSION: '1.23' + GO_VERSION: "1.23" jobs: - update-docs: - name: "Update readme" - continue-on-error: true - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/setup-node@v4 - with: - node-version: "15" - check-latest: true - - - name: npm install - working-directory: .github/contributors - run: npm install - - - name: Update Contributors list - run: make update_contributors_list # may take more than 1 hour - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v7 - with: - base: master - token: ${{ secrets.GOLANGCI_LINT_TOKEN }} - branch-suffix: timestamp - title: "docs: update documentation" - delete-branch: true - update-gha-assets: name: "Update GitHub Action assets" runs-on: ubuntu-latest diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 03b380b2bab2..7f6e4eacc7db 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -52,6 +52,9 @@ jobs: echo 'mono /opt/chocolatey/choco.exe $@' >> /usr/local/bin/choco chmod +x /usr/local/bin/choco + - name: Install snapcraft + run: sudo snap install snapcraft --classic + - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -67,5 +70,7 @@ jobs: version: latest args: release --clean --timeout=90m env: + AUR_KEY: ${{ secrets.AUR_KEY }} CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }} + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }} diff --git a/.golangci.next.reference.yml b/.golangci.next.reference.yml index 44d371c498c9..708cf8048c17 100644 --- a/.golangci.next.reference.yml +++ b/.golangci.next.reference.yml @@ -700,7 +700,7 @@ linters-settings: # Default: false disable-all: true # Which checks should be enabled in addition to default checks; can't be combined with 'disabled-checks'. - # By default, list of stable checks is used (https://go-critic.github.io/overview#checks-overview): + # By default, list of stable checks is used (https://go-critic.com/overview#checks-overview): # appendAssign, argOrder, assignOp, badCall, badCond, captLocal, caseOrder, codegenComment, commentFormatting, # defaultCaseOrder, deprecatedComment, dupArg, dupBranchBody, dupCase, dupSubExpr, elseif, exitAfterDefer, # flagDeref, flagName, ifElseChain, mapKey, newDeref, offBy1, regexpMust, singleCaseSwitch, sloppyLen, @@ -708,322 +708,322 @@ linters-settings: # To see which checks are enabled run `GL_DEBUG=gocritic golangci-lint run --enable=gocritic`. enabled-checks: # Detects suspicious append result assignments. - # https://go-critic.com/overview.html#appendAssign + # https://go-critic.com/overview.html#appendassign - appendAssign # Detects `append` chains to the same slice that can be done in a single `append` call. - # https://go-critic.com/overview.html#appendCombine + # https://go-critic.com/overview.html#appendcombine - appendCombine # Detects suspicious arguments order. - # https://go-critic.com/overview.html#argOrder + # https://go-critic.com/overview.html#argorder - argOrder # Detects assignments that can be simplified by using assignment operators. - # https://go-critic.com/overview.html#assignOp + # https://go-critic.com/overview.html#assignop - assignOp # Detects suspicious function calls. - # https://go-critic.com/overview.html#badCall + # https://go-critic.com/overview.html#badcall - badCall # Detects suspicious condition expressions. - # https://go-critic.com/overview.html#badCond + # https://go-critic.com/overview.html#badcond - badCond # Detects suspicious mutex lock/unlock operations. - # https://go-critic.com/overview.html#badLock + # https://go-critic.com/overview.html#badlock - badLock # Detects suspicious regexp patterns. - # https://go-critic.com/overview.html#badRegexp + # https://go-critic.com/overview.html#badregexp - badRegexp # Detects bad usage of sort package. - # https://go-critic.com/overview.html#badSorting + # https://go-critic.com/overview.html#badsorting - badSorting # Detects bad usage of sync.OnceFunc. - # https://go-critic.com/overview.html#badSyncOnceFunc + # https://go-critic.com/overview.html#badsynconcefunc - badSyncOnceFunc # Detects bool expressions that can be simplified. - # https://go-critic.com/overview.html#boolExprSimplify + # https://go-critic.com/overview.html#boolexprsimplify - boolExprSimplify # Detects when predeclared identifiers are shadowed in assignments. - # https://go-critic.com/overview.html#builtinShadow + # https://go-critic.com/overview.html#builtinshadow - builtinShadow # Detects top-level declarations that shadow the predeclared identifiers. - # https://go-critic.com/overview.html#builtinShadowDecl + # https://go-critic.com/overview.html#builtinshadowdecl - builtinShadowDecl # Detects capitalized names for local variables. - # https://go-critic.com/overview.html#captLocal + # https://go-critic.com/overview.html#captlocal - captLocal # Detects erroneous case order inside switch statements. - # https://go-critic.com/overview.html#caseOrder + # https://go-critic.com/overview.html#caseorder - caseOrder # Detects malformed 'code generated' file comments. - # https://go-critic.com/overview.html#codegenComment + # https://go-critic.com/overview.html#codegencomment - codegenComment # Detects comments with non-idiomatic formatting. - # https://go-critic.com/overview.html#commentFormatting + # https://go-critic.com/overview.html#commentformatting - commentFormatting # Detects commented-out code inside function bodies. - # https://go-critic.com/overview.html#commentedOutCode + # https://go-critic.com/overview.html#commentedoutcode - commentedOutCode # Detects commented-out imports. - # https://go-critic.com/overview.html#commentedOutImport + # https://go-critic.com/overview.html#commentedoutimport - commentedOutImport # Detects when default case in switch isn't on 1st or last position. - # https://go-critic.com/overview.html#defaultCaseOrder + # https://go-critic.com/overview.html#defaultcaseorder - defaultCaseOrder # Detects loops inside functions that use defer. - # https://go-critic.com/overview.html#deferInLoop + # https://go-critic.com/overview.html#deferinloop - deferInLoop # Detects deferred function literals that can be simplified. - # https://go-critic.com/overview.html#deferUnlambda + # https://go-critic.com/overview.html#deferunlambda - deferUnlambda # Detects malformed 'deprecated' doc-comments. - # https://go-critic.com/overview.html#deprecatedComment + # https://go-critic.com/overview.html#deprecatedcomment - deprecatedComment # Detects comments that silence go lint complaints about doc-comment. - # https://go-critic.com/overview.html#docStub + # https://go-critic.com/overview.html#docstub - docStub # Detects suspicious duplicated arguments. - # https://go-critic.com/overview.html#dupArg + # https://go-critic.com/overview.html#duparg - dupArg # Detects duplicated branch bodies inside conditional statements. - # https://go-critic.com/overview.html#dupBranchBody + # https://go-critic.com/overview.html#dupbranchbody - dupBranchBody # Detects duplicated case clauses inside switch or select statements. - # https://go-critic.com/overview.html#dupCase + # https://go-critic.com/overview.html#dupcase - dupCase # Detects multiple imports of the same package under different aliases. - # https://go-critic.com/overview.html#dupImport + # https://go-critic.com/overview.html#dupimport - dupImport # Detects suspicious duplicated sub-expressions. - # https://go-critic.com/overview.html#dupSubExpr + # https://go-critic.com/overview.html#dupsubexpr - dupSubExpr # Detects suspicious formatting strings usage. - # https://go-critic.com/overview.html#dynamicFmtString + # https://go-critic.com/overview.html#dynamicfmtstring - dynamicFmtString # Detects else with nested if statement that can be replaced with else-if. # https://go-critic.com/overview.html#elseif - elseif # Detects suspicious empty declarations blocks. - # https://go-critic.com/overview.html#emptyDecl + # https://go-critic.com/overview.html#emptydecl - emptyDecl # Detects fallthrough that can be avoided by using multi case values. - # https://go-critic.com/overview.html#emptyFallthrough + # https://go-critic.com/overview.html#emptyfallthrough - emptyFallthrough # Detects empty string checks that can be written more idiomatically. - # https://go-critic.com/overview.html#emptyStringTest + # https://go-critic.com/overview.html#emptystringtest - emptyStringTest # Detects unoptimal strings/bytes case-insensitive comparison. - # https://go-critic.com/overview.html#equalFold + # https://go-critic.com/overview.html#equalfold - equalFold # Detects unwanted dependencies on the evaluation order. - # https://go-critic.com/overview.html#evalOrder + # https://go-critic.com/overview.html#evalorder - evalOrder # Detects calls to exit/fatal inside functions that use defer. - # https://go-critic.com/overview.html#exitAfterDefer + # https://go-critic.com/overview.html#exitafterdefer - exitAfterDefer # Detects exposed methods from sync.Mutex and sync.RWMutex. - # https://go-critic.com/overview.html#exposedSyncMutex + # https://go-critic.com/overview.html#exposedsyncmutex - exposedSyncMutex # Detects suspicious reassignment of error from another package. - # https://go-critic.com/overview.html#externalErrorReassign + # https://go-critic.com/overview.html#externalerrorreassign - externalErrorReassign # Detects problems in filepath.Join() function calls. - # https://go-critic.com/overview.html#filepathJoin + # https://go-critic.com/overview.html#filepathjoin - filepathJoin # Detects immediate dereferencing of `flag` package pointers. - # https://go-critic.com/overview.html#flagDeref + # https://go-critic.com/overview.html#flagderef - flagDeref # Detects suspicious flag names. - # https://go-critic.com/overview.html#flagName + # https://go-critic.com/overview.html#flagname - flagName # Detects hex literals that have mixed case letter digits. - # https://go-critic.com/overview.html#hexLiteral + # https://go-critic.com/overview.html#hexliteral - hexLiteral # Detects nil usages in http.NewRequest calls, suggesting http.NoBody as an alternative. - # https://go-critic.com/overview.html#httpNoBody + # https://go-critic.com/overview.html#httpnobody - httpNoBody # Detects params that incur excessive amount of copying. - # https://go-critic.com/overview.html#hugeParam + # https://go-critic.com/overview.html#hugeparam - hugeParam # Detects repeated if-else statements and suggests to replace them with switch statement. - # https://go-critic.com/overview.html#ifElseChain + # https://go-critic.com/overview.html#ifelsechain - ifElseChain # Detects when imported package names shadowed in the assignments. - # https://go-critic.com/overview.html#importShadow + # https://go-critic.com/overview.html#importshadow - importShadow # Detects strings.Index calls that may cause unwanted allocs. - # https://go-critic.com/overview.html#indexAlloc + # https://go-critic.com/overview.html#indexalloc - indexAlloc # Detects non-assignment statements inside if/switch init clause. - # https://go-critic.com/overview.html#initClause + # https://go-critic.com/overview.html#initclause - initClause # Detects suspicious map literal keys. - # https://go-critic.com/overview.html#mapKey + # https://go-critic.com/overview.html#mapkey - mapKey # Detects method expression call that can be replaced with a method call. - # https://go-critic.com/overview.html#methodExprCall + # https://go-critic.com/overview.html#methodexprcall - methodExprCall # Finds where nesting level could be reduced. - # https://go-critic.com/overview.html#nestingReduce + # https://go-critic.com/overview.html#nestingreduce - nestingReduce # Detects immediate dereferencing of `new` expressions. - # https://go-critic.com/overview.html#newDeref + # https://go-critic.com/overview.html#newderef - newDeref # Detects return statements those results evaluate to nil. - # https://go-critic.com/overview.html#nilValReturn + # https://go-critic.com/overview.html#nilvalreturn - nilValReturn # Detects old-style octal literals. - # https://go-critic.com/overview.html#octalLiteral + # https://go-critic.com/overview.html#octalliteral - octalLiteral # Detects various off-by-one kind of errors. - # https://go-critic.com/overview.html#offBy1 + # https://go-critic.com/overview.html#offby1 - offBy1 # Detects if function parameters could be combined by type and suggest the way to do it. - # https://go-critic.com/overview.html#paramTypeCombine + # https://go-critic.com/overview.html#paramtypecombine - paramTypeCombine # Detects expressions like []rune(s)[0] that may cause unwanted rune slice allocation. - # https://go-critic.com/overview.html#preferDecodeRune + # https://go-critic.com/overview.html#preferdecoderune - preferDecodeRune # Detects concatenation with os.PathSeparator which can be replaced with filepath.Join. - # https://go-critic.com/overview.html#preferFilepathJoin + # https://go-critic.com/overview.html#preferfilepathjoin - preferFilepathJoin # Detects fmt.Sprint(f/ln) calls which can be replaced with fmt.Fprint(f/ln). - # https://go-critic.com/overview.html#preferFprint + # https://go-critic.com/overview.html#preferfprint - preferFprint # Detects w.Write or io.WriteString calls which can be replaced with w.WriteString. - # https://go-critic.com/overview.html#preferStringWriter + # https://go-critic.com/overview.html#preferstringwriter - preferStringWriter # Detects WriteRune calls with rune literal argument that is single byte and reports to use WriteByte instead. - # https://go-critic.com/overview.html#preferWriteByte + # https://go-critic.com/overview.html#preferwritebyte - preferWriteByte # Detects input and output parameters that have a type of pointer to referential type. - # https://go-critic.com/overview.html#ptrToRefParam + # https://go-critic.com/overview.html#ptrtorefparam - ptrToRefParam # Detects append all its data while range it. - # https://go-critic.com/overview.html#rangeAppendAll + # https://go-critic.com/overview.html#rangeappendall - rangeAppendAll # Detects expensive copies of `for` loop range expressions. - # https://go-critic.com/overview.html#rangeExprCopy + # https://go-critic.com/overview.html#rangeexprcopy - rangeExprCopy # Detects loops that copy big objects during each iteration. - # https://go-critic.com/overview.html#rangeValCopy + # https://go-critic.com/overview.html#rangevalcopy - rangeValCopy # Detects redundant fmt.Sprint calls. - # https://go-critic.com/overview.html#redundantSprint + # https://go-critic.com/overview.html#redundantsprint - redundantSprint # Detects `regexp.Compile*` that can be replaced with `regexp.MustCompile*`. - # https://go-critic.com/overview.html#regexpMust + # https://go-critic.com/overview.html#regexpmust - regexpMust # Detects suspicious regexp patterns. - # https://go-critic.com/overview.html#regexpPattern + # https://go-critic.com/overview.html#regexppattern - regexpPattern # Detects regexp patterns that can be simplified. - # https://go-critic.com/overview.html#regexpSimplify + # https://go-critic.com/overview.html#regexpsimplify - regexpSimplify # Detects suspicious http.Error call without following return. - # https://go-critic.com/overview.html#returnAfterHttpError + # https://go-critic.com/overview.html#returnafterhttperror - returnAfterHttpError # Runs user-defined rules using ruleguard linter. # https://go-critic.com/overview.html#ruleguard - ruleguard # Detects switch statements that could be better written as if statement. - # https://go-critic.com/overview.html#singleCaseSwitch + # https://go-critic.com/overview.html#singlecaseswitch - singleCaseSwitch # Detects slice clear loops, suggests an idiom that is recognized by the Go compiler. - # https://go-critic.com/overview.html#sliceClear + # https://go-critic.com/overview.html#sliceclear - sliceClear # Detects usage of `len` when result is obvious or doesn't make sense. - # https://go-critic.com/overview.html#sloppyLen + # https://go-critic.com/overview.html#sloppylen - sloppyLen # Detects suspicious/confusing re-assignments. - # https://go-critic.com/overview.html#sloppyReassign + # https://go-critic.com/overview.html#sloppyreassign - sloppyReassign # Detects redundant type assertions. - # https://go-critic.com/overview.html#sloppyTypeAssert + # https://go-critic.com/overview.html#sloppytypeassert - sloppyTypeAssert # Detects suspicious sort.Slice calls. - # https://go-critic.com/overview.html#sortSlice + # https://go-critic.com/overview.html#sortslice - sortSlice # Detects "%s" formatting directives that can be replaced with %q. - # https://go-critic.com/overview.html#sprintfQuotedString + # https://go-critic.com/overview.html#sprintfquotedstring - sprintfQuotedString # Detects issue in Query() and Exec() calls. - # https://go-critic.com/overview.html#sqlQuery + # https://go-critic.com/overview.html#sqlquery - sqlQuery # Detects string concat operations that can be simplified. - # https://go-critic.com/overview.html#stringConcatSimplify + # https://go-critic.com/overview.html#stringconcatsimplify - stringConcatSimplify # Detects redundant conversions between string and []byte. - # https://go-critic.com/overview.html#stringXbytes + # https://go-critic.com/overview.html#stringxbytes - stringXbytes # Detects strings.Compare usage. - # https://go-critic.com/overview.html#stringsCompare + # https://go-critic.com/overview.html#stringscompare - stringsCompare # Detects switch-over-bool statements that use explicit `true` tag value. - # https://go-critic.com/overview.html#switchTrue + # https://go-critic.com/overview.html#switchtrue - switchTrue # Detects sync.Map load+delete operations that can be replaced with LoadAndDelete. - # https://go-critic.com/overview.html#syncMapLoadAndDelete + # https://go-critic.com/overview.html#syncmaploadanddelete - syncMapLoadAndDelete # Detects manual conversion to milli- or microseconds. - # https://go-critic.com/overview.html#timeExprSimplify + # https://go-critic.com/overview.html#timeexprsimplify - timeExprSimplify # Detects TODO comments without detail/assignee. - # https://go-critic.com/overview.html#todoCommentWithoutDetail + # https://go-critic.com/overview.html#todocommentwithoutdetail - todoCommentWithoutDetail # Detects function with too many results. - # https://go-critic.com/overview.html#tooManyResultsChecker + # https://go-critic.com/overview.html#toomanyresultschecker - tooManyResultsChecker # Detects potential truncation issues when comparing ints of different sizes. - # https://go-critic.com/overview.html#truncateCmp + # https://go-critic.com/overview.html#truncatecmp - truncateCmp # Detects repeated type assertions and suggests to replace them with type switch statement. - # https://go-critic.com/overview.html#typeAssertChain + # https://go-critic.com/overview.html#typeassertchain - typeAssertChain # Detects method declarations preceding the type definition itself. - # https://go-critic.com/overview.html#typeDefFirst + # https://go-critic.com/overview.html#typedeffirst - typeDefFirst # Detects type switches that can benefit from type guard clause with variable. - # https://go-critic.com/overview.html#typeSwitchVar + # https://go-critic.com/overview.html#typeswitchvar - typeSwitchVar # Detects unneeded parenthesis inside type expressions and suggests to remove them. - # https://go-critic.com/overview.html#typeUnparen + # https://go-critic.com/overview.html#typeunparen - typeUnparen # Detects unchecked errors in if statements. - # https://go-critic.com/overview.html#uncheckedInlineErr + # https://go-critic.com/overview.html#uncheckedinlineerr - uncheckedInlineErr # Detects dereference expressions that can be omitted. # https://go-critic.com/overview.html#underef - underef # Detects redundant statement labels. - # https://go-critic.com/overview.html#unlabelStmt + # https://go-critic.com/overview.html#unlabelstmt - unlabelStmt # Detects function literals that can be simplified. # https://go-critic.com/overview.html#unlambda - unlambda # Detects unnamed results that may benefit from names. - # https://go-critic.com/overview.html#unnamedResult + # https://go-critic.com/overview.html#unnamedresult - unnamedResult # Detects unnecessary braced statement blocks. - # https://go-critic.com/overview.html#unnecessaryBlock + # https://go-critic.com/overview.html#unnecessaryblock - unnecessaryBlock # Detects redundantly deferred calls. - # https://go-critic.com/overview.html#unnecessaryDefer + # https://go-critic.com/overview.html#unnecessarydefer - unnecessaryDefer # Detects slice expressions that can be simplified to sliced expression itself. # https://go-critic.com/overview.html#unslice - unslice # Detects value swapping code that are not using parallel assignment. - # https://go-critic.com/overview.html#valSwap + # https://go-critic.com/overview.html#valswap - valSwap # Detects conditions that are unsafe due to not being exhaustive. - # https://go-critic.com/overview.html#weakCond + # https://go-critic.com/overview.html#weakcond - weakCond # Ensures that `//nolint` comments include an explanation. - # https://go-critic.com/overview.html#whyNoLint + # https://go-critic.com/overview.html#whynolint - whyNoLint # Detects function calls that can be replaced with convenience wrappers. - # https://go-critic.com/overview.html#wrapperFunc + # https://go-critic.com/overview.html#wrapperfunc - wrapperFunc # Detects Yoda style expressions and suggests to replace them. - # https://go-critic.com/overview.html#yodaStyleExpr + # https://go-critic.com/overview.html#yodastyleexpr - yodaStyleExpr # Enable all checks. @@ -1158,7 +1158,7 @@ linters-settings: # Settings passed to gocritic. # The settings key is the name of a supported gocritic checker. - # The list of supported checkers can be find in https://go-critic.github.io/overview. + # The list of supported checkers can be find in https://go-critic.com/overview. settings: # Must be valid enabled check name. captLocal: @@ -2285,7 +2285,7 @@ linters-settings: max-open-files: 2048 # When set to false, ignores files with "GENERATED" header, similar to golint. - # See https://github.com/mgechev/revive#available-rules for details. + # See https://github.com/mgechev/revive#configuration for details. # Default: false ignore-generated-header: true @@ -2840,6 +2840,7 @@ linters-settings: # Default: "" key-naming-case: snake # Enforce not using specific keys. + # https://github.com/go-simpler/sloglint?tab=readme-ov-file#forbidden-keys # Default: [] forbidden-keys: - time @@ -2848,7 +2849,7 @@ linters-settings: - source - foo # Enforce putting arguments on separate lines. - # https://github.com/go-simpler/sloglint?tab=readme-ov-file#forbidden-keys + # https://github.com/go-simpler/sloglint?tab=readme-ov-file#arguments-on-separate-lines # Default: false args-on-sep-lines: true @@ -3382,7 +3383,12 @@ linters-settings: # To enable go vet's printf checks. # Default: true check-format-string: false - # To require f-assertions if format string is used. + # To require f-assertions (e.g. `assert.Equalf`) if format string is used, even if there are no variable-length + # variables, i.e. it requires `require.NoErrorf` for both these cases: + # - require.NoErrorf(t, err, "unexpected error") + # - require.NoErrorf(t, err, "unexpected error for sid: %v", sid) + # To understand this behavior, please read the + # https://github.com/Antonboom/testifylint?tab=readme-ov-file#historical-reference-of-formatter. # Default: false require-f-funcs: true go-require: diff --git a/.golangci.reference.yml b/.golangci.reference.yml index 8418f3d70e81..708cf8048c17 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -4,7 +4,6 @@ # This file is not a configuration example, # it contains the exhaustive configuration with explanations of the options. - linters: # Disable all linters. # Default: false @@ -64,6 +63,7 @@ linters: - gosmopolitan - govet - grouper + - iface - importas - inamedparam - ineffassign @@ -94,6 +94,7 @@ linters: - promlinter - protogetter - reassign + - recvcheck - revive - rowserrcheck - sloglint @@ -178,6 +179,7 @@ linters: - gosmopolitan - govet - grouper + - iface - importas - inamedparam - ineffassign @@ -208,6 +210,7 @@ linters: - promlinter - protogetter - reassign + - recvcheck - revive - rowserrcheck - sloglint @@ -287,7 +290,7 @@ linters-settings: ignore-test: true bidichk: - # The following configurations check for all mentioned invisible unicode runes. + # The following configurations check for all mentioned invisible Unicode runes. # All runes are enabled by default. left-to-right-embedding: false right-to-left-embedding: false @@ -649,6 +652,15 @@ linters-settings: # Default: false forbid-spec-pollution: true + # Force using the Succeed matcher for error functions, and the HaveOccurred matcher for non-function error values. + # Default: false + force-succeed: true + + gochecksumtype: + # Presence of `default` case in switch statements satisfies exhaustiveness, if all members are not listed. + # Default: true + default-signifies-exhaustive: false + gocognit: # Minimal code complexity to report. # Default: 30 (but we recommend 10-20) @@ -688,17 +700,331 @@ linters-settings: # Default: false disable-all: true # Which checks should be enabled in addition to default checks; can't be combined with 'disabled-checks'. - # By default, list of stable checks is used (https://go-critic.github.io/overview#checks-overview): + # By default, list of stable checks is used (https://go-critic.com/overview#checks-overview): # appendAssign, argOrder, assignOp, badCall, badCond, captLocal, caseOrder, codegenComment, commentFormatting, # defaultCaseOrder, deprecatedComment, dupArg, dupBranchBody, dupCase, dupSubExpr, elseif, exitAfterDefer, # flagDeref, flagName, ifElseChain, mapKey, newDeref, offBy1, regexpMust, singleCaseSwitch, sloppyLen, # sloppyTypeAssert, switchTrue, typeSwitchVar, underef, unlambda, unslice, valSwap, wrapperFunc # To see which checks are enabled run `GL_DEBUG=gocritic golangci-lint run --enable=gocritic`. enabled-checks: + # Detects suspicious append result assignments. + # https://go-critic.com/overview.html#appendassign + - appendAssign + # Detects `append` chains to the same slice that can be done in a single `append` call. + # https://go-critic.com/overview.html#appendcombine + - appendCombine + # Detects suspicious arguments order. + # https://go-critic.com/overview.html#argorder + - argOrder + # Detects assignments that can be simplified by using assignment operators. + # https://go-critic.com/overview.html#assignop + - assignOp + # Detects suspicious function calls. + # https://go-critic.com/overview.html#badcall + - badCall + # Detects suspicious condition expressions. + # https://go-critic.com/overview.html#badcond + - badCond + # Detects suspicious mutex lock/unlock operations. + # https://go-critic.com/overview.html#badlock + - badLock + # Detects suspicious regexp patterns. + # https://go-critic.com/overview.html#badregexp + - badRegexp + # Detects bad usage of sort package. + # https://go-critic.com/overview.html#badsorting + - badSorting + # Detects bad usage of sync.OnceFunc. + # https://go-critic.com/overview.html#badsynconcefunc + - badSyncOnceFunc + # Detects bool expressions that can be simplified. + # https://go-critic.com/overview.html#boolexprsimplify + - boolExprSimplify + # Detects when predeclared identifiers are shadowed in assignments. + # https://go-critic.com/overview.html#builtinshadow + - builtinShadow + # Detects top-level declarations that shadow the predeclared identifiers. + # https://go-critic.com/overview.html#builtinshadowdecl + - builtinShadowDecl + # Detects capitalized names for local variables. + # https://go-critic.com/overview.html#captlocal + - captLocal + # Detects erroneous case order inside switch statements. + # https://go-critic.com/overview.html#caseorder + - caseOrder + # Detects malformed 'code generated' file comments. + # https://go-critic.com/overview.html#codegencomment + - codegenComment + # Detects comments with non-idiomatic formatting. + # https://go-critic.com/overview.html#commentformatting + - commentFormatting + # Detects commented-out code inside function bodies. + # https://go-critic.com/overview.html#commentedoutcode + - commentedOutCode + # Detects commented-out imports. + # https://go-critic.com/overview.html#commentedoutimport + - commentedOutImport + # Detects when default case in switch isn't on 1st or last position. + # https://go-critic.com/overview.html#defaultcaseorder + - defaultCaseOrder + # Detects loops inside functions that use defer. + # https://go-critic.com/overview.html#deferinloop + - deferInLoop + # Detects deferred function literals that can be simplified. + # https://go-critic.com/overview.html#deferunlambda + - deferUnlambda + # Detects malformed 'deprecated' doc-comments. + # https://go-critic.com/overview.html#deprecatedcomment + - deprecatedComment + # Detects comments that silence go lint complaints about doc-comment. + # https://go-critic.com/overview.html#docstub + - docStub + # Detects suspicious duplicated arguments. + # https://go-critic.com/overview.html#duparg + - dupArg + # Detects duplicated branch bodies inside conditional statements. + # https://go-critic.com/overview.html#dupbranchbody + - dupBranchBody + # Detects duplicated case clauses inside switch or select statements. + # https://go-critic.com/overview.html#dupcase + - dupCase + # Detects multiple imports of the same package under different aliases. + # https://go-critic.com/overview.html#dupimport + - dupImport + # Detects suspicious duplicated sub-expressions. + # https://go-critic.com/overview.html#dupsubexpr + - dupSubExpr + # Detects suspicious formatting strings usage. + # https://go-critic.com/overview.html#dynamicfmtstring + - dynamicFmtString + # Detects else with nested if statement that can be replaced with else-if. + # https://go-critic.com/overview.html#elseif + - elseif + # Detects suspicious empty declarations blocks. + # https://go-critic.com/overview.html#emptydecl + - emptyDecl + # Detects fallthrough that can be avoided by using multi case values. + # https://go-critic.com/overview.html#emptyfallthrough + - emptyFallthrough + # Detects empty string checks that can be written more idiomatically. + # https://go-critic.com/overview.html#emptystringtest + - emptyStringTest + # Detects unoptimal strings/bytes case-insensitive comparison. + # https://go-critic.com/overview.html#equalfold + - equalFold + # Detects unwanted dependencies on the evaluation order. + # https://go-critic.com/overview.html#evalorder + - evalOrder + # Detects calls to exit/fatal inside functions that use defer. + # https://go-critic.com/overview.html#exitafterdefer + - exitAfterDefer + # Detects exposed methods from sync.Mutex and sync.RWMutex. + # https://go-critic.com/overview.html#exposedsyncmutex + - exposedSyncMutex + # Detects suspicious reassignment of error from another package. + # https://go-critic.com/overview.html#externalerrorreassign + - externalErrorReassign + # Detects problems in filepath.Join() function calls. + # https://go-critic.com/overview.html#filepathjoin + - filepathJoin + # Detects immediate dereferencing of `flag` package pointers. + # https://go-critic.com/overview.html#flagderef + - flagDeref + # Detects suspicious flag names. + # https://go-critic.com/overview.html#flagname + - flagName + # Detects hex literals that have mixed case letter digits. + # https://go-critic.com/overview.html#hexliteral + - hexLiteral + # Detects nil usages in http.NewRequest calls, suggesting http.NoBody as an alternative. + # https://go-critic.com/overview.html#httpnobody + - httpNoBody + # Detects params that incur excessive amount of copying. + # https://go-critic.com/overview.html#hugeparam + - hugeParam + # Detects repeated if-else statements and suggests to replace them with switch statement. + # https://go-critic.com/overview.html#ifelsechain + - ifElseChain + # Detects when imported package names shadowed in the assignments. + # https://go-critic.com/overview.html#importshadow + - importShadow + # Detects strings.Index calls that may cause unwanted allocs. + # https://go-critic.com/overview.html#indexalloc + - indexAlloc + # Detects non-assignment statements inside if/switch init clause. + # https://go-critic.com/overview.html#initclause + - initClause + # Detects suspicious map literal keys. + # https://go-critic.com/overview.html#mapkey + - mapKey + # Detects method expression call that can be replaced with a method call. + # https://go-critic.com/overview.html#methodexprcall + - methodExprCall + # Finds where nesting level could be reduced. + # https://go-critic.com/overview.html#nestingreduce - nestingReduce - - unnamedResult + # Detects immediate dereferencing of `new` expressions. + # https://go-critic.com/overview.html#newderef + - newDeref + # Detects return statements those results evaluate to nil. + # https://go-critic.com/overview.html#nilvalreturn + - nilValReturn + # Detects old-style octal literals. + # https://go-critic.com/overview.html#octalliteral + - octalLiteral + # Detects various off-by-one kind of errors. + # https://go-critic.com/overview.html#offby1 + - offBy1 + # Detects if function parameters could be combined by type and suggest the way to do it. + # https://go-critic.com/overview.html#paramtypecombine + - paramTypeCombine + # Detects expressions like []rune(s)[0] that may cause unwanted rune slice allocation. + # https://go-critic.com/overview.html#preferdecoderune + - preferDecodeRune + # Detects concatenation with os.PathSeparator which can be replaced with filepath.Join. + # https://go-critic.com/overview.html#preferfilepathjoin + - preferFilepathJoin + # Detects fmt.Sprint(f/ln) calls which can be replaced with fmt.Fprint(f/ln). + # https://go-critic.com/overview.html#preferfprint + - preferFprint + # Detects w.Write or io.WriteString calls which can be replaced with w.WriteString. + # https://go-critic.com/overview.html#preferstringwriter + - preferStringWriter + # Detects WriteRune calls with rune literal argument that is single byte and reports to use WriteByte instead. + # https://go-critic.com/overview.html#preferwritebyte + - preferWriteByte + # Detects input and output parameters that have a type of pointer to referential type. + # https://go-critic.com/overview.html#ptrtorefparam + - ptrToRefParam + # Detects append all its data while range it. + # https://go-critic.com/overview.html#rangeappendall + - rangeAppendAll + # Detects expensive copies of `for` loop range expressions. + # https://go-critic.com/overview.html#rangeexprcopy + - rangeExprCopy + # Detects loops that copy big objects during each iteration. + # https://go-critic.com/overview.html#rangevalcopy + - rangeValCopy + # Detects redundant fmt.Sprint calls. + # https://go-critic.com/overview.html#redundantsprint + - redundantSprint + # Detects `regexp.Compile*` that can be replaced with `regexp.MustCompile*`. + # https://go-critic.com/overview.html#regexpmust + - regexpMust + # Detects suspicious regexp patterns. + # https://go-critic.com/overview.html#regexppattern + - regexpPattern + # Detects regexp patterns that can be simplified. + # https://go-critic.com/overview.html#regexpsimplify + - regexpSimplify + # Detects suspicious http.Error call without following return. + # https://go-critic.com/overview.html#returnafterhttperror + - returnAfterHttpError + # Runs user-defined rules using ruleguard linter. + # https://go-critic.com/overview.html#ruleguard - ruleguard + # Detects switch statements that could be better written as if statement. + # https://go-critic.com/overview.html#singlecaseswitch + - singleCaseSwitch + # Detects slice clear loops, suggests an idiom that is recognized by the Go compiler. + # https://go-critic.com/overview.html#sliceclear + - sliceClear + # Detects usage of `len` when result is obvious or doesn't make sense. + # https://go-critic.com/overview.html#sloppylen + - sloppyLen + # Detects suspicious/confusing re-assignments. + # https://go-critic.com/overview.html#sloppyreassign + - sloppyReassign + # Detects redundant type assertions. + # https://go-critic.com/overview.html#sloppytypeassert + - sloppyTypeAssert + # Detects suspicious sort.Slice calls. + # https://go-critic.com/overview.html#sortslice + - sortSlice + # Detects "%s" formatting directives that can be replaced with %q. + # https://go-critic.com/overview.html#sprintfquotedstring + - sprintfQuotedString + # Detects issue in Query() and Exec() calls. + # https://go-critic.com/overview.html#sqlquery + - sqlQuery + # Detects string concat operations that can be simplified. + # https://go-critic.com/overview.html#stringconcatsimplify + - stringConcatSimplify + # Detects redundant conversions between string and []byte. + # https://go-critic.com/overview.html#stringxbytes + - stringXbytes + # Detects strings.Compare usage. + # https://go-critic.com/overview.html#stringscompare + - stringsCompare + # Detects switch-over-bool statements that use explicit `true` tag value. + # https://go-critic.com/overview.html#switchtrue + - switchTrue + # Detects sync.Map load+delete operations that can be replaced with LoadAndDelete. + # https://go-critic.com/overview.html#syncmaploadanddelete + - syncMapLoadAndDelete + # Detects manual conversion to milli- or microseconds. + # https://go-critic.com/overview.html#timeexprsimplify + - timeExprSimplify + # Detects TODO comments without detail/assignee. + # https://go-critic.com/overview.html#todocommentwithoutdetail + - todoCommentWithoutDetail + # Detects function with too many results. + # https://go-critic.com/overview.html#toomanyresultschecker + - tooManyResultsChecker + # Detects potential truncation issues when comparing ints of different sizes. + # https://go-critic.com/overview.html#truncatecmp - truncateCmp + # Detects repeated type assertions and suggests to replace them with type switch statement. + # https://go-critic.com/overview.html#typeassertchain + - typeAssertChain + # Detects method declarations preceding the type definition itself. + # https://go-critic.com/overview.html#typedeffirst + - typeDefFirst + # Detects type switches that can benefit from type guard clause with variable. + # https://go-critic.com/overview.html#typeswitchvar + - typeSwitchVar + # Detects unneeded parenthesis inside type expressions and suggests to remove them. + # https://go-critic.com/overview.html#typeunparen + - typeUnparen + # Detects unchecked errors in if statements. + # https://go-critic.com/overview.html#uncheckedinlineerr + - uncheckedInlineErr + # Detects dereference expressions that can be omitted. + # https://go-critic.com/overview.html#underef + - underef + # Detects redundant statement labels. + # https://go-critic.com/overview.html#unlabelstmt + - unlabelStmt + # Detects function literals that can be simplified. + # https://go-critic.com/overview.html#unlambda + - unlambda + # Detects unnamed results that may benefit from names. + # https://go-critic.com/overview.html#unnamedresult + - unnamedResult + # Detects unnecessary braced statement blocks. + # https://go-critic.com/overview.html#unnecessaryblock + - unnecessaryBlock + # Detects redundantly deferred calls. + # https://go-critic.com/overview.html#unnecessarydefer + - unnecessaryDefer + # Detects slice expressions that can be simplified to sliced expression itself. + # https://go-critic.com/overview.html#unslice + - unslice + # Detects value swapping code that are not using parallel assignment. + # https://go-critic.com/overview.html#valswap + - valSwap + # Detects conditions that are unsafe due to not being exhaustive. + # https://go-critic.com/overview.html#weakcond + - weakCond + # Ensures that `//nolint` comments include an explanation. + # https://go-critic.com/overview.html#whynolint + - whyNoLint + # Detects function calls that can be replaced with convenience wrappers. + # https://go-critic.com/overview.html#wrapperfunc + - wrapperFunc + # Detects Yoda style expressions and suggests to replace them. + # https://go-critic.com/overview.html#yodastyleexpr + - yodaStyleExpr # Enable all checks. # Default: false @@ -706,7 +1032,112 @@ linters-settings: # Which checks should be disabled; can't be combined with 'enabled-checks'. # Default: [] disabled-checks: + - appendAssign + - appendCombine + - argOrder + - assignOp + - badCall + - badCond + - badLock + - badRegexp + - badSorting + - badSyncOnceFunc + - boolExprSimplify + - builtinShadow + - builtinShadowDecl + - captLocal + - caseOrder + - codegenComment + - commentFormatting + - commentedOutCode + - commentedOutImport + - defaultCaseOrder + - deferInLoop + - deferUnlambda + - deprecatedComment + - docStub + - dupArg + - dupBranchBody + - dupCase + - dupImport + - dupSubExpr + - dynamicFmtString + - elseif + - emptyDecl + - emptyFallthrough + - emptyStringTest + - equalFold + - evalOrder + - exitAfterDefer + - exposedSyncMutex + - externalErrorReassign + - filepathJoin + - flagDeref + - flagName + - hexLiteral + - httpNoBody + - hugeParam + - ifElseChain + - importShadow + - indexAlloc + - initClause + - mapKey + - methodExprCall + - nestingReduce + - newDeref + - nilValReturn + - octalLiteral + - offBy1 + - paramTypeCombine + - preferDecodeRune + - preferFilepathJoin + - preferFprint + - preferStringWriter + - preferWriteByte + - ptrToRefParam + - rangeAppendAll + - rangeExprCopy + - rangeValCopy + - redundantSprint - regexpMust + - regexpPattern + - regexpSimplify + - returnAfterHttpError + - ruleguard + - singleCaseSwitch + - sliceClear + - sloppyLen + - sloppyReassign + - sloppyTypeAssert + - sortSlice + - sprintfQuotedString + - sqlQuery + - stringConcatSimplify + - stringXbytes + - stringsCompare + - switchTrue + - syncMapLoadAndDelete + - timeExprSimplify + - todoCommentWithoutDetail + - tooManyResultsChecker + - truncateCmp + - typeAssertChain + - typeDefFirst + - typeSwitchVar + - typeUnparen + - uncheckedInlineErr + - underef + - unlabelStmt + - unlambda + - unnamedResult + - unnecessaryBlock + - unnecessaryDefer + - unslice + - valSwap + - weakCond + - whyNoLint + - wrapperFunc + - yodaStyleExpr # Enable multiple checks by tags in addition to default checks. # Run `GL_DEBUG=gocritic golangci-lint run --enable=gocritic` to see all tags and checks. @@ -727,7 +1158,7 @@ linters-settings: # Settings passed to gocritic. # The settings key is the name of a supported gocritic checker. - # The list of supported checkers can be find in https://go-critic.github.io/overview. + # The list of supported checkers can be find in https://go-critic.com/overview. settings: # Must be valid enabled check name. captLocal: @@ -971,7 +1402,112 @@ linters-settings: gosimple: # Sxxxx checks in https://staticcheck.dev/docs/configuration/options/#checks # Default: ["*"] - checks: [ "all" ] + checks: + # Use plain channel send or receive instead of single-case select. + # https://staticcheck.dev/docs/checks/#S1000 + - S1000 + # Replace for loop with call to copy. + # https://staticcheck.dev/docs/checks/#S1001 + - S1001 + # Omit comparison with boolean constant. + # https://staticcheck.dev/docs/checks/#S1002 + - S1002 + # Replace call to 'strings.Index' with 'strings.Contains'. + # https://staticcheck.dev/docs/checks/#S1003 + - S1003 + # Replace call to 'bytes.Compare' with 'bytes.Equal'. + # https://staticcheck.dev/docs/checks/#S1004 + - S1004 + # Drop unnecessary use of the blank identifier. + # https://staticcheck.dev/docs/checks/#S1005 + - S1005 + # Use "for { ... }" for infinite loops. + # https://staticcheck.dev/docs/checks/#S1006 + - S1006 + # Simplify regular expression by using raw string literal. + # https://staticcheck.dev/docs/checks/#S1007 + - S1007 + # Simplify returning boolean expression. + # https://staticcheck.dev/docs/checks/#S1008 + - S1008 + # Omit redundant nil check on slices, maps, and channels. + # https://staticcheck.dev/docs/checks/#S1009 + - S1009 + # Omit default slice index. + # https://staticcheck.dev/docs/checks/#S1010 + - S1010 + # Use a single 'append' to concatenate two slices. + # https://staticcheck.dev/docs/checks/#S1011 + - S1011 + # Replace 'time.Now().Sub(x)' with 'time.Since(x)'. + # https://staticcheck.dev/docs/checks/#S1012 + - S1012 + # Use a type conversion instead of manually copying struct fields. + # https://staticcheck.dev/docs/checks/#S1016 + - S1016 + # Replace manual trimming with 'strings.TrimPrefix'. + # https://staticcheck.dev/docs/checks/#S1017 + - S1017 + # Use "copy" for sliding elements. + # https://staticcheck.dev/docs/checks/#S1018 + - S1018 + # Simplify "make" call by omitting redundant arguments. + # https://staticcheck.dev/docs/checks/#S1019 + - S1019 + # Omit redundant nil check in type assertion. + # https://staticcheck.dev/docs/checks/#S1020 + - S1020 + # Merge variable declaration and assignment. + # https://staticcheck.dev/docs/checks/#S1021 + - S1021 + # Omit redundant control flow. + # https://staticcheck.dev/docs/checks/#S1023 + - S1023 + # Replace 'x.Sub(time.Now())' with 'time.Until(x)'. + # https://staticcheck.dev/docs/checks/#S1024 + - S1024 + # Don't use 'fmt.Sprintf("%s", x)' unnecessarily. + # https://staticcheck.dev/docs/checks/#S1025 + - S1025 + # Simplify error construction with 'fmt.Errorf'. + # https://staticcheck.dev/docs/checks/#S1028 + - S1028 + # Range over the string directly. + # https://staticcheck.dev/docs/checks/#S1029 + - S1029 + # Use 'bytes.Buffer.String' or 'bytes.Buffer.Bytes'. + # https://staticcheck.dev/docs/checks/#S1030 + - S1030 + # Omit redundant nil check around loop. + # https://staticcheck.dev/docs/checks/#S1031 + - S1031 + # Use 'sort.Ints(x)', 'sort.Float64s(x)', and 'sort.Strings(x)'. + # https://staticcheck.dev/docs/checks/#S1032 + - S1032 + # Unnecessary guard around call to "delete". + # https://staticcheck.dev/docs/checks/#S1033 + - S1033 + # Use result of type assertion to simplify cases. + # https://staticcheck.dev/docs/checks/#S1034 + - S1034 + # Redundant call to 'net/http.CanonicalHeaderKey' in method call on 'net/http.Header'. + # https://staticcheck.dev/docs/checks/#S1035 + - S1035 + # Unnecessary guard around map access. + # https://staticcheck.dev/docs/checks/#S1036 + - S1036 + # Elaborate way of sleeping. + # https://staticcheck.dev/docs/checks/#S1037 + - S1037 + # Unnecessarily complex way of printing formatted string. + # https://staticcheck.dev/docs/checks/#S1038 + - S1038 + # Unnecessary use of 'fmt.Sprint'. + # https://staticcheck.dev/docs/checks/#S1039 + - S1039 + # Type assertion to current type. + # https://staticcheck.dev/docs/checks/#S1040 + - S1040 gosec: # To select a subset of rules to run. @@ -1203,45 +1739,87 @@ linters-settings: # Run `GL_DEBUG=govet golangci-lint run --enable=govet` to see default, all available analyzers, and enabled analyzers. # Default: [] enable: + # Check for missing values after append. - appends + # Report mismatches between assembly files and Go declarations. - asmdecl + # Check for useless assignments. - assign + # Check for common mistakes using the sync/atomic package. - atomic + # Check for non-64-bits-aligned arguments to sync/atomic functions. - atomicalign + # Check for common mistakes involving boolean operators. - bools + # Check //go:build and // +build directives. - buildtag + # Detect some violations of the cgo pointer passing rules. - cgocall + # Check for unkeyed composite literals. - composites + # Check for locks erroneously passed by value. - copylocks + # Check for calls of reflect.DeepEqual on error values. - deepequalerrors + # Report common mistakes in defer statements. - defers + # Check Go toolchain directives such as //go:debug. - directive + # Report passing non-pointer or non-error values to errors.As. - errorsas + # Find structs that would use less memory if their fields were sorted. - fieldalignment + # Find calls to a particular function. - findcall + # Report assembly that clobbers the frame pointer before saving it. - framepointer + # Check for mistakes using HTTP responses. - httpresponse + # Detect impossible interface-to-interface type assertions. - ifaceassert + # Check references to loop variables from within nested functions. - loopclosure + # Check cancel func returned by context.WithCancel is called. - lostcancel + # Check for useless comparisons between functions and nil. - nilfunc + # Check for redundant or impossible nil comparisons. - nilness + # Check consistency of Printf format strings and arguments. - printf + # Check for comparing reflect.Value values with == or reflect.DeepEqual. - reflectvaluecompare + # Check for possible unintended shadowing of variables. - shadow + # Check for shifts that equal or exceed the width of the integer. - shift + # Check for unbuffered channel of os.Signal. - sigchanyzer + # Check for invalid structured logging calls. - slog + # Check the argument type of sort.Slice. - sortslice + # Check signature of methods of well-known interfaces. - stdmethods + # Check for string(int) conversions. - stringintconv + # Check that struct field tags conform to reflect.StructTag.Get. - structtag + # Report calls to (*testing.T).Fatal from goroutines started by a test. - testinggoroutine + # Check for common mistaken usages of tests and examples. - tests + # Check for calls of (time.Time).Format or time.Parse with 2006-02-01. + - timeformat + # Report passing non-pointer or non-interface values to unmarshal. - unmarshal + # Check for unreachable code. - unreachable + # Check for invalid conversions of uintptr to unsafe.Pointer. - unsafeptr + # Check for unused results of calls to some functions. - unusedresult + # Checks for unused writes. - unusedwrite # Enable all analyzers. @@ -1290,6 +1868,7 @@ linters-settings: - structtag - testinggoroutine - tests + - timeformat - unmarshal - unreachable - unsafeptr @@ -1355,6 +1934,20 @@ linters-settings: # Default: false var-require-grouping: true + iface: + # List of analyzers. + # Default: ["identical"] + enable: + - identical # Identifies interfaces in the same package that have identical method sets. + - unused # Identifies interfaces that are not used anywhere in the same package where the interface is defined. + - opaque # Identifies functions that return interfaces, but the actual returned value is always a single concrete implementation. + settings: + unused: + # List of packages path to exclude from the check. + # Default: [] + exclude: + - github.com/example/log + importas: # Do not allow unaliased imports of aliased packages. # Default: false @@ -1546,14 +2139,17 @@ linters-settings: min-complexity: 4 nilnil: + # In addition, detect opposite situation (simultaneous return of non-nil error and valid value). + # Default: false + detect-opposite: true # List of return types to check. - # Default: ["ptr", "func", "iface", "map", "chan", "uintptr", "unsafeptr"] + # Default: ["chan", "func", "iface", "map", "ptr", "uintptr", "unsafeptr"] checked-types: - - ptr + - chan - func - iface - map - - chan + - ptr - uintptr - unsafeptr @@ -1638,15 +2234,24 @@ linters-settings: # Please refer to https://github.com/yeya24/promlinter#usage for detailed usage. # Default: [] disabled-linters: + # Help detects issues related to the help text for a metric. - Help + # MetricUnits detects issues with metric unit names. - MetricUnits + # Counter detects issues specific to counters, as well as patterns that should only be used with counters. - Counter + # HistogramSummaryReserved detects when other types of metrics use names or labels reserved for use by histograms and/or summaries. - HistogramSummaryReserved + # MetricTypeInName detects when metric types are included in the metric name. - MetricTypeInName + # ReservedChars detects colons in metric names. - ReservedChars + # CamelCase detects metric names and label names written in camelCase. - CamelCase + # UnitAbbreviations detects abbreviated units in the metric name. - UnitAbbreviations + protogetter: # Skip files generated by specified generators from the checking. # Checks only the file's initial comment, which must follow the format: "// Code generated by ". @@ -1680,7 +2285,7 @@ linters-settings: max-open-files: 2048 # When set to false, ignores files with "GENERATED" header, similar to golint. - # See https://github.com/mgechev/revive#available-rules for details. + # See https://github.com/mgechev/revive#configuration for details. # Default: false ignore-generated-header: true @@ -1891,9 +2496,10 @@ linters-settings: disabled: false exclude: [""] arguments: - - "preserveScope" - "checkPrivateReceivers" - - "sayRepetitiveInsteadOfStutters" + - "disableStutteringCheck" + - "checkPublicInterface" + - "disableChecksOnFunctions" # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#file-header - name: file-header severity: warning @@ -1901,6 +2507,22 @@ linters-settings: exclude: [""] arguments: - This is the text that must appear at the top of source files. + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#file-length-limit + - name: file-length-limit + severity: warning + disabled: false + exclude: [""] + arguments: + - max: 100 + skipComments: true + skipBlankLines: true + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#filename-format + - name: filename-format + severity: warning + disabled: false + exclude: [""] + arguments: + - "^[_a-z][_a-z0-9]*.go$" # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter - name: flag-parameter severity: warning @@ -2028,6 +2650,8 @@ linters-settings: severity: warning disabled: false exclude: [""] + arguments: + - maxLength: 2 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redefines-builtin-id - name: redefines-builtin-id severity: warning @@ -2216,6 +2840,7 @@ linters-settings: # Default: "" key-naming-case: snake # Enforce not using specific keys. + # https://github.com/go-simpler/sloglint?tab=readme-ov-file#forbidden-keys # Default: [] forbidden-keys: - time @@ -2224,7 +2849,7 @@ linters-settings: - source - foo # Enforce putting arguments on separate lines. - # https://github.com/go-simpler/sloglint?tab=readme-ov-file#forbidden-keys + # https://github.com/go-simpler/sloglint?tab=readme-ov-file#arguments-on-separate-lines # Default: false args-on-sep-lines: true @@ -2254,13 +2879,296 @@ linters-settings: - "github.com/user/repo/telemetry/trace.Start:opentelemetry" staticcheck: # SAxxxx checks in https://staticcheck.dev/docs/configuration/options/#checks + # Example (to disable some checks): [ "all", "-SA1000", "-SA1001"] # Default: ["*"] - checks: [ "all" ] + checks: + # Invalid regular expression. + # https://staticcheck.dev/docs/checks/#SA1000 + - SA1000 + # Invalid template. + # https://staticcheck.dev/docs/checks/#SA1001 + - SA1001 + # Invalid format in 'time.Parse'. + # https://staticcheck.dev/docs/checks/#SA1002 + - SA1002 + # Unsupported argument to functions in 'encoding/binary'. + # https://staticcheck.dev/docs/checks/#SA1003 + - SA1003 + # Suspiciously small untyped constant in 'time.Sleep'. + # https://staticcheck.dev/docs/checks/#SA1004 + - SA1004 + # Invalid first argument to 'exec.Command'. + # https://staticcheck.dev/docs/checks/#SA1005 + - SA1005 + # 'Printf' with dynamic first argument and no further arguments. + # https://staticcheck.dev/docs/checks/#SA1006 + - SA1006 + # Invalid URL in 'net/url.Parse'. + # https://staticcheck.dev/docs/checks/#SA1007 + - SA1007 + # Non-canonical key in 'http.Header' map. + # https://staticcheck.dev/docs/checks/#SA1008 + - SA1008 + # '(*regexp.Regexp).FindAll' called with 'n == 0', which will always return zero results. + # https://staticcheck.dev/docs/checks/#SA1010 + - SA1010 + # Various methods in the "strings" package expect valid UTF-8, but invalid input is provided. + # https://staticcheck.dev/docs/checks/#SA1011 + - SA1011 + # A nil 'context.Context' is being passed to a function, consider using 'context.TODO' instead. + # https://staticcheck.dev/docs/checks/#SA1012 + - SA1012 + # 'io.Seeker.Seek' is being called with the whence constant as the first argument, but it should be the second. + # https://staticcheck.dev/docs/checks/#SA1013 + - SA1013 + # Non-pointer value passed to 'Unmarshal' or 'Decode'. + # https://staticcheck.dev/docs/checks/#SA1014 + - SA1014 + # Using 'time.Tick' in a way that will leak. Consider using 'time.NewTicker', and only use 'time.Tick' in tests, commands and endless functions. + # https://staticcheck.dev/docs/checks/#SA1015 + - SA1015 + # Trapping a signal that cannot be trapped. + # https://staticcheck.dev/docs/checks/#SA1016 + - SA1016 + # Channels used with 'os/signal.Notify' should be buffered. + # https://staticcheck.dev/docs/checks/#SA1017 + - SA1017 + # 'strings.Replace' called with 'n == 0', which does nothing. + # https://staticcheck.dev/docs/checks/#SA1018 + - SA1018 + # Using a deprecated function, variable, constant or field. + # https://staticcheck.dev/docs/checks/#SA1019 + - SA1019 + # Using an invalid host:port pair with a 'net.Listen'-related function. + # https://staticcheck.dev/docs/checks/#SA1020 + - SA1020 + # Using 'bytes.Equal' to compare two 'net.IP'. + # https://staticcheck.dev/docs/checks/#SA1021 + - SA1021 + # Modifying the buffer in an 'io.Writer' implementation. + # https://staticcheck.dev/docs/checks/#SA1023 + - SA1023 + # A string cutset contains duplicate characters. + # https://staticcheck.dev/docs/checks/#SA1024 + - SA1024 + # It is not possible to use '(*time.Timer).Reset''s return value correctly. + # https://staticcheck.dev/docs/checks/#SA1025 + - SA1025 + # Cannot marshal channels or functions. + # https://staticcheck.dev/docs/checks/#SA1026 + - SA1026 + # Atomic access to 64-bit variable must be 64-bit aligned. + # https://staticcheck.dev/docs/checks/#SA1027 + - SA1027 + # 'sort.Slice' can only be used on slices. + # https://staticcheck.dev/docs/checks/#SA1028 + - SA1028 + # Inappropriate key in call to 'context.WithValue'. + # https://staticcheck.dev/docs/checks/#SA1029 + - SA1029 + # Invalid argument in call to a 'strconv' function. + # https://staticcheck.dev/docs/checks/#SA1030 + - SA1030 + # Overlapping byte slices passed to an encoder. + # https://staticcheck.dev/docs/checks/#SA1031 + - SA1031 + # Wrong order of arguments to 'errors.Is'. + # https://staticcheck.dev/docs/checks/#SA1032 + - SA1032 + # 'sync.WaitGroup.Add' called inside the goroutine, leading to a race condition. + # https://staticcheck.dev/docs/checks/#SA2000 + - SA2000 + # Empty critical section, did you mean to defer the unlock?. + # https://staticcheck.dev/docs/checks/#SA2001 + - SA2001 + # Called 'testing.T.FailNow' or 'SkipNow' in a goroutine, which isn't allowed. + # https://staticcheck.dev/docs/checks/#SA2002 + - SA2002 + # Deferred 'Lock' right after locking, likely meant to defer 'Unlock' instead. + # https://staticcheck.dev/docs/checks/#SA2003 + - SA2003 + # 'TestMain' doesn't call 'os.Exit', hiding test failures. + # https://staticcheck.dev/docs/checks/#SA3000 + - SA3000 + # Assigning to 'b.N' in benchmarks distorts the results. + # https://staticcheck.dev/docs/checks/#SA3001 + - SA3001 + # Binary operator has identical expressions on both sides. + # https://staticcheck.dev/docs/checks/#SA4000 + - SA4000 + # '&*x' gets simplified to 'x', it does not copy 'x'. + # https://staticcheck.dev/docs/checks/#SA4001 + - SA4001 + # Comparing unsigned values against negative values is pointless. + # https://staticcheck.dev/docs/checks/#SA4003 + - SA4003 + # The loop exits unconditionally after one iteration. + # https://staticcheck.dev/docs/checks/#SA4004 + - SA4004 + # Field assignment that will never be observed. Did you mean to use a pointer receiver?. + # https://staticcheck.dev/docs/checks/#SA4005 + - SA4005 + # A value assigned to a variable is never read before being overwritten. Forgotten error check or dead code?. + # https://staticcheck.dev/docs/checks/#SA4006 + - SA4006 + # The variable in the loop condition never changes, are you incrementing the wrong variable?. + # https://staticcheck.dev/docs/checks/#SA4008 + - SA4008 + # A function argument is overwritten before its first use. + # https://staticcheck.dev/docs/checks/#SA4009 + - SA4009 + # The result of 'append' will never be observed anywhere. + # https://staticcheck.dev/docs/checks/#SA4010 + - SA4010 + # Break statement with no effect. Did you mean to break out of an outer loop?. + # https://staticcheck.dev/docs/checks/#SA4011 + - SA4011 + # Comparing a value against NaN even though no value is equal to NaN. + # https://staticcheck.dev/docs/checks/#SA4012 + - SA4012 + # Negating a boolean twice ('!!b') is the same as writing 'b'. This is either redundant, or a typo. + # https://staticcheck.dev/docs/checks/#SA4013 + - SA4013 + # An if/else if chain has repeated conditions and no side-effects; if the condition didn't match the first time, it won't match the second time, either. + # https://staticcheck.dev/docs/checks/#SA4014 + - SA4014 + # Calling functions like 'math.Ceil' on floats converted from integers doesn't do anything useful. + # https://staticcheck.dev/docs/checks/#SA4015 + - SA4015 + # Certain bitwise operations, such as 'x ^ 0', do not do anything useful. + # https://staticcheck.dev/docs/checks/#SA4016 + - SA4016 + # Discarding the return values of a function without side effects, making the call pointless. + # https://staticcheck.dev/docs/checks/#SA4017 + - SA4017 + # Self-assignment of variables. + # https://staticcheck.dev/docs/checks/#SA4018 + - SA4018 + # Multiple, identical build constraints in the same file. + # https://staticcheck.dev/docs/checks/#SA4019 + - SA4019 + # Unreachable case clause in a type switch. + # https://staticcheck.dev/docs/checks/#SA4020 + - SA4020 + # "x = append(y)" is equivalent to "x = y". + # https://staticcheck.dev/docs/checks/#SA4021 + - SA4021 + # Comparing the address of a variable against nil. + # https://staticcheck.dev/docs/checks/#SA4022 + - SA4022 + # Impossible comparison of interface value with untyped nil. + # https://staticcheck.dev/docs/checks/#SA4023 + - SA4023 + # Checking for impossible return value from a builtin function. + # https://staticcheck.dev/docs/checks/#SA4024 + - SA4024 + # Integer division of literals that results in zero. + # https://staticcheck.dev/docs/checks/#SA4025 + - SA4025 + # Go constants cannot express negative zero. + # https://staticcheck.dev/docs/checks/#SA4026 + - SA4026 + # '(*net/url.URL).Query' returns a copy, modifying it doesn't change the URL. + # https://staticcheck.dev/docs/checks/#SA4027 + - SA4027 + # 'x % 1' is always zero. + # https://staticcheck.dev/docs/checks/#SA4028 + - SA4028 + # Ineffective attempt at sorting slice. + # https://staticcheck.dev/docs/checks/#SA4029 + - SA4029 + # Ineffective attempt at generating random number. + # https://staticcheck.dev/docs/checks/#SA4030 + - SA4030 + # Checking never-nil value against nil. + # https://staticcheck.dev/docs/checks/#SA4031 + - SA4031 + # Comparing 'runtime.GOOS' or 'runtime.GOARCH' against impossible value. + # https://staticcheck.dev/docs/checks/#SA4032 + - SA4032 + # Assignment to nil map. + # https://staticcheck.dev/docs/checks/#SA5000 + - SA5000 + # Deferring 'Close' before checking for a possible error. + # https://staticcheck.dev/docs/checks/#SA5001 + - SA5001 + # The empty for loop ("for {}") spins and can block the scheduler. + # https://staticcheck.dev/docs/checks/#SA5002 + - SA5002 + # Defers in infinite loops will never execute. + # https://staticcheck.dev/docs/checks/#SA5003 + - SA5003 + # "for { select { ..." with an empty default branch spins. + # https://staticcheck.dev/docs/checks/#SA5004 + - SA5004 + # The finalizer references the finalized object, preventing garbage collection. + # https://staticcheck.dev/docs/checks/#SA5005 + - SA5005 + # Infinite recursive call. + # https://staticcheck.dev/docs/checks/#SA5007 + - SA5007 + # Invalid struct tag. + # https://staticcheck.dev/docs/checks/#SA5008 + - SA5008 + # Invalid Printf call. + # https://staticcheck.dev/docs/checks/#SA5009 + - SA5009 + # Impossible type assertion. + # https://staticcheck.dev/docs/checks/#SA5010 + - SA5010 + # Possible nil pointer dereference. + # https://staticcheck.dev/docs/checks/#SA5011 + - SA5011 + # Passing odd-sized slice to function expecting even size. + # https://staticcheck.dev/docs/checks/#SA5012 + - SA5012 + # Using 'regexp.Match' or related in a loop, should use 'regexp.Compile'. + # https://staticcheck.dev/docs/checks/#SA6000 + - SA6000 + # Missing an optimization opportunity when indexing maps by byte slices. + # https://staticcheck.dev/docs/checks/#SA6001 + - SA6001 + # Storing non-pointer values in 'sync.Pool' allocates memory. + # https://staticcheck.dev/docs/checks/#SA6002 + - SA6002 + # Converting a string to a slice of runes before ranging over it. + # https://staticcheck.dev/docs/checks/#SA6003 + - SA6003 + # Inefficient string comparison with 'strings.ToLower' or 'strings.ToUpper'. + # https://staticcheck.dev/docs/checks/#SA6005 + - SA6005 + # Using io.WriteString to write '[]byte'. + # https://staticcheck.dev/docs/checks/#SA6006 + - SA6006 + # Defers in range loops may not run when you expect them to. + # https://staticcheck.dev/docs/checks/#SA9001 + - SA9001 + # Using a non-octal 'os.FileMode' that looks like it was meant to be in octal. + # https://staticcheck.dev/docs/checks/#SA9002 + - SA9002 + # Empty body in an if or else branch. + # https://staticcheck.dev/docs/checks/#SA9003 + - SA9003 + # Only the first constant has an explicit type. + # https://staticcheck.dev/docs/checks/#SA9004 + - SA9004 + # Trying to marshal a struct with no public fields nor custom marshaling. + # https://staticcheck.dev/docs/checks/#SA9005 + - SA9005 + # Dubious bit shifting of a fixed size integer value. + # https://staticcheck.dev/docs/checks/#SA9006 + - SA9006 + # Deleting a directory that shouldn't be deleted. + # https://staticcheck.dev/docs/checks/#SA9007 + - SA9007 + # 'else' branch of a type assertion is probably not reading the right value. + # https://staticcheck.dev/docs/checks/#SA9008 + - SA9008 + # Ineffectual Go compiler directive. + # https://staticcheck.dev/docs/checks/#SA9009 + - SA9009 stylecheck: - # STxxxx checks in https://staticcheck.dev/docs/configuration/options/#checks - # Default: ["*"] - checks: [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ] # https://staticcheck.dev/docs/configuration/options/#dot_import_whitelist # Default: ["github.com/mmcloughlin/avo/build", "github.com/mmcloughlin/avo/operand", "github.com/mmcloughlin/avo/reg"] dot-import-whitelist: @@ -2271,6 +3179,64 @@ linters-settings: # https://staticcheck.dev/docs/configuration/options/#http_status_code_whitelist # Default: ["200", "400", "404", "500"] http-status-code-whitelist: [ "200", "400", "404", "500" ] + # STxxxx checks in https://staticcheck.dev/docs/configuration/options/#checks + # Example (to disable some checks): [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ] + # Default: ["*"] + checks: + # Incorrect or missing package comment. + # https://staticcheck.dev/docs/checks/#ST1000 + - ST1000 + # Dot imports are discouraged. + # https://staticcheck.dev/docs/checks/#ST1001 + - ST1001 + # Poorly chosen identifier. + # https://staticcheck.dev/docs/checks/#ST1003 + - ST1003 + # Incorrectly formatted error string. + # https://staticcheck.dev/docs/checks/#ST1005 + - ST1005 + # Poorly chosen receiver name. + # https://staticcheck.dev/docs/checks/#ST1006 + - ST1006 + # A function's error value should be its last return value. + # https://staticcheck.dev/docs/checks/#ST1008 + - ST1008 + # Poorly chosen name for variable of type 'time.Duration'. + # https://staticcheck.dev/docs/checks/#ST1011 + - ST1011 + # Poorly chosen name for error variable. + # https://staticcheck.dev/docs/checks/#ST1012 + - ST1012 + # Should use constants for HTTP error codes, not magic numbers. + # https://staticcheck.dev/docs/checks/#ST1013 + - ST1013 + # A switch's default case should be the first or last case. + # https://staticcheck.dev/docs/checks/#ST1015 + - ST1015 + # Use consistent method receiver names. + # https://staticcheck.dev/docs/checks/#ST1016 + - ST1016 + # Don't use Yoda conditions. + # https://staticcheck.dev/docs/checks/#ST1017 + - ST1017 + # Avoid zero-width and control characters in string literals. + # https://staticcheck.dev/docs/checks/#ST1018 + - ST1018 + # Importing the same package multiple times. + # https://staticcheck.dev/docs/checks/#ST1019 + - ST1019 + # The documentation of an exported function should start with the function's name. + # https://staticcheck.dev/docs/checks/#ST1020 + - ST1020 + # The documentation of an exported type should start with type's name. + # https://staticcheck.dev/docs/checks/#ST1021 + - ST1021 + # The documentation of an exported variable or constant should start with variable's name. + # https://staticcheck.dev/docs/checks/#ST1022 + - ST1022 + # Redundant type in variable declaration. + # https://staticcheck.dev/docs/checks/#ST1023 + - ST1023 tagalign: # Align and sort can be used together or separately. @@ -2350,7 +3316,9 @@ linters-settings: - blank-import - bool-compare - compares + - contains - empty + - encoded-compare - error-is-as - error-nil - expected-actual @@ -2360,6 +3328,7 @@ linters-settings: - len - negative-positive - nil-compare + - regexp - require-error - suite-broken-parallel - suite-dont-use-pkg @@ -2373,15 +3342,17 @@ linters-settings: disable-all: true # Enable checkers by name # (in addition to default - # blank-import, bool-compare, compares, empty, error-is-as, error-nil, expected-actual, go-require, float-compare, - # formatter, len, negative-positive, nil-compare, require-error, suite-broken-parallel, suite-dont-use-pkg, - # suite-extra-assert-call, suite-subtest-run, useless-assert + # blank-import, bool-compare, compares, contains, empty, encoded-compare, error-is-as, error-nil, expected-actual, + # go-require, float-compare, formatter, len, negative-positive, nil-compare, regexp, require-error, + # suite-broken-parallel, suite-dont-use-pkg, suite-extra-assert-call, suite-subtest-run, useless-assert # ). enable: - blank-import - bool-compare - compares + - contains - empty + - encoded-compare - error-is-as - error-nil - expected-actual @@ -2391,6 +3362,7 @@ linters-settings: - len - negative-positive - nil-compare + - regexp - require-error - suite-broken-parallel - suite-dont-use-pkg @@ -2411,7 +3383,12 @@ linters-settings: # To enable go vet's printf checks. # Default: true check-format-string: false - # To require f-assertions if format string is used. + # To require f-assertions (e.g. `assert.Equalf`) if format string is used, even if there are no variable-length + # variables, i.e. it requires `require.NoErrorf` for both these cases: + # - require.NoErrorf(t, err, "unexpected error") + # - require.NoErrorf(t, err, "unexpected error for sid: %v", sid) + # To understand this behavior, please read the + # https://github.com/Antonboom/testifylint?tab=readme-ov-file#historical-reference-of-formatter. # Default: false require-f-funcs: true go-require: diff --git a/.goreleaser.yml b/.goreleaser.yml index 43e60937c912..0280c0b9e6b8 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -127,13 +127,54 @@ chocolateys: summary: Fast linters Runner for Go description: | {{ .ProjectName }} installer package. - Fast linters Runner for Go . + Fast linters Runner for Go. release_notes: "https://github.com/golangci/golangci-lint/releases/tag/v{{ .Version }}" api_key: "{{ .Env.CHOCOLATEY_API_KEY }}" source_repo: "https://push.chocolatey.org/" skip_publish: false goamd64: v1 +aurs: + - description: Fast linters runner for Go. + skip_upload: false + homepage: https://golangci.com + provides: + - "golangci-lint" + maintainers: + - "Fernandez Ludovic " + license: GPL-3.0 + private_key: "{{ .Env.AUR_KEY }}" + git_url: "ssh://aur@aur.archlinux.org/golangci-lint-bin.git" + commit_author: + name: golangci-releaser + email: 65486276+golangci-releaser@users.noreply.github.com + package: |- + # bin + install -Dm755 "./golangci-lint" "${pkgdir}/usr/bin/golangci-lint" + + # license + install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/golangci-lint/LICENSE" + + # completions + mkdir -p "${pkgdir}/usr/share/bash-completion/completions/" + mkdir -p "${pkgdir}/usr/share/zsh/site-functions/" + mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/" + ./golangci-lint completion bash | install -Dm644 /dev/stdin "${pkgdir}/usr/share/bash-completion/completions/golangci-lint" + ./golangci-lint completion zsh | install -Dm644 /dev/stdin "${pkgdir}/usr/share/zsh/site-functions/_golangci-lint" + ./golangci-lint completion fish | install -Dm644 /dev/stdin "${pkgdir}/usr/share/fish/vendor_completions.d/golangci-lint.fish" + +snapcrafts: + - name_template: "{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" + grade: stable + confinement: classic + license: GPL-3.0 + base: core22 + summary: Fast linters runner for Go. + description: | + It runs linters in parallel, uses caching, supports YAML configuration, integrates with all major IDEs, and includes over a hundred linters. + disable: false + publish: true + nfpms: - id: golangci-lint-nfpms diff --git a/CHANGELOG.md b/CHANGELOG.md index b06f959deff7..2094cb03f31f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,55 @@ -Follow the news and releases on [Mastodon](https://fosstodon.org/@golangcilint) and on [Twitter](https://twitter.com/golangci). +Follow the news and releases on [Mastodon](https://fosstodon.org/@golangcilint) and on [Bluesky](https://bsky.app/profile/golangcilint.bsky.social). + +`golangci-lint` is a free and open-source project built by volunteers. + +If you value it, consider supporting us, we appreciate it! ❤️ + +[![Open Collective backers and sponsors](https://img.shields.io/badge/OpenCollective-Donate-blue?logo=opencollective&style=for-the-badge)](https://opencollective.com/golangci-lint) +[![GitHub Sponsors](https://img.shields.io/badge/GitHub-Donate-blue?logo=github&style=for-the-badge)](https://github.com/sponsors/golangci) + +### v1.62.0 + +1. New linters + * Add `recvcheck` linter https://github.com/raeperd/recvcheck + * Add `iface` linter https://github.com/uudashr/iface +2. Updated linters + * ⚠️ `execinquery`: deprecation step 2 + * ⚠️ `gomnd`: deprecation step 2 (replaced by `mnd`) + * `bidichk`: from 0.2.7 to 0.3.2 (important performance improvement) + * `canonicalheader`: from 1.1.1 to 1.1.2 + * `cyclop`: from 1.2.1 to 1.2.3 + * `dupword`: from 0.1.1 to 0.1.3 + * `errcheck`: from 1.7.0 to 1.8.0 + * `errchkjson`: from 0.3.6 to 0.4.0 + * `errname`: from 0.1.13 to 1.0.0 + * `ginkgolinter`: from 0.17.0 to 0.18.0 (new option: `force-succeed`) + * `go-check-sumtype`: from 0.1.4 to 0.2.0 (new option: `default-signifies-exhaustive`) + * `go-critic`: from 0.11.4 to 0.11.5 + * `go-printf-func-name`: from 7558a9eaa5af to v0.1.0 + * `godot`: from 1.4.17 to 1.4.18 + * `gosec`: from 2.21.2 to 2.21.4 + * `intrange`: from 0.2.0 to 0.2.1 + * `loggercheck`: from 0.9.4 to 0.10.1 (`log/slog` support) + * `musttag`: from 0.12.2 to 0.13.0 + * `nakedret`: from 2.0.4 to 2.0.5 + * `nilnil`: from 0.1.9 to 1.0.0 (new option: `detect-opposite`) + * `noctx`: from 0.0.2 to 0.1.0 + * `protogetter`: from 0.3.6 to 0.3.8 + * `revive`: from 1.3.9 to 1.5.0 (new rules: `filename-format`, and `file-length-limit`) + * `tenv`: from 1.10.0 to 1.12.1 (handle dot import) + * `testifylint`: from 1.4.3 to 1.5.0 (new checkers: `contains`, `encoded-compare`, `regexp`) +3. Misc. + * Type sizing when cross-compiling (32-bit). + * code-climate: add check_name field + * Improve Go version detection + * Fix Go version propagation +4. Documentation + * Adds a section about `exclude-dirs-use-default` + * Improve 'install from sources' section + * Improve FAQ about Go versions + * Improve linter/rule/check docs + * Improve new linter section + * Improve `forbidigo` pattern examples for built-in functions ### v1.61.0 diff --git a/README.md b/README.md index 70052187afe8..7255d1425494 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,9 @@ Documentation is hosted at https://golangci-lint.run. ## Social Networks [![Join Slack](https://img.shields.io/badge/Slack-4285F4?logo=slack&logoColor=white)](https://gophers.slack.com/archives/CS0TBRKPC) -[![Follow on Mastodon](https://img.shields.io/badge/mastodon-6364FF?logo=mastodon&logoColor=white)](https://fosstodon.org/@golangcilint) -[![Follow on Twitter](https://img.shields.io/badge/twitter-1DA1F2?logo=twitter&logoColor=white)](https://twitter.com/golangci) +[![Follow on Mastodon](https://img.shields.io/badge/Mastodon-6364FF?logo=mastodon&logoColor=white)](https://fosstodon.org/@golangcilint) +[![Follow on Bluesky](https://img.shields.io/badge/Bluesky-0a7aff?logo=bluesky&logoColor=white)](https://bsky.app/profile/golangcilint.bsky.social) +[![Follow on Twitter](https://img.shields.io/badge/Twitter-1DA1F2?logo=x&logoColor=white)](https://twitter.com/golangci) ## Supporting Us @@ -48,753 +49,7 @@ If you value it, consider supporting us, we appreciate it! :heart: This project exists thanks to all the people who contribute. [How to contribute](https://golangci-lint.run/contributing/quick-start/). - - - -### Core Team - -
-About core team - -The GolangCI Core Team is a group of contributors who have demonstrated a lasting enthusiasm for the project and community. -The GolangCI Core Team has GitHub admin privileges on the repo. - -#### Responsibilities - -The Core Team has the following responsibilities: - -1. Being available to answer high-level questions about vision and future. -2. Being available to review longstanding/forgotten pull requests. -3. Occasionally check issues, offer input, and categorize with GitHub issue labels. -4. Looking out for up-and-coming members of the GolangCI community who might want to serve as Core Team members. -5. Note that the Core Team – and all GolangCI contributors – are open-source volunteers; membership on the Core Team is expressly not an obligation. The Core Team is distinguished as leaders in the community and while they are a good group to turn to when someone needs an answer to a question, they are still volunteering their time, and may not be available to help immediately. - -
- - - - - - - -

Ludovic Fernandez

Denis Isaev

Aleksandr Razumov
- -### Team - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Simon Sawert

Sergey Vilgelm

Oleksandr Redko

Tam Mach

Trevor Pounds

Anton Telyshev

Loong Dai

Oleg Butuzov

Kamil Samigullin

Sascha Grunert

@iwankgb

Andrew Shannon Brown

Marat Reymers

sivchari

@leonklingele

Ryan Currah

Pierre Durand

Sebastien Rosset

Sasha Melentyev

Denis Tingaikin

Patrick Ohly

Alexey Palazhchenko

David Lobe

Ville Skyttä

Duco van Amstel

Nishanth Shanmugham

Kensei Nakada

ccoVeille

Melvin

quasilyte

Denis Krivak

Alec Thomas

Mitsuo HEIJO

Steve Coffman

Maik Schreiber
- -
-And 509 more our team members - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Nahshon Unna Tsameret

Tom

Matouš Dzivjak

Nuruddin Ashr

Will Dixon

Mateusz Gozdek

Mateus Oliveira

Peter Mescalchin

Michael Mulligan

Joe Wilner

Soichiro Kashima

Lucas Bremgartner

@alingse

Steven Hartland

Oleg Kovalov

@silverwind

Florian Bosdorff

Kir Kolyshkin

Tim Heckman

James

Colin Arnott

Ethan Reesor

Anton Zinovyev

@Zxilly

Luke T. Shumaker

Aleksey Bakin

Márk Sági-Kazár

Rski

Ryan Boehning

Gustavo Bazan

Eugene Simonov

Timon Wong

ferhat elmas

Nate Finch

Aliaksandr Mianzhynski

Aneesh Agrawal

sonatard

Leigh McCulloch

Denis Limarev

ZhangYunHao

Vladimir Evgrafov

Ryosei Karaki

gaojingyu

@odidev

Fabian Holler

NiseVoid

Christian Mehlmauer

Sean DuBois

Viktoras Makauskas

SystemGlitch

Yifei Liu

Agniva De Sarker

Adam Shannon

Ilia Sergunin

Henrik Johansson

Florent Viel

Tom Arrell

Choko

John Starich

Koichi Shiraishi

Bart

Neha Viswanathan

David Braley

Sam Zaydel

Lukas Malkmus

Vladislav Fursov

Olivier Mengué

Shulhan

Chris Bandy

Patrick Kuca

Viacheslav Poturaev

Catena cyber

@Abirdcfly

Hendry Wiranto

Robert Liebowitz

Gabriel Augendre

Mitar

Paweł Żak

Zik Aeroh

sylvia

Roman Chaliy

Zeal Wierslee

Kyoh

Tim Kral

Hiroyuki Yagihashi

Denis Voytyuk

Jiangnan Jia

Adam Jones

Kunwardeep

Pierre R

Stephan Renatus

Martin Desrumaux

tdakkota

Ivan

Carlos Henrique Guardão Gandarez

Diego Pontoriero

Daniel Helfand

Benjamin Wang

Craig Silverstein

Faisal Alam

Alex Collins

Ryo Nakao

Ryan Olds

Matthew Hughes

Matheus Macabu

Tommy Mühle

Sebastiaan van Stijn

Hans Wernetti

Carlos Alexandro Becker

Dominik K.

Joshua Timmons

Sindre Røkenes Myren

Bartłomiej Klimczak

Fata Nugraha

M. Ángel Jimeno

Jan Oopkaup

Chris Drew

Teiva Harsanyi

Brian Flad

Chris Suszynski

Sean McGinnis

@chenfeining

Kailun Qin

Misha Gusarov

Ariel Mashraki

Oscar

Denis Isaev

Dreamacro

Tom Payne

@fsouza

jessetang

Siarhei Navatski

Chris Halbert

Koya IWAMURA

Hiroki Suezawa

Lauris BH

Fabrice

Christoph Blecker

Mateusz Bilski

Jakub Chábek

Ben Ye

Stephen Brown II

lufe

@sg0hsmt

Stephanie Wilde-Hobbs

Cory LaNou

Vitaly Isaev

Derek Perkins

Adam Bouqdib

Pete Wagner

Renato Suero

Clifton Kaznocha

Buyanov Vladimir

Sven Anderson

Ben Wells

Jonathan Chappelow

Yuki Okushi

hbc

WÁNG Xuěruì

@796RCP92VZ

Kévin Dunglas

Eric Wohltman

Borja Clemente

Mattias de Zalenski

@AlduLonghi

Justin Fuller

masibw

Navneeth Jayendran

Eduard Castany

Sonia Hamilton

@black-06

Gianguido Sorà

Oksana Grishchenko

Gareth Jones

Berezhnoy Pavel

proton

Son Luong Ngoc

Henry

Aofei Sheng

rnben

Maksym Pavlenko

Ivan Prisyazhnyy

@ngehrsitz

John Reese

Matthew Gabeler-Lee

Matthew Dowdell

James Lucktaylor

Masahiro Furudate

Dale Hui

Ondrej Fabry

Aris Tzoumas

Gabor Javorszky

hori-ryota

Kishan B

Eugene R.

Eric Jain

Ghvst Code

Markus

Sebastian Spaink

Andrew Lavery

Mark Fine

Rory Prendergast

Olli Raula

Tariq

Peter Štibraný

kaixiang zhong

@ced42

David Bariod

Stephen Benjamin

@kkHAIKE

Hsing-Yu (David) Chen

Batuhan Apaydın

Roman Gerasimov

Mostafa Moradian

@jkeys089

过客龙门

Eldar Rakhimberdin

Toon Schoenmakers

Cezar Sá Espinola

Ben Paxton

Connor Adams

Draven

David Cuadrado

Max Riveiro

Jeroen Demeyer

Mārtiņš Irbe

Yilong Li

Rodrigo Brito

@techknowlogick

takaya

Craig Furman

@ttys3

Michael Freeman

Mark Sart

Joshua Rubin

Danil Ovchinnikov

Rafael Franco

Ksenia Rogova

Paul Vaughan

Jared Allard

Glen Mailer

Ian Howell

Chris K

Grigory Zubankov

@xxpxxxxp

subham sarkar

Ryan Leung

Donal Byrne

@trajan0x

Yusuke Kadowaki

@CfirTsabari

Navneeth Jayendran

Marko

Chris Lewis

Muhammad Ikhsan

Anton Braer

Jaegoo Kim

David Gleich

@connorszczepaniak-wk

yuqengo

Dejan Benedik

Craig Rodrigues

Askari

Amir Hosseini

David Beitey

Brandur Leach

Dan Richelson

Denis Titusov

Daniil Pershin

Terdunov Vyacheslav

Sean Chittenden

Hui Zhu

@Harsimran1

rinsuki

Anton Antonov

@hn8

Kevin Gillette

Milas Bowman

@credativ-dar

Sean Lewis

☃ Elliot Shepherd

Nicolae Vartolomei

Martin Etmajer

Fisher Xu

Matthew Poer

Cody Ley-Han

@darklore

@to6ka

Wilkins

Collin Kreklow

Marcin Owsiany

C.J. Jameson

Jacek

paul fisher

@ofw

Rafik Draoui

Miles Delahunty

Anton Kachurin

Nico Ismaili

Benjamin Kane

Philip Linell

Herman van Zyl

Jongwoo Han

Yury Gargay

Jan Carreras

aimuz

Ryo Sato

Eric Zimanyi

Ben Bernays

Boban Acimovic

Tiago Peczenyj

Sean Trantalis

Viktor Alenkov

Eduardo Alves

Alex Bagnolini

Dima

David Hill

Troy Ronda

Andrey Grazhdankov

Ash McKenzie

K4YT3X

Florian Gessner

Osamu TONOMORI

Bo Liu

Steven Allen

Colin Arnott

Eran Levy

Roman Leventov

Hugo

Mathias Weber

Naveen

@maxsond

Maksim Meshkov

@raffepaffe

Abhinav Gupta

Michael

Evgeniy Kulikov

Chris Nesbitt-Smith

Daniel Caballero

Igor Zibarev

Carl Henderson

Shintaro Anazawa

Matt Braymer-Hayes

Arjen van der Ende

Pete Davison

Nanguan Lin

Devon Stewart

Silas Sewell

Tomas Dabašinskas

@xuri

Charl Matthee

Sriram Venkatesh

Peter Schuller

David Golub

Alexander Morozov

Pastoh

Liam White

Alex Dupre

Juanito

Jinming Yue

@wxdao

Sijie Yang

Stephen

Thang Minh Vu

Julia Ogris

Greg Curtis

@ac-rappi

Dudás Ádám

Abhishek | अभिषेक

Daniele

Takumasa Sakao

Ben Drucker

Matthew Cobbing

@Darlez

Kirill Danshin

mook

Kyungmin Bae

Dylan Arbour

Cory Miller

Ben Brown

Dor

sink

João Freitas

nick

David Bendory

@znley

Jonathan Colby

Justin Robertson

Caleb Xu

Tobias

Namco

Vasyl Haievyi

@andreykuchin

Irina

Petr Pučil

Aaron Bennett

zaunist

Egor Kovetskiy

Daniil Suvorov

Yuki Watanabe

Aisuko

Tung Leo

Kunal Singh

Rui Chen

Rez

Alexandre Vilain

Federico Guerinoni

Matias Lahti

Thirukumaran Vaseeharan

Alessio Treglia

Alay Patel

Linus Arver

Martin Hutchinson

Emanuel Bennici

Mayo

smantic

Sebastian Crane

Alexander Else

@vladopajic

@oxr463

Trim21

@eiffel-fl

@oliverpool

@Ak-Army

@humancalico

Christian Clauss

Johanan Liebermann

Korjavin Ivan

Eng Zer Jun

Mateus Esdras

Devin Gunay

Hilário Coelho

Thomas Cave

Selim Can CABA

Tibo Delor

@chainchad

Francois Parquet

Robert Kopaczewski

Marc Tudurí

@pohang

Cyrille Meichel

neglect-yp

Felix

Adrien

Joe Bergevin

Axetroy

Guillaume JG

Evan Cordell

靳灿奇

Nassos Kat

hitzhangjie

Jesse Donat

Oleg Shparber

Tomi Juntunen

Miel Donkers

Marccio Silva

Bastian

Tiago Silva

KADOTA, Kyohei

Conor Evans

Anirudh Sylendranath

@jumpeiMano

Alex Rodin

Oliver Gugger

Bryan Andrews

@TomerJLevy

Dmitry Titov

Thomas Gorham

Wei Jian Gan

Tamás Gulácsi

Jack Wilsdon

Michał Suchwałko

Alexander Apalikov

Domas Tamašauskas

Stéphane Chausson

neo_sli

@srdhoni

@derekhuizhang

takaokanbe

Sean Schneeweiss

pprzekwas

madflow

Arman Tarkhanian

John Adler

@licraft2019

@mlueckest

Malte Ehrlen

@golangaccount

Tyler Dorn

Enmanuel Moreira

Sylvain Rabot

Piotr Persona

Han Gyoung-Su

Harry Tennent

Kamyar Mirzavaziri

@w1ck3dg0ph3r

Richard Yuh

caption

Yi Song

guoguangwu

Artem K

R. Aidan Campbell

Mikhail Podtserkovskiy

oz

Erik Westra

Thomas Bonfort

Matthieu MOREL

Jared Szechy

Wilhelm Ågren
- -
- - - - + ## Stargazers over time diff --git a/assets/github-action-config.json b/assets/github-action-config.json index 1c693f4ce91b..cf611757b4bd 100644 --- a/assets/github-action-config.json +++ b/assets/github-action-config.json @@ -1,8 +1,8 @@ { "MinorVersionToConfig": { "latest": { - "TargetVersion": "v1.61.0", - "AssetURL": "https://github.com/golangci/golangci-lint/releases/download/v1.61.0/golangci-lint-1.61.0-linux-amd64.tar.gz" + "TargetVersion": "v1.62.0", + "AssetURL": "https://github.com/golangci/golangci-lint/releases/download/v1.62.0/golangci-lint-1.62.0-linux-amd64.tar.gz" }, "v1.10": { "Error": "golangci-lint version 'v1.10' isn't supported: we support only v1.14.0 and later versions" @@ -220,6 +220,10 @@ "TargetVersion": "v1.61.0", "AssetURL": "https://github.com/golangci/golangci-lint/releases/download/v1.61.0/golangci-lint-1.61.0-linux-amd64.tar.gz" }, + "v1.62": { + "TargetVersion": "v1.62.0", + "AssetURL": "https://github.com/golangci/golangci-lint/releases/download/v1.62.0/golangci-lint-1.62.0-linux-amd64.tar.gz" + }, "v1.7": { "Error": "golangci-lint version 'v1.7' isn't supported: we support only v1.14.0 and later versions" }, diff --git a/assets/linters-info.json b/assets/linters-info.json index 7366356b78e6..d16feecd1b9f 100644 --- a/assets/linters-info.json +++ b/assets/linters-info.json @@ -2,19 +2,19 @@ { "name": "asasalint", "desc": "check for pass []any as any in variadic func(...any)", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs" ], "originalURL": "https://github.com/alingse/asasalint", "internal": false, "isSlow": true, - "since": "1.47.0" + "since": "v1.47.0" }, { "name": "asciicheck", "desc": "checks that all code identifiers does not have non-ASCII symbols in the name", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "bugs", "style" @@ -27,19 +27,19 @@ { "name": "bidichk", "desc": "Checks for dangerous unicode character sequences", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "bugs" ], "originalURL": "https://github.com/breml/bidichk", "internal": false, "isSlow": false, - "since": "1.43.0" + "since": "v1.43.0" }, { "name": "bodyclose", "desc": "checks whether HTTP response body is closed successfully", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "performance", "bugs" @@ -52,7 +52,7 @@ { "name": "canonicalheader", "desc": "canonicalheader checks whether net/http.Header uses canonical header", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -64,19 +64,19 @@ { "name": "containedctx", "desc": "containedctx is a linter that detects struct contained context.Context field", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], "originalURL": "https://github.com/sivchari/containedctx", "internal": false, "isSlow": true, - "since": "1.44.0" + "since": "v1.44.0" }, { "name": "contextcheck", "desc": "check whether the function uses a non-inherited context", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs" ], @@ -88,7 +88,7 @@ { "name": "copyloopvar", "desc": "copyloopvar is a linter detects places where loop variables are copied", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -100,7 +100,7 @@ { "name": "cyclop", "desc": "checks function and package cyclomatic complexity", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "complexity" ], @@ -112,7 +112,7 @@ { "name": "decorder", "desc": "check declaration order and count of types, constants, variables and functions", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "format", "style" @@ -125,7 +125,7 @@ { "name": "depguard", "desc": "Go linter that checks if package imports are in a list of acceptable packages", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style", "import", @@ -139,7 +139,7 @@ { "name": "dogsled", "desc": "Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -151,7 +151,7 @@ { "name": "dupl", "desc": "Tool for code clone detection", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -163,19 +163,19 @@ { "name": "dupword", "desc": "checks for duplicate words in the source code", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "comment" ], "originalURL": "https://github.com/Abirdcfly/dupword", "internal": false, "isSlow": false, - "since": "1.50.0" + "since": "v1.50.0" }, { "name": "durationcheck", "desc": "check for two durations multiplied together", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs" ], @@ -188,7 +188,7 @@ "name": "errcheck", "desc": "errcheck is a program for checking for unchecked errors in Go code. These unchecked errors can be critical bugs in some cases", "enabledByDefault": true, - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs", "error" @@ -200,20 +200,20 @@ }, { "name": "errchkjson", - "desc": "Checks types passed to the json encoding functions. Reports unsupported types and reports occations, where the check for the returned error can be omitted.", - "loadMode": 575, + "desc": "Checks types passed to the json encoding functions. Reports unsupported types and reports occurrences where the check for the returned error can be omitted.", + "loadMode": 8767, "inPresets": [ "bugs" ], "originalURL": "https://github.com/breml/errchkjson", "internal": false, "isSlow": true, - "since": "1.44.0" + "since": "v1.44.0" }, { "name": "errname", "desc": "Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`.", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -225,7 +225,7 @@ { "name": "errorlint", "desc": "errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13.", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs", "error" @@ -235,26 +235,10 @@ "isSlow": true, "since": "v1.32.0" }, - { - "name": "execinquery", - "desc": "execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds", - "loadMode": 575, - "inPresets": [ - "sql" - ], - "originalURL": "https://github.com/1uf3/execinquery", - "internal": false, - "isSlow": true, - "since": "v1.46.0", - "deprecation": { - "since": "v1.58.0", - "message": "The repository of the linter has been archived by the owner." - } - }, { "name": "exhaustive", "desc": "check exhaustiveness of enum switch statements", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs" ], @@ -266,7 +250,7 @@ { "name": "exhaustruct", "desc": "Checks if all structure fields are initialized", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style", "test" @@ -279,7 +263,7 @@ { "name": "exportloopref", "desc": "checks for pointers to enclosing loop variables", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs" ], @@ -296,7 +280,7 @@ { "name": "forbidigo", "desc": "Forbids identifiers", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -308,7 +292,7 @@ { "name": "forcetypeassert", "desc": "finds forced type assertions", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -320,19 +304,19 @@ { "name": "fatcontext", "desc": "detects nested contexts in loops and function literals", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "performance" ], "originalURL": "https://github.com/Crocmagnon/fatcontext", "internal": false, "isSlow": true, - "since": "1.58.0" + "since": "v1.58.0" }, { "name": "funlen", "desc": "Tool for detection of long functions", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "complexity" ], @@ -344,7 +328,7 @@ { "name": "gci", "desc": "Gci controls Go package import order and makes it always deterministic.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "format", "import" @@ -358,7 +342,7 @@ { "name": "ginkgolinter", "desc": "enforces standards of using ginkgo and gomega", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -370,7 +354,7 @@ { "name": "gocheckcompilerdirectives", "desc": "Checks that go compiler directive comments (//go:) are valid.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "bugs" ], @@ -382,7 +366,7 @@ { "name": "gochecknoglobals", "desc": "Check that no global variables exist.", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -394,7 +378,7 @@ { "name": "gochecknoinits", "desc": "Checks that no init functions are present in Go code", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -405,7 +389,7 @@ { "name": "gochecksumtype", "desc": "Run exhaustiveness checks on Go \"sum types\"", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs" ], @@ -417,7 +401,7 @@ { "name": "gocognit", "desc": "Computes and checks the cognitive complexity of functions", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "complexity" ], @@ -429,7 +413,7 @@ { "name": "goconst", "desc": "Finds repeated strings that could be replaced by a constant", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -441,7 +425,7 @@ { "name": "gocritic", "desc": "Provides diagnostics that check for bugs, performance and style issues.\nExtensible without recompilation through dynamic rules.\nDynamic rules are written declaratively with AST patterns, filters, report message and optional suggestion.", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style", "metalinter" @@ -455,7 +439,7 @@ { "name": "gocyclo", "desc": "Computes and checks the cyclomatic complexity of functions", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "complexity" ], @@ -467,7 +451,7 @@ { "name": "godot", "desc": "Check if comments end in a period", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style", "comment" @@ -481,7 +465,7 @@ { "name": "godox", "desc": "Tool for detection of FIXME, TODO and other comment keywords", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style", "comment" @@ -494,7 +478,7 @@ { "name": "err113", "desc": "Go linter to check the errors handling expressions", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style", "error" @@ -510,7 +494,7 @@ { "name": "gofmt", "desc": "Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "format" ], @@ -523,7 +507,7 @@ { "name": "gofumpt", "desc": "Gofumpt checks whether code was gofumpt-ed.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "format" ], @@ -535,8 +519,8 @@ }, { "name": "goheader", - "desc": "Checks is file header matches to pattern", - "loadMode": 7, + "desc": "Checks if file header matches to pattern", + "loadMode": 8199, "inPresets": [ "style" ], @@ -549,7 +533,7 @@ { "name": "goimports", "desc": "Check import statements are formatted according to the 'goimport' command. Reformat imports in autofix mode.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "format", "import" @@ -563,7 +547,7 @@ { "name": "mnd", "desc": "An analyzer to detect magic numbers.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -572,27 +556,10 @@ "isSlow": false, "since": "v1.22.0" }, - { - "name": "gomnd", - "desc": "An analyzer to detect magic numbers.", - "loadMode": 7, - "inPresets": [ - "style" - ], - "originalURL": "https://github.com/tommy-muehle/go-mnd", - "internal": false, - "isSlow": false, - "since": "v1.22.0", - "deprecation": { - "since": "v1.58.0", - "message": "The linter has been renamed.", - "replacement": "mnd" - } - }, { "name": "gomoddirectives", "desc": "Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style", "module" @@ -605,7 +572,7 @@ { "name": "gomodguard", "desc": "Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style", "import", @@ -619,11 +586,11 @@ { "name": "goprintffuncname", "desc": "Checks that printf-like functions are named with `f` at the end.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], - "originalURL": "https://github.com/jirfag/go-printf-func-name", + "originalURL": "https://github.com/golangci/go-printf-func-name", "internal": false, "isSlow": false, "since": "v1.23.0" @@ -631,7 +598,7 @@ { "name": "gosec", "desc": "Inspects source code for security problems", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs" ], @@ -647,7 +614,7 @@ "name": "gosimple", "desc": "Linter for Go source code that specializes in simplifying code", "enabledByDefault": true, - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -662,7 +629,7 @@ { "name": "gosmopolitan", "desc": "Report certain i18n/l10n anti-patterns in your Go codebase", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs" ], @@ -675,7 +642,7 @@ "name": "govet", "desc": "Vet examines Go source code and reports suspicious constructs. It is roughly the same as 'go vet' and uses its passes.", "enabledByDefault": true, - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs", "metalinter" @@ -692,7 +659,7 @@ { "name": "grouper", "desc": "Analyze expression groups.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -701,10 +668,22 @@ "isSlow": false, "since": "v1.44.0" }, + { + "name": "iface", + "desc": "Detect the incorrect use of interfaces, helping developers avoid interface pollution.", + "loadMode": 8767, + "inPresets": [ + "style" + ], + "originalURL": "https://github.com/uudashr/iface", + "internal": false, + "isSlow": true, + "since": "v1.62.0" + }, { "name": "importas", "desc": "Enforces consistent import aliases", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -716,7 +695,7 @@ { "name": "inamedparam", "desc": "reports interfaces with unnamed method parameters", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -729,7 +708,7 @@ "name": "ineffassign", "desc": "Detects when assignments to existing variables are not used", "enabledByDefault": true, - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "unused" ], @@ -741,7 +720,7 @@ { "name": "interfacebloat", "desc": "A linter that checks the number of methods inside an interface.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -753,7 +732,7 @@ { "name": "intrange", "desc": "intrange is a linter to find places where for loops could make use of an integer range.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -765,7 +744,7 @@ { "name": "ireturn", "desc": "Accept Interfaces, Return Concrete Types", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -777,7 +756,7 @@ { "name": "lll", "desc": "Reports long lines", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -788,7 +767,7 @@ { "name": "loggercheck", "desc": "Checks key value pairs for common logger libraries (kitlog,klog,logr,zap).", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style", "bugs" @@ -804,7 +783,7 @@ { "name": "maintidx", "desc": "maintidx measures the maintainability index of each function.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "complexity" ], @@ -816,7 +795,7 @@ { "name": "makezero", "desc": "Finds slice declarations with non-zero initial length", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style", "bugs" @@ -829,7 +808,7 @@ { "name": "mirror", "desc": "reports wrong mirror patterns of bytes/strings usage", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -842,7 +821,7 @@ { "name": "misspell", "desc": "Finds commonly misspelled English words", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style", "comment" @@ -856,7 +835,7 @@ { "name": "musttag", "desc": "enforce field tags in (un)marshaled structs", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style", "bugs" @@ -869,7 +848,7 @@ { "name": "nakedret", "desc": "Checks that functions with naked returns are not longer than a maximum size (can be zero).", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -881,7 +860,7 @@ { "name": "nestif", "desc": "Reports deeply nested if statements", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "complexity" ], @@ -893,7 +872,7 @@ { "name": "nilerr", "desc": "Finds the code that returns nil even if it checks that the error is not nil.", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs" ], @@ -905,7 +884,7 @@ { "name": "nilnil", "desc": "Checks that there is no simultaneous return of `nil` error and an invalid value.", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -917,7 +896,7 @@ { "name": "nlreturn", "desc": "nlreturn checks for a new line before return and branch statements to increase code clarity", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -929,7 +908,7 @@ { "name": "noctx", "desc": "Finds sending http request without context.Context", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "performance", "bugs" @@ -942,7 +921,7 @@ { "name": "nonamedreturns", "desc": "Reports all named returns", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -954,7 +933,7 @@ { "name": "nosprintfhostport", "desc": "Checks for misuse of Sprintf to construct a host with port in a URL.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -966,7 +945,7 @@ { "name": "paralleltest", "desc": "Detects missing usage of t.Parallel() method in your Go test", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style", "test" @@ -979,7 +958,7 @@ { "name": "perfsprint", "desc": "Checks that fmt.Sprintf can be replaced with a faster alternative.", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "performance" ], @@ -991,7 +970,7 @@ { "name": "prealloc", "desc": "Finds slice declarations that could potentially be pre-allocated", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "performance" ], @@ -1003,7 +982,7 @@ { "name": "predeclared", "desc": "find code that shadows one of Go's predeclared identifiers", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -1015,7 +994,7 @@ { "name": "promlinter", "desc": "Check Prometheus metrics naming via promlint", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -1027,7 +1006,7 @@ { "name": "protogetter", "desc": "Reports direct reads from proto message fields when getters should be used", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs" ], @@ -1040,19 +1019,31 @@ { "name": "reassign", "desc": "Checks that package variables are not reassigned", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs" ], "originalURL": "https://github.com/curioswitch/go-reassign", "internal": false, "isSlow": true, - "since": "1.49.0" + "since": "v1.49.0" + }, + { + "name": "recvcheck", + "desc": "checks for receiver type consistency", + "loadMode": 8767, + "inPresets": [ + "bugs" + ], + "originalURL": "https://github.com/raeperd/recvcheck", + "internal": false, + "isSlow": true, + "since": "v1.62.0" }, { "name": "revive", "desc": "Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style", "metalinter" @@ -1065,7 +1056,7 @@ { "name": "rowserrcheck", "desc": "checks whether Rows.Err of rows is checked successfully", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs", "sql" @@ -1078,7 +1069,7 @@ { "name": "sloglint", "desc": "ensure consistent code style when using log/slog", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style", "format" @@ -1091,7 +1082,7 @@ { "name": "sqlclosecheck", "desc": "Checks that sql.Rows, sql.Stmt, sqlx.NamedStmt, pgx.Query are closed.", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs", "sql" @@ -1104,7 +1095,7 @@ { "name": "spancheck", "desc": "Checks for mistakes with OpenTelemetry/Census spans.", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs" ], @@ -1117,7 +1108,7 @@ "name": "staticcheck", "desc": "It's a set of rules from staticcheck. It's not the same thing as the staticcheck binary. The author of staticcheck doesn't support or approve the use of staticcheck as a library inside golangci-lint.", "enabledByDefault": true, - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs", "metalinter" @@ -1133,7 +1124,7 @@ { "name": "stylecheck", "desc": "Stylecheck is a replacement for golint", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -1145,7 +1136,7 @@ { "name": "tagalign", "desc": "check that struct tags are well aligned", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style", "format" @@ -1159,7 +1150,7 @@ { "name": "tagliatelle", "desc": "Checks the struct tags.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -1171,7 +1162,7 @@ { "name": "tenv", "desc": "tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "test" ], @@ -1183,7 +1174,7 @@ { "name": "testableexamples", "desc": "linter checks if examples are testable (have an expected output)", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "test" ], @@ -1195,7 +1186,7 @@ { "name": "testifylint", "desc": "Checks usage of github.com/stretchr/testify.", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "test", "bugs" @@ -1208,7 +1199,7 @@ { "name": "testpackage", "desc": "linter that makes you use a separate _test package", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style", "test" @@ -1221,7 +1212,7 @@ { "name": "thelper", "desc": "thelper detects tests helpers which is not start with t.Helper() method.", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "test" ], @@ -1233,7 +1224,7 @@ { "name": "tparallel", "desc": "tparallel detects inappropriate usage of t.Parallel() method in your Go test codes.", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style", "test" @@ -1247,7 +1238,7 @@ "name": "typecheck", "desc": "Like the front-end of a Go compiler, parses and type-checks Go code", "enabledByDefault": true, - "loadMode": 7, + "loadMode": 8199, "internal": true, "isSlow": false, "since": "v1.3.0" @@ -1255,7 +1246,7 @@ { "name": "unconvert", "desc": "Remove unnecessary type conversions", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -1267,7 +1258,7 @@ { "name": "unparam", "desc": "Reports unused function parameters", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "unused" ], @@ -1280,7 +1271,7 @@ "name": "unused", "desc": "Checks Go code for unused constants, variables, functions and types", "enabledByDefault": true, - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "unused" ], @@ -1296,7 +1287,7 @@ { "name": "usestdlibvars", "desc": "A linter that detect the possibility to use variables/constants from the Go standard library.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -1308,7 +1299,7 @@ { "name": "varnamelen", "desc": "checks that the length of a variable's name matches its scope", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -1320,7 +1311,7 @@ { "name": "wastedassign", "desc": "Finds wasted assignment statements", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style" ], @@ -1332,7 +1323,7 @@ { "name": "whitespace", "desc": "Whitespace is a linter that checks for unnecessary newlines at the start and end of functions, if, for, etc.", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -1345,7 +1336,7 @@ { "name": "wrapcheck", "desc": "Checks that errors returned from external packages are wrapped", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "style", "error" @@ -1358,7 +1349,7 @@ { "name": "wsl", "desc": "add or remove empty lines", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], @@ -1370,7 +1361,7 @@ { "name": "zerologlint", "desc": "Detects the wrong usage of `zerolog` that a user forgets to dispatch with `Send` or `Msg`", - "loadMode": 575, + "loadMode": 8767, "inPresets": [ "bugs" ], @@ -1382,7 +1373,7 @@ { "name": "nolintlint", "desc": "Reports ill-formed or insufficient nolint directives", - "loadMode": 7, + "loadMode": 8199, "inPresets": [ "style" ], diff --git a/docs/src/docs/product/performance.mdx b/docs/src/docs/product/performance.mdx index 28b890349b8f..4863361129ec 100644 --- a/docs/src/docs/product/performance.mdx +++ b/docs/src/docs/product/performance.mdx @@ -22,7 +22,7 @@ Less `GOGC` values trigger garbage collection more frequently and golangci-lint 1. Work sharing - During operation, `golangci-lint` shares work between specific linters (like `golint`, `govet`, etc.). + During operation, `golangci-lint` shares work between specific linters (like `govet`, `ineffassign`, etc.). We don't fork to call a specific linter, but instead use its API. For small and medium projects 50-90% of work between linters can be reused. diff --git a/go.mod b/go.mod index 165c30667aef..910f725baa5e 100644 --- a/go.mod +++ b/go.mod @@ -9,9 +9,9 @@ require ( github.com/Abirdcfly/dupword v0.1.3 github.com/Antonboom/errname v1.0.0 github.com/Antonboom/nilnil v1.0.0 - github.com/Antonboom/testifylint v1.5.0 + github.com/Antonboom/testifylint v1.5.2 github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c - github.com/Crocmagnon/fatcontext v0.5.2 + github.com/Crocmagnon/fatcontext v0.5.3 github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 github.com/OpenPeeDeeP/depguard/v2 v2.2.0 @@ -74,16 +74,16 @@ require ( github.com/maratori/testpackage v1.1.1 github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 github.com/mattn/go-colorable v0.1.13 - github.com/mgechev/revive v1.5.0 + github.com/mgechev/revive v1.5.1 github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-ps v1.0.0 github.com/moricho/tparallel v0.3.2 github.com/nakabonne/nestif v0.3.1 github.com/nishanths/exhaustive v0.12.0 github.com/nishanths/predeclared v0.2.2 - github.com/nunnatsa/ginkgolinter v0.18.0 + github.com/nunnatsa/ginkgolinter v0.18.3 github.com/pelletier/go-toml/v2 v2.2.3 - github.com/polyfloyd/go-errorlint v1.6.0 + github.com/polyfloyd/go-errorlint v1.7.0 github.com/quasilyte/go-ruleguard/dsl v0.3.22 github.com/raeperd/recvcheck v0.1.2 github.com/rogpeppe/go-internal v1.13.1 @@ -106,7 +106,7 @@ require ( github.com/spf13/viper v1.12.0 github.com/ssgreg/nlreturn/v2 v2.2.1 github.com/stbenjam/no-sprintf-host-port v0.1.1 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/tdakkota/asciicheck v0.2.0 github.com/tetafro/godot v1.4.18 github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 @@ -116,7 +116,7 @@ require ( github.com/ultraware/funlen v0.1.0 github.com/ultraware/whitespace v0.1.1 github.com/uudashr/gocognit v1.1.3 - github.com/uudashr/iface v1.2.0 + github.com/uudashr/iface v1.2.1 github.com/valyala/quicktemplate v1.8.0 github.com/xen0n/gosmopolitan v1.2.2 github.com/yagipy/maintidx v1.0.0 @@ -192,7 +192,7 @@ require ( go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/exp/typeparams v0.0.0-20240909161429-701f63a606c0 // indirect + golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f // indirect golang.org/x/mod v0.22.0 // indirect golang.org/x/sync v0.9.0 // indirect golang.org/x/text v0.18.0 // indirect diff --git a/go.sum b/go.sum index 768528d2782a..b820b947100c 100644 --- a/go.sum +++ b/go.sum @@ -43,14 +43,14 @@ github.com/Antonboom/errname v1.0.0 h1:oJOOWR07vS1kRusl6YRSlat7HFnb3mSfMl6sDMRoT github.com/Antonboom/errname v1.0.0/go.mod h1:gMOBFzK/vrTiXN9Oh+HFs+e6Ndl0eTFbtsRTSRdXyGI= github.com/Antonboom/nilnil v1.0.0 h1:n+v+B12dsE5tbAqRODXmEKfZv9j2KcTBrp+LkoM4HZk= github.com/Antonboom/nilnil v1.0.0/go.mod h1:fDJ1FSFoLN6yoG65ANb1WihItf6qt9PJVTn/s2IrcII= -github.com/Antonboom/testifylint v1.5.0 h1:dlUIsDMtCrZWUnvkaCz3quJCoIjaGi41GzjPBGkkJ8A= -github.com/Antonboom/testifylint v1.5.0/go.mod h1:wqaJbu0Blb5Wag2wv7Z5xt+CIV+eVLxtGZrlK13z3AE= +github.com/Antonboom/testifylint v1.5.2 h1:4s3Xhuv5AvdIgbd8wOOEeo0uZG7PbDKQyKY5lGoQazk= +github.com/Antonboom/testifylint v1.5.2/go.mod h1:vxy8VJ0bc6NavlYqjZfmp6EfqXMtBgQ4+mhCojwC1P8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Crocmagnon/fatcontext v0.5.2 h1:vhSEg8Gqng8awhPju2w7MKHqMlg4/NI+gSDHtR3xgwA= -github.com/Crocmagnon/fatcontext v0.5.2/go.mod h1:87XhRMaInHP44Q7Tlc7jkgKKB7kZAOPiDkFMdKCC+74= +github.com/Crocmagnon/fatcontext v0.5.3 h1:zCh/wjc9oyeF+Gmp+V60wetm8ph2tlsxocgg/J0hOps= +github.com/Crocmagnon/fatcontext v0.5.3/go.mod h1:XoCQYY1J+XTfyv74qLXvNw4xFunr3L1wkopIIKG7wGM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 h1:/fTUt5vmbkAcMBt4YQiuC23cV0kEsN1MVMNqeOW43cU= @@ -371,8 +371,8 @@ github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6T github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mgechev/revive v1.5.0 h1:oaSmjA7rP8+HyoRuCgC531VHwnLH1AlJdjj+1AnQceQ= -github.com/mgechev/revive v1.5.0/go.mod h1:L6T3H8EoerRO86c7WuGpvohIUmiploGiyoYbtIWFmV8= +github.com/mgechev/revive v1.5.1 h1:hE+QPeq0/wIzJwOphdVyUJ82njdd8Khp4fUIHGZHW3M= +github.com/mgechev/revive v1.5.1/go.mod h1:lC9AhkJIBs5zwx8wkudyHrU+IJkrEKmpCmGMnIJPk4o= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= @@ -394,8 +394,8 @@ github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhK github.com/nishanths/exhaustive v0.12.0/go.mod h1:mEZ95wPIZW+x8kC4TgC+9YCUgiST7ecevsVDTgc2obs= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nunnatsa/ginkgolinter v0.18.0 h1:ZXO1wKhPg3A6LpbN5dMuqwhfOjN5c3ous8YdKOuqk9k= -github.com/nunnatsa/ginkgolinter v0.18.0/go.mod h1:vPrWafSULmjMGCMsfGA908if95VnHQNAahvSBOjTuWs= +github.com/nunnatsa/ginkgolinter v0.18.3 h1:WgS7X3zzmni3vwHSBhvSgqrRgUecN6PQUcfB0j1noDw= +github.com/nunnatsa/ginkgolinter v0.18.3/go.mod h1:BE1xyB/PNtXXG1azrvrqJW5eFH0hSRylNzFy8QHPwzs= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= @@ -419,8 +419,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v1.6.0 h1:tftWV9DE7txiFzPpztTAwyoRLKNj9gpVm2cg8/OwcYY= -github.com/polyfloyd/go-errorlint v1.6.0/go.mod h1:HR7u8wuP1kb1NeN1zqTd1ZMlqUKPPHF+Id4vIPvDqVw= +github.com/polyfloyd/go-errorlint v1.7.0 h1:Zp6lzCK4hpBDj8y8a237YK4EPrMXQWvOe3nGoH4pFrU= +github.com/polyfloyd/go-errorlint v1.7.0/go.mod h1:dGWKu85mGHnegQ2SWpEybFityCg3j7ZbwsVUxAOk9gY= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= @@ -533,8 +533,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9qkHM= @@ -563,8 +563,8 @@ github.com/ultraware/whitespace v0.1.1 h1:bTPOGejYFulW3PkcrqkeQwOd6NKOOXvmGD9bo/ github.com/ultraware/whitespace v0.1.1/go.mod h1:XcP1RLD81eV4BW8UhQlpaR+SDc2givTvyI8a586WjW8= github.com/uudashr/gocognit v1.1.3 h1:l+a111VcDbKfynh+airAy/DJQKaXh2m9vkoysMPSZyM= github.com/uudashr/gocognit v1.1.3/go.mod h1:aKH8/e8xbTRBwjbCkwZ8qt4l2EpKXl31KMHgSS+lZ2U= -github.com/uudashr/iface v1.2.0 h1:ECJjh5q/1Zmnv/2yFpWV6H3oMg5+Mo+vL0aqw9Gjazo= -github.com/uudashr/iface v1.2.0/go.mod h1:Ux/7d/rAF3owK4m53cTVXL4YoVHKNqnoOeQHn2xrlp0= +github.com/uudashr/iface v1.2.1 h1:vHHyzAUmWZ64Olq6NZT3vg/z1Ws56kyPdBOd5kTXDF8= +github.com/uudashr/iface v1.2.1/go.mod h1:4QvspiRd3JLPAEXBQ9AiZpLbJlrWWgRChOKDJEuQTdg= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/quicktemplate v1.8.0 h1:zU0tjbIqTRgKQzFY1L42zq0qR3eh4WoQQdIdqCysW5k= @@ -631,8 +631,8 @@ golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWB golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20240909161429-701f63a606c0 h1:bVwtbF629Xlyxk6xLQq2TDYmqP0uiWaet5LwRebuY0k= -golang.org/x/exp/typeparams v0.0.0-20240909161429-701f63a606c0/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f h1:WTyX8eCCyfdqiPYkRGm0MqElSfYFH3yR1+rl/mct9sA= +golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/internal/go/cache/cache.go b/internal/go/cache/cache.go index 7bf4f1d660e5..85899ebc92af 100644 --- a/internal/go/cache/cache.go +++ b/internal/go/cache/cache.go @@ -293,7 +293,7 @@ func GetBytes(c Cache, id ActionID) ([]byte, Entry, error) { } data, err := robustio.ReadFile(c.OutputFile(entry.OutputID)) if err != nil { - return nil, entry, err + return nil, entry, &entryNotFoundError{Err: err} } if sha256.Sum256(data) != entry.OutputID { return nil, entry, &entryNotFoundError{Err: errors.New("bad checksum")} diff --git a/jsonschema/golangci.jsonschema.json b/jsonschema/golangci.jsonschema.json index 88c6eec6ef0b..4048750fedf5 100644 --- a/jsonschema/golangci.jsonschema.json +++ b/jsonschema/golangci.jsonschema.json @@ -13,18 +13,19 @@ "badLock", "badRegexp", "badSorting", + "badSyncOnceFunc", "boolExprSimplify", "builtinShadow", "builtinShadowDecl", "captLocal", "caseOrder", "codegenComment", + "commentFormatting", "commentedOutCode", "commentedOutImport", - "commentFormatting", "defaultCaseOrder", - "deferUnlambda", "deferInLoop", + "deferUnlambda", "deprecatedComment", "docStub", "dupArg", @@ -67,6 +68,7 @@ "preferStringWriter", "preferWriteByte", "ptrToRefParam", + "rangeAppendAll", "rangeExprCopy", "rangeValCopy", "redundantSprint", @@ -84,13 +86,12 @@ "sprintfQuotedString", "sqlQuery", "stringConcatSimplify", - "stringsCompare", "stringXbytes", - "suspiciousSorting", + "stringsCompare", "switchTrue", "syncMapLoadAndDelete", - "timeCmpSimplify", "timeExprSimplify", + "todoCommentWithoutDetail", "tooManyResultsChecker", "truncateCmp", "typeAssertChain", @@ -203,6 +204,7 @@ "structtag", "testinggoroutine", "tests", + "timeformat", "unmarshal", "unreachable", "unsafeptr", @@ -246,6 +248,8 @@ "errorf", "exported", "file-header", + "file-length-limit", + "filename-format", "flag-parameter", "function-length", "function-result-limit", @@ -293,6 +297,13 @@ "waitgroup-by-value" ] }, + "iface-analyzers": { + "enum": [ + "identical", + "unused", + "opaque" + ] + }, "linters": { "$comment": "anyOf with enum is used to allow auto completion of non-custom linters", "description": "Linters usable.", @@ -308,7 +319,6 @@ "contextcheck", "copyloopvar", "cyclop", - "deadcode", "decorder", "depguard", "dogsled", @@ -319,9 +329,7 @@ "errchkjson", "errname", "errorlint", - "execinquery", "exhaustive", - "exhaustivestruct", "exhaustruct", "exportloopref", "fatcontext", @@ -345,7 +353,6 @@ "gofumpt", "goheader", "goimports", - "golint", "gomoddirectives", "gomodguard", "goprintffuncname", @@ -354,19 +361,17 @@ "gosmopolitan", "govet", "grouper", - "ifshort", + "iface", "importas", "inamedparam", "ineffassign", "interfacebloat", - "interfacer", "intrange", "ireturn", "lll", "loggercheck", "maintidx", "makezero", - "maligned", "mirror", "misspell", "mnd", @@ -379,7 +384,6 @@ "noctx", "nolintlint", "nonamedreturns", - "nosnakecase", "nosprintfhostport", "paralleltest", "perfsprint", @@ -388,13 +392,12 @@ "promlinter", "protogetter", "reassign", + "recvcheck", "revive", "rowserrcheck", - "scopelint", "sloglint", "sqlclosecheck", "staticcheck", - "structcheck", "stylecheck", "tagalign", "tagliatelle", @@ -408,7 +411,6 @@ "unparam", "unused", "usestdlibvars", - "varcheck", "varnamelen", "wastedassign", "whitespace", @@ -1169,6 +1171,22 @@ "description": "Trigger a warning for variable assignments in ginkgo containers like `Describe`, `Context` and `When`, instead of in `BeforeEach()`.", "type": "boolean", "default": false + }, + "force-succeed": { + "description": "Force using the Succeed matcher for error functions, and the HaveOccurred matcher for non-function error values.", + "type": "boolean", + "default": false + } + } + }, + "gochecksumtype": { + "type": "object", + "additionalProperties": false, + "properties": { + "default-signifies-exhaustive": { + "description": "Presence of `default` case in switch statements satisfies exhaustiveness, if all members are not listed.", + "type": "boolean", + "default": true } } }, @@ -1908,6 +1926,37 @@ } } }, + "iface": { + "type": "object", + "additionalProperties": false, + "properties": { + "enable": { + "description": "Enable analyzers by name.", + "type": "array", + "items": { + "$ref": "#/definitions/iface-analyzers" + } + }, + "settings": { + "type": "object", + "additionalProperties": false, + "properties": { + "unused": { + "type": "object", + "additionalProperties": false, + "properties": { + "exclude": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, "importas": { "type": "object", "additionalProperties": false, @@ -2175,13 +2224,18 @@ "type": "object", "additionalProperties": false, "properties": { + "detect-opposite": { + "type": "boolean", + "description": "In addition, detect opposite situation (simultaneous return of non-nil error and valid value).", + "default": false + }, "checked-types": { "type": "array", "description": "List of return types to check.", "items": { - "enum": ["ptr", "func", "iface", "map", "chan", "uintptr", "unsafeptr"] + "enum": ["chan", "func", "iface", "map", "ptr", "uintptr", "unsafeptr"] }, - "default": ["ptr", "func", "iface", "map", "chan", "uintptr", "unsafeptr"] + "default": ["chan", "func", "iface", "map", "ptr", "uintptr", "unsafeptr"] } } }, @@ -2892,7 +2946,9 @@ "blank-import", "bool-compare", "compares", + "contains", "empty", + "encoded-compare", "error-is-as", "error-nil", "expected-actual", @@ -2902,6 +2958,7 @@ "len", "negative-positive", "nil-compare", + "regexp", "require-error", "suite-broken-parallel", "suite-dont-use-pkg", @@ -2915,16 +2972,19 @@ "blank-import", "bool-compare", "compares", + "contains", "empty", + "encoded-compare", "error-is-as", "error-nil", "expected-actual", "float-compare", - "float-compare", + "formatter", "go-require", "len", "negative-positive", "nil-compare", + "regexp", "require-error", "suite-broken-parallel", "suite-dont-use-pkg", @@ -2941,7 +3001,9 @@ "blank-import", "bool-compare", "compares", + "contains", "empty", + "encoded-compare", "error-is-as", "error-nil", "expected-actual", @@ -2951,6 +3013,7 @@ "len", "negative-positive", "nil-compare", + "regexp", "require-error", "suite-broken-parallel", "suite-dont-use-pkg", @@ -2996,7 +3059,7 @@ "default": true }, "require-f-funcs": { - "description": "To require f-assertions if format string is used.", + "description": "To require f-assertions (e.g. assert.Equalf) if format string is used, even if there are no variable-length variables.", "type": "boolean", "default": false } diff --git a/jsonschema/golangci.next.jsonschema.json b/jsonschema/golangci.next.jsonschema.json index 5ccb898a57a7..4048750fedf5 100644 --- a/jsonschema/golangci.next.jsonschema.json +++ b/jsonschema/golangci.next.jsonschema.json @@ -3059,7 +3059,7 @@ "default": true }, "require-f-funcs": { - "description": "To require f-assertions if format string is used.", + "description": "To require f-assertions (e.g. assert.Equalf) if format string is used, even if there are no variable-length variables.", "type": "boolean", "default": false } diff --git a/jsonschema/golangci.v1.61.jsonschema.json b/jsonschema/golangci.v1.61.jsonschema.json new file mode 100644 index 000000000000..88c6eec6ef0b --- /dev/null +++ b/jsonschema/golangci.v1.61.jsonschema.json @@ -0,0 +1,3770 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://json.schemastore.org/golangci-lint.json", + "definitions": { + "gocritic-checks": { + "enum": [ + "appendAssign", + "appendCombine", + "argOrder", + "assignOp", + "badCall", + "badCond", + "badLock", + "badRegexp", + "badSorting", + "boolExprSimplify", + "builtinShadow", + "builtinShadowDecl", + "captLocal", + "caseOrder", + "codegenComment", + "commentedOutCode", + "commentedOutImport", + "commentFormatting", + "defaultCaseOrder", + "deferUnlambda", + "deferInLoop", + "deprecatedComment", + "docStub", + "dupArg", + "dupBranchBody", + "dupCase", + "dupImport", + "dupSubExpr", + "dynamicFmtString", + "elseif", + "emptyDecl", + "emptyFallthrough", + "emptyStringTest", + "equalFold", + "evalOrder", + "exitAfterDefer", + "exposedSyncMutex", + "externalErrorReassign", + "filepathJoin", + "flagDeref", + "flagName", + "hexLiteral", + "httpNoBody", + "hugeParam", + "ifElseChain", + "importShadow", + "indexAlloc", + "initClause", + "ioutilDeprecated", + "mapKey", + "methodExprCall", + "nestingReduce", + "newDeref", + "nilValReturn", + "octalLiteral", + "offBy1", + "paramTypeCombine", + "preferDecodeRune", + "preferFilepathJoin", + "preferFprint", + "preferStringWriter", + "preferWriteByte", + "ptrToRefParam", + "rangeExprCopy", + "rangeValCopy", + "redundantSprint", + "regexpMust", + "regexpPattern", + "regexpSimplify", + "returnAfterHttpError", + "ruleguard", + "singleCaseSwitch", + "sliceClear", + "sloppyLen", + "sloppyReassign", + "sloppyTypeAssert", + "sortSlice", + "sprintfQuotedString", + "sqlQuery", + "stringConcatSimplify", + "stringsCompare", + "stringXbytes", + "suspiciousSorting", + "switchTrue", + "syncMapLoadAndDelete", + "timeCmpSimplify", + "timeExprSimplify", + "tooManyResultsChecker", + "truncateCmp", + "typeAssertChain", + "typeDefFirst", + "typeSwitchVar", + "typeUnparen", + "uncheckedInlineErr", + "underef", + "unlabelStmt", + "unlambda", + "unnamedResult", + "unnecessaryBlock", + "unnecessaryDefer", + "unslice", + "valSwap", + "weakCond", + "whyNoLint", + "wrapperFunc", + "yodaStyleExpr" + ] + }, + "gocritic-tags": { + "enum": [ + "diagnostic", + "style", + "performance", + "experimental", + "opinionated", + "security" + ] + }, + "gosec-rules": { + "enum": [ + "G101", + "G102", + "G103", + "G104", + "G106", + "G107", + "G108", + "G109", + "G110", + "G111", + "G112", + "G113", + "G114", + "G115", + "G201", + "G202", + "G203", + "G204", + "G301", + "G302", + "G303", + "G304", + "G305", + "G306", + "G307", + "G401", + "G402", + "G403", + "G404", + "G405", + "G406", + "G501", + "G502", + "G503", + "G504", + "G505", + "G506", + "G507", + "G601", + "G602" + ] + }, + "govet-analyzers": { + "enum": [ + "appends", + "asmdecl", + "assign", + "atomic", + "atomicalign", + "bools", + "buildtag", + "cgocall", + "composites", + "copylocks", + "deepequalerrors", + "defers", + "directive", + "errorsas", + "fieldalignment", + "findcall", + "framepointer", + "httpresponse", + "ifaceassert", + "loopclosure", + "lostcancel", + "nilfunc", + "nilness", + "printf", + "reflectvaluecompare", + "shadow", + "shift", + "sigchanyzer", + "slog", + "sortslice", + "stdmethods", + "stringintconv", + "structtag", + "testinggoroutine", + "tests", + "unmarshal", + "unreachable", + "unsafeptr", + "unusedresult", + "unusedwrite" + ] + }, + "revive-rules": { + "enum": [ + "add-constant", + "argument-limit", + "atomic", + "banned-characters", + "bare-return", + "blank-imports", + "bool-literal-in-expr", + "call-to-gc", + "cognitive-complexity", + "comment-spacings", + "comments-density", + "confusing-naming", + "confusing-results", + "constant-logical-expr", + "context-as-argument", + "context-keys-type", + "cyclomatic", + "datarace", + "deep-exit", + "defer", + "dot-imports", + "duplicated-imports", + "early-return", + "empty-block", + "empty-lines", + "enforce-map-style", + "enforce-repeated-arg-type-style", + "enforce-slice-style", + "error-naming", + "error-return", + "error-strings", + "errorf", + "exported", + "file-header", + "flag-parameter", + "function-length", + "function-result-limit", + "get-return", + "identical-branches", + "if-return", + "import-alias-naming", + "import-shadowing", + "imports-blocklist", + "increment-decrement", + "indent-error-flow", + "line-length-limit", + "max-control-nesting", + "max-public-structs", + "modifies-parameter", + "modifies-value-receiver", + "nested-structs", + "optimize-operands-order", + "package-comments", + "range", + "range-val-address", + "range-val-in-closure", + "receiver-naming", + "redefines-builtin-id", + "redundant-import-alias", + "string-format", + "string-of-int", + "struct-tag", + "superfluous-else", + "time-equal", + "time-naming", + "unchecked-type-assertion", + "unconditional-recursion", + "unexported-naming", + "unexported-return", + "unhandled-error", + "unnecessary-stmt", + "unreachable-code", + "unused-parameter", + "unused-receiver", + "use-any", + "useless-break", + "var-declaration", + "var-naming", + "waitgroup-by-value" + ] + }, + "linters": { + "$comment": "anyOf with enum is used to allow auto completion of non-custom linters", + "description": "Linters usable.", + "anyOf": [ + { + "enum": [ + "asasalint", + "asciicheck", + "bidichk", + "bodyclose", + "canonicalheader", + "containedctx", + "contextcheck", + "copyloopvar", + "cyclop", + "deadcode", + "decorder", + "depguard", + "dogsled", + "dupl", + "dupword", + "durationcheck", + "errcheck", + "errchkjson", + "errname", + "errorlint", + "execinquery", + "exhaustive", + "exhaustivestruct", + "exhaustruct", + "exportloopref", + "fatcontext", + "forbidigo", + "forcetypeassert", + "funlen", + "gci", + "ginkgolinter", + "gocheckcompilerdirectives", + "gochecknoglobals", + "gochecknoinits", + "gochecksumtype", + "gocognit", + "goconst", + "gocritic", + "gocyclo", + "godot", + "godox", + "err113", + "gofmt", + "gofumpt", + "goheader", + "goimports", + "golint", + "gomoddirectives", + "gomodguard", + "goprintffuncname", + "gosec", + "gosimple", + "gosmopolitan", + "govet", + "grouper", + "ifshort", + "importas", + "inamedparam", + "ineffassign", + "interfacebloat", + "interfacer", + "intrange", + "ireturn", + "lll", + "loggercheck", + "maintidx", + "makezero", + "maligned", + "mirror", + "misspell", + "mnd", + "musttag", + "nakedret", + "nestif", + "nilerr", + "nilnil", + "nlreturn", + "noctx", + "nolintlint", + "nonamedreturns", + "nosnakecase", + "nosprintfhostport", + "paralleltest", + "perfsprint", + "prealloc", + "predeclared", + "promlinter", + "protogetter", + "reassign", + "revive", + "rowserrcheck", + "scopelint", + "sloglint", + "sqlclosecheck", + "staticcheck", + "structcheck", + "stylecheck", + "tagalign", + "tagliatelle", + "tenv", + "testableexamples", + "testifylint", + "testpackage", + "thelper", + "tparallel", + "unconvert", + "unparam", + "unused", + "usestdlibvars", + "varcheck", + "varnamelen", + "wastedassign", + "whitespace", + "wrapcheck", + "wsl", + "zerologlint" + ] + }, + { + "type": "string" + } + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "run": { + "description": "Options for analysis running,", + "type": "object", + "additionalProperties": false, + "properties": { + "concurrency": { + "description": "Number of concurrent runners. Defaults to the number of available CPU cores.", + "type": "integer", + "minimum": 0, + "examples": [4] + }, + "timeout": { + "description": "Timeout for the analysis.", + "type": "string", + "pattern": "^\\d*[sm]$", + "default": "1m", + "examples": ["30s", "5m"] + }, + "issues-exit-code": { + "description": "Exit code when at least one issue was found.", + "type": "integer", + "default": 1 + }, + "tests": { + "description": "Enable inclusion of test files.", + "type": "boolean", + "default": true + }, + "build-tags": { + "description": "List of build tags to pass to all linters.", + "type": "array", + "items": { + "type": "string" + }, + "default": [], + "examples": [["mytag"]] + }, + "modules-download-mode": { + "description": "Option to pass to \"go list -mod={option}\".\nSee \"go help modules\" for more information.", + "enum": ["mod", "readonly", "vendor"] + }, + "allow-parallel-runners": { + "description": "Allow multiple parallel golangci-lint instances running. If disabled, golangci-lint acquires file lock on start.", + "type": "boolean", + "default": false + }, + "allow-serial-runners": { + "description": "Allow multiple golangci-lint instances running, but serialize them around a lock.", + "type": "boolean", + "default": false + }, + "go": { + "description": "Targeted Go version.", + "type": "string", + "default": "1.17" + } + } + }, + "output": { + "description": "Output configuration options.", + "type": "object", + "additionalProperties": false, + "properties": { + "formats": { + "description": "Output formats to use.", + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "path": { + "default": "stdout", + "anyOf": [ + { + "enum": [ "stdout", "stderr" ] + }, + { + "type": "string" + } + ] + }, + "format": { + "default": "colored-line-number", + "enum": [ + "colored-line-number", + "line-number", + "json", + "colored-tab", + "tab", + "html", + "checkstyle", + "code-climate", + "junit-xml", + "junit-xml-extended", + "github-actions", + "teamcity", + "sarif" + ] + } + }, + "required": ["format"] + } + }, + "print-issued-lines": { + "description": "Print lines of code with issue.", + "type": "boolean", + "default": true + }, + "print-linter-name": { + "description": "Print linter name in the end of issue text.", + "type": "boolean", + "default": true + }, + "uniq-by-line": { + "description": "Make issues output unique by line.", + "type": "boolean", + "default": true + }, + "path-prefix": { + "description": "Add a prefix to the output file references.", + "type": "string", + "default": "" + }, + "show-stats": { + "description": "Show statistics per linter.", + "type": "boolean", + "default": false + }, + "sort-order": { + "type": "array", + "items": { + "enum": ["linter", "severity", "file"] + } + }, + "sort-results": { + "description": "Sort results by: filepath, line and column.", + "type": "boolean", + "default": true + } + } + }, + "linters-settings": { + "description": "All available settings of specific linters.", + "type": "object", + "additionalProperties": false, + "properties": { + "dupword": { + "type": "object", + "additionalProperties": false, + "properties": { + "keywords": { + "description": "Keywords for detecting duplicate words. If this list is not empty, only the words defined in this list will be detected.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "examples": ["the", "and", "a"] + } + }, + "ignore": { + "description": "Keywords used to ignore detection.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "examples": ["0C0C"] + } + } + } + }, + "asasalint": { + "type": "object", + "additionalProperties": false, + "properties": { + "exclude": { + "description": "To specify a set of function names to exclude.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "examples": ["\\.Wrapf"] + } + }, + "use-builtin-exclusions": { + "description": "To enable/disable the asasalint builtin exclusions of function names.", + "type": "boolean", + "default": true + }, + "ignore-test": { + "description": "Ignore *_test.go files.", + "type": "boolean", + "default": false + } + } + }, + "bidichk": { + "type": "object", + "additionalProperties": false, + "properties": { + "left-to-right-embedding": { + "description": "Disallow: LEFT-TO-RIGHT-EMBEDDING", + "type": "boolean", + "default": false + }, + "right-to-left-embedding": { + "description": "Disallow: RIGHT-TO-LEFT-EMBEDDING", + "type": "boolean", + "default": false + }, + "pop-directional-formatting": { + "description": "Disallow: POP-DIRECTIONAL-FORMATTING", + "type": "boolean", + "default": false + }, + "left-to-right-override": { + "description": "Disallow: LEFT-TO-RIGHT-OVERRIDE", + "type": "boolean", + "default": false + }, + "right-to-left-override": { + "description": "Disallow: RIGHT-TO-LEFT-OVERRIDE", + "type": "boolean", + "default": false + }, + "left-to-right-isolate": { + "description": "Disallow: LEFT-TO-RIGHT-ISOLATE", + "type": "boolean", + "default": false + }, + "right-to-left-isolate": { + "description": "Disallow: RIGHT-TO-LEFT-ISOLATE", + "type": "boolean", + "default": false + }, + "first-strong-isolate": { + "description": "Disallow: FIRST-STRONG-ISOLATE", + "type": "boolean", + "default": false + }, + "pop-directional-isolate": { + "description": "Disallow: POP-DIRECTIONAL-ISOLATE", + "type": "boolean", + "default": false + } + } + }, + "cyclop": { + "type": "object", + "additionalProperties": false, + "properties": { + "skip-tests": { + "description": "Should the linter execute on test files as well", + "type": "boolean", + "default": false + }, + "max-complexity": { + "description": "Max complexity the function can have", + "type": "integer", + "default": 10, + "minimum": 0 + }, + "package-average": { + "description": "Max average complexity in package", + "type": "number", + "default": 0, + "minimum": 0 + } + } + }, + "decorder": { + "type": "object", + "additionalProperties": false, + "properties": { + "dec-order": { + "type": "array", + "default": [["type", "const", "var", "func"]], + "items": { + "enum": ["type", "const", "var", "func"] + } + }, + "ignore-underscore-vars": { + "description": "Underscore vars (vars with \"_\" as the name) will be ignored at all checks", + "default": true, + "type": "boolean" + }, + "disable-dec-order-check": { + "description": "Order of declarations is not checked", + "default": true, + "type": "boolean" + }, + "disable-init-func-first-check": { + "description": "Allow init func to be anywhere in file", + "default": true, + "type": "boolean" + }, + "disable-dec-num-check": { + "description": "Multiple global type, const and var declarations are allowed", + "default": true, + "type": "boolean" + }, + "disable-type-dec-num-check": { + "description": "Type declarations will be ignored for dec num check", + "default": true, + "type": "boolean" + }, + "disable-const-dec-num-check": { + "description": "Const declarations will be ignored for dec num check", + "default": true, + "type": "boolean" + }, + "disable-var-dec-num-check": { + "description": "Var declarations will be ignored for dec num check", + "default": true, + "type": "boolean" + } + } + }, + "depguard": { + "type": "object", + "additionalProperties": false, + "properties": { + "rules": { + "description": "Rules to apply.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^[^.]+$": { + "description": "Name of a rule.", + "type": "object", + "additionalProperties": false, + "properties": { + "list-mode": { + "description": "Used to determine the package matching priority.", + "enum": ["original", "strict", "lax"], + "default": "original" + }, + "files": { + "description": "List of file globs that will match this list of settings to compare against.", + "additionalProperties": false, + "type": "array", + "items": { + "type": "string" + } + }, + "allow": { + "description": "List of allowed packages.", + "additionalProperties": false, + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Packages that are not allowed where the value is a suggestion.", + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "desc": { + "description": "Description", + "type": "string" + }, + "pkg": { + "description": "Package", + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "dogsled": { + "type": "object", + "additionalProperties": false, + "properties": { + "max-blank-identifiers": { + "description": "Check assignments with too many blank identifiers.", + "type": "integer", + "default": 2, + "minimum": 0 + } + } + }, + "dupl": { + "type": "object", + "additionalProperties": false, + "properties": { + "threshold": { + "description": "Tokens count to trigger issue.", + "type": "integer", + "default": 150, + "minimum": 0 + } + } + }, + "errcheck": { + "type": "object", + "additionalProperties": false, + "properties": { + "check-type-assertions": { + "description": "Report about not checking errors in type assertions, i.e.: `a := b.(MyStruct)`", + "type": "boolean", + "default": false + }, + "check-blank": { + "description": "Report about assignment of errors to blank identifier", + "type": "boolean", + "default": false + }, + "exclude-functions": { + "description": "List of functions to exclude from checking, where each entry is a single function to exclude", + "type": "array", + "examples": ["io/ioutil.ReadFile", "io.Copy(*bytes.Buffer)"], + "items": { + "type": "string" + } + }, + "disable-default-exclusions": { + "description": "To disable the errcheck built-in exclude list", + "type": "boolean", + "default": false + } + } + }, + "errchkjson": { + "type": "object", + "additionalProperties": false, + "properties": { + "check-error-free-encoding": { + "type": "boolean", + "default": false + }, + "report-no-exported": { + "description": "Issue on struct that doesn't have exported fields.", + "type": "boolean", + "default": false + } + } + }, + "errorlint": { + "type": "object", + "additionalProperties": false, + "properties": { + "errorf": { + "description": "Check whether fmt.Errorf uses the %w verb for formatting errors", + "type": "boolean", + "default": true + }, + "errorf-multi": { + "description": "Permit more than 1 %w verb, valid per Go 1.20", + "type": "boolean", + "default": true + }, + "asserts": { + "description": "Check for plain type assertions and type switches.", + "type": "boolean", + "default": true + }, + "comparison": { + "description": "Check for plain error comparisons", + "type": "boolean", + "default": true + }, + "allowed-errors": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "err": { + "type": "string" + }, + "fun": { + "type": "string" + } + } + } + }, + "allowed-errors-wildcard": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "err": { + "type": "string" + }, + "fun": { + "type": "string" + } + } + } + } + } + }, + "exhaustive": { + "type": "object", + "additionalProperties": false, + "properties": { + "check": { + "description": "Program elements to check for exhaustiveness.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "examples": ["switch", "map"] + } + }, + "check-generated": { + "description": "Check switch statements in generated files", + "type": "boolean", + "default": false + }, + "explicit-exhaustive-switch": { + "description": "Only run exhaustive check on switches with \"//exhaustive:enforce\" comment.", + "type": "boolean", + "default": false + }, + "explicit-exhaustive-map": { + "description": "Only run exhaustive check on map literals with \"//exhaustive:enforce\" comment.", + "type": "boolean", + "default": false + }, + "default-case-required": { + "description": "Switch statement requires default case even if exhaustive.", + "type": "boolean", + "default": false + }, + "default-signifies-exhaustive": { + "description": "Presence of `default` case in switch statements satisfies exhaustiveness, even if all enum members are not listed.", + "type": "boolean", + "default": false + }, + "ignore-enum-members": { + "description": "Enum members matching `regex` do not have to be listed in switch statements to satisfy exhaustiveness", + "type": "string" + }, + "ignore-enum-types": { + "description": "Enum types matching the supplied regex do not have to be listed in switch statements to satisfy exhaustiveness.", + "type": "string" + }, + "package-scope-only": { + "description": "Consider enums only in package scopes, not in inner scopes.", + "type": "boolean", + "default": false + } + } + }, + "exhaustruct": { + "type": "object", + "additionalProperties": false, + "properties": { + "include": { + "description": "List of regular expressions to match struct packages and names.", + "type": "array", + "examples": [".*\\.Test"], + "items": { + "type": "string" + } + }, + "exclude": { + "description": "List of regular expressions to exclude struct packages and names from check.", + "type": "array", + "examples": ["cobra\\.Command$"], + "items": { + "type": "string" + } + } + } + }, + "forbidigo": { + "type": "object", + "additionalProperties": false, + "properties": { + "exclude-godoc-examples": { + "description": "Exclude code in godoc examples.", + "type": "boolean", + "default": true + }, + "analyze-types": { + "description": "Instead of matching the literal source code, use type information to replace expressions with strings that contain the package name and (for methods and fields) the type name.", + "type": "boolean", + "default": true + }, + "forbid": { + "description": "List of identifiers to forbid (written using `regexp`)", + "type": "array", + "examples": ["^print(ln)?$"], + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "p": { + "description": "Pattern", + "type": "string" + }, + "pkg": { + "description": "Package", + "type": "string" + }, + "msg": { + "description": "Message", + "type": "string" + } + } + } + ] + } + } + } + }, + "funlen": { + "type": "object", + "additionalProperties": false, + "properties": { + "lines": { + "description": "Limit lines number per function.", + "type": "integer", + "default": 60 + }, + "statements": { + "description": "Limit statements number per function.", + "type": "integer", + "default": 40 + }, + "ignore-comments": { + "description": "Ignore comments when counting lines.", + "type": "boolean", + "default": false + } + } + }, + "gci": { + "type": "object", + "additionalProperties": false, + "properties": { + "sections": { + "description": "Section configuration to compare against.", + "type": "array", + "items": { + "anyOf": [ + { + "enum": [ + "standard", + "default", + "blank", + "dot", + "alias", + "localmodule" + ] + }, + { + "type": "string" + } + ] + }, + "default": ["standard", "default"] + }, + "skip-generated": { + "description": "Skip generated files.", + "type": "boolean", + "default": true + }, + "custom-order": { + "description": "Enable custom order of sections.", + "type": "boolean", + "default": false + }, + "no-lex-order": { + "description": "Drops lexical ordering for custom sections.", + "type": "boolean", + "default": false + } + } + }, + "ginkgolinter": { + "type": "object", + "additionalProperties": false, + "properties": { + "suppress-len-assertion": { + "description": "Suppress the wrong length assertion warning.", + "type": "boolean", + "default": false + }, + "suppress-nil-assertion": { + "description": "Suppress the wrong nil assertion warning.", + "type": "boolean", + "default": false + }, + "suppress-err-assertion": { + "description": "Suppress the wrong error assertion warning.", + "type": "boolean", + "default": false + }, + "suppress-compare-assertion": { + "description": "Suppress the wrong comparison assertion warning.", + "type": "boolean", + "default": false + }, + "suppress-async-assertion": { + "description": "Suppress the function all in async assertion warning.", + "type": "boolean", + "default": false + }, + "suppress-type-compare-assertion": { + "description": "Suppress warning for comparing values from different types, like int32 and uint32.", + "type": "boolean", + "default": false + }, + "forbid-focus-container": { + "description": "Trigger warning for ginkgo focus containers like FDescribe, FContext, FWhen or FIt.", + "type": "boolean", + "default": false + }, + "allow-havelen-zero": { + "description": "Don't trigger warnings for HaveLen(0).", + "type": "boolean", + "default": false + }, + "force-expect-to": { + "description": "Force using `Expect` with `To`, `ToNot` or `NotTo`", + "type": "boolean", + "default": false + }, + "validate-async-intervals": { + "description": "Best effort validation of async intervals (timeout and polling).", + "type": "boolean", + "default": false + }, + "forbid-spec-pollution": { + "description": "Trigger a warning for variable assignments in ginkgo containers like `Describe`, `Context` and `When`, instead of in `BeforeEach()`.", + "type": "boolean", + "default": false + } + } + }, + "gocognit": { + "type": "object", + "additionalProperties": false, + "properties": { + "min-complexity": { + "description": "Minimal code complexity to report (we recommend 10-20).", + "type": "integer", + "default": 30 + } + } + }, + "goconst": { + "type": "object", + "additionalProperties": false, + "properties": { + "match-constant": { + "description": "Look for existing constants matching the values", + "type": "boolean", + "default": true + }, + "min-len": { + "description": "Minimum length of string constant.", + "type": "integer", + "default": 3 + }, + "min-occurrences": { + "description": "Minimum occurrences count to trigger.", + "type": "integer", + "default": 3 + }, + "ignore-tests": { + "description": "Ignore test files.", + "type": "boolean", + "default": false + }, + "ignore-calls": { + "description": "Ignore when constant is not used as function argument", + "type": "boolean", + "default": true + }, + "ignore-strings": { + "description": "Exclude strings matching the given regular expression", + "type": "string" + }, + "numbers": { + "description": "Search also for duplicated numbers.", + "type": "boolean", + "default": false + }, + "min": { + "description": "Minimum value, only works with `numbers`", + "type": "integer", + "default": 3 + }, + "max": { + "description": "Maximum value, only works with `numbers`", + "type": "integer", + "default": 3 + } + } + }, + "gocritic": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled-checks": { + "description": "Which checks should be enabled. By default, a list of stable checks is used. To see it, run `GL_DEBUG=gocritic golangci-lint run`.", + "type": "array", + "items": { + "$ref": "#/definitions/gocritic-checks" + } + }, + "disabled-checks": { + "description": "Which checks should be disabled.", + "type": "array", + "items": { + "$ref": "#/definitions/gocritic-checks" + }, + "default": [] + }, + "enabled-tags": { + "description": "Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.", + "type": "array", + "items": { + "$ref": "#/definitions/gocritic-tags" + } + }, + "disabled-tags": { + "description": "Disable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.", + "type": "array", + "items": { + "$ref": "#/definitions/gocritic-tags" + } + }, + "settings": { + "description": "Settings passed to gocritic. Properties must be valid and enabled check names.", + "type": "object", + "additionalProperties": false, + "properties": { + "captLocal": { + "type": "object", + "additionalProperties": false, + "properties": { + "paramsOnly" : { + "type": "boolean", + "default": true + } + } + }, + "commentedOutCode": { + "type": "object", + "additionalProperties": false, + "properties": { + "minLength" : { + "type": "number", + "default": 15 + } + } + }, + "elseif": { + "type": "object", + "additionalProperties": false, + "properties": { + "skipBalanced" : { + "type": "boolean", + "default": true + } + } + }, + "hugeParam": { + "type": "object", + "additionalProperties": false, + "properties": { + "sizeThreshold" : { + "type": "number", + "default": 80 + } + } + }, + "ifElseChain": { + "type": "object", + "additionalProperties": false, + "properties": { + "minThreshold" : { + "type": "number", + "default": 2 + } + } + }, + "nestingReduce": { + "type": "object", + "additionalProperties": false, + "properties": { + "bodyWidth" : { + "type": "number", + "default": 5 + } + } + }, + "rangeExprCopy": { + "type": "object", + "additionalProperties": false, + "properties": { + "sizeThreshold" : { + "type": "number", + "default": 512 + }, + "skipTestFuncs" : { + "type": "boolean", + "default": true + } + } + }, + "rangeValCopy": { + "type": "object", + "additionalProperties": false, + "properties": { + "sizeThreshold" : { + "type": "number", + "default": 128 + }, + "skipTestFuncs" : { + "type": "boolean", + "default": true + } + } + }, + "ruleguard": { + "type": "object", + "additionalProperties": false, + "properties": { + "debug" : { + "type": "string" + }, + "enable" : { + "type": "string" + }, + "disable" : { + "type": "string" + }, + "failOn" : { + "type": "string" + }, + "rules" : { + "type": "string" + } + } + }, + "tooManyResultsChecker": { + "type": "object", + "additionalProperties": false, + "properties": { + "maxResults" : { + "type": "number", + "default": 5 + } + } + }, + "truncateCmp": { + "type": "object", + "additionalProperties": false, + "properties": { + "skipArchDependent" : { + "type": "boolean", + "default": true + } + } + }, + "underef": { + "type": "object", + "additionalProperties": false, + "properties": { + "skipRecvDeref" : { + "type": "boolean", + "default": true + } + } + }, + "unnamedResult": { + "type": "object", + "additionalProperties": false, + "properties": { + "checkExported" : { + "type": "boolean", + "default": false + } + } + } + } + }, + "disable-all": { + "type": "boolean", + "default": false + }, + "enable-all": { + "type": "boolean", + "default": false + } + } + }, + "gocyclo": { + "type": "object", + "additionalProperties": false, + "properties": { + "min-complexity": { + "description": "Minimum code complexity to report (we recommend 10-20).", + "type": "integer", + "default": 30 + } + } + }, + "godot": { + "type": "object", + "additionalProperties": false, + "properties": { + "scope": { + "description": "Comments to be checked.", + "enum": ["declarations", "toplevel", "all"], + "default": "declarations" + }, + "exclude": { + "description": "List of regexps for excluding particular comment lines from check.", + "type": "array", + "items": { + "type": "string" + } + }, + "period": { + "description": "Check that each sentence ends with a period.", + "type": "boolean", + "default": true + }, + "capital": { + "description": "Check that each sentence starts with a capital letter.", + "type": "boolean", + "default": false + }, + "check-all": { + "description": "DEPRECATED: Check all top-level comments, not only declarations.", + "type": "boolean", + "default": false + } + } + }, + "godox": { + "type": "object", + "additionalProperties": false, + "properties": { + "keywords": { + "description": "Report any comments starting with one of these keywords. This is useful for TODO or FIXME comments that might be left in the code accidentally and should be resolved before merging.", + "type": "array", + "items": { + "type": "string" + }, + "default": ["TODO", "BUG", "FIXME"] + } + } + }, + "gofmt": { + "type": "object", + "additionalProperties": false, + "properties": { + "simplify": { + "description": "Simplify code.", + "type": "boolean", + "default": true + }, + "rewrite-rules": { + "description": "Apply the rewrite rules to the source before reformatting.", + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "pattern": { + "type": "string" + }, + "replacement": { + "type": "string" + } + } + } + } + } + }, + "interfacebloat": { + "type": "object", + "additionalProperties": false, + "properties": { + "max": { + "description": "The maximum number of methods allowed for an interface.", + "type": "integer" + } + } + }, + "gofumpt": { + "type": "object", + "additionalProperties": false, + "properties": { + "extra-rules": { + "description": "Choose whether or not to use the extra rules that are disabled by default.", + "type": "boolean", + "default": false + }, + "module-path": { + "description": " Module path which contains the source code being formatted.", + "type": "string" + } + } + }, + "goheader": { + "type": "object", + "additionalProperties": false, + "properties": { + "values": { + "type": "object", + "additionalProperties": false, + "properties": { + "const": { + "description": "Constants to use in the template.", + "type": "object", + "patternProperties": { + "^.+$": { + "description": "Value for the constant.", + "type": "string" + } + }, + "additionalProperties": false, + "examples": [ + { + "YEAR": "2030", + "COMPANY": "MY FUTURISTIC COMPANY" + } + ] + }, + "regexp": { + "description": "Regular expressions to use in your template.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^.+$": { + "type": "string" + } + }, + "examples": [ + { + "AUTHOR": ".*@mycompany\\.com" + } + ] + } + } + }, + "template": { + "description": "Template to put on top of every file.", + "type": "string", + "examples": [ + "{{ MY COMPANY }}\nSPDX-License-Identifier: Apache-2.0\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at:\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License." + ] + }, + "template-path": { + "description": "Path to the file containing the template source.", + "type": "string", + "examples": ["my_header_template.txt"] + } + }, + "oneOf": [ + { "required": ["template"] }, + { "required": ["template-path"] } + ] + }, + "goimports": { + "type": "object", + "additionalProperties": false, + "properties": { + "local-prefixes": { + "description": "Put imports beginning with prefix after 3rd-party packages. It is a comma-separated list of prefixes.", + "type": "string", + "examples": ["github.com/org/project"] + } + } + }, + "gomoddirectives": { + "type": "object", + "additionalProperties": false, + "properties": { + "replace-local": { + "description": "Allow local `replace` directives.", + "type": "boolean", + "default": true + }, + "replace-allow-list": { + "description": "List of allowed `replace` directives.", + "type": "array", + "items": { + "type": "string" + } + }, + "retract-allow-no-explanation": { + "description": "Allow to not explain why the version has been retracted in the `retract` directives.", + "type": "boolean", + "default": true + }, + "exclude-forbidden": { + "description": "Forbid the use of the `exclude` directives.", + "type": "boolean", + "default": true + } + } + }, + "gomodguard": { + "type": "object", + "additionalProperties": false, + "properties": { + "allowed": { + "type": "object", + "additionalProperties": false, + "properties": { + "modules": { + "description": "List of allowed modules.", + "type": "array", + "items": { + "type": "string", + "examples": ["gopkg.in/yaml.v2"] + } + }, + "domains": { + "description": "List of allowed module domains.", + "type": "array", + "items": { + "type": "string", + "examples": ["golang.org"] + } + } + } + }, + "blocked": { + "type": "object", + "additionalProperties": false, + "properties": { + "modules": { + "description": "List of blocked modules.", + "type": "array", + "items": { + "type": "object", + "patternProperties": { + "^.+$": { + "type": "object", + "additionalProperties": false, + "properties": { + "recommendations": { + "description": "Recommended modules that should be used instead.", + "type": "array", + "items": { + "type": "string" + } + }, + "reason": { + "description": "Reason why the recommended module should be used.", + "type": "string" + } + } + } + }, + "additionalProperties": false + } + }, + "versions": { + "description": "List of blocked module version constraints.", + "type": "array", + "items": { + "type": "object", + "patternProperties": { + "^.*$": { + "type": "object", + "additionalProperties": false, + "properties": { + "version": { + "description": "Version constraint.", + "type": "string" + }, + "reason": { + "description": "Reason why the version constraint exists.", + "type": "string" + } + }, + "required": ["reason"] + } + } + } + }, + "local_replace_directives": { + "description": "Raise lint issues if loading local path with replace directive", + "type": "boolean", + "default": true + } + } + } + } + }, + "gosimple": { + "type": "object", + "additionalProperties": false, + "properties": { + "checks": { + "type": "array", + "items": { + "anyOf": [ + { + "enum": ["all"] + }, + { + "type": "string" + } + ] + } + } + } + }, + "gosec": { + "type": "object", + "additionalProperties": false, + "properties": { + "includes": { + "type": "array", + "description": "To select a subset of rules to run", + "examples": [["G401"]], + "items": { + "$ref": "#/definitions/gosec-rules" + } + }, + "excludes": { + "type": "array", + "description": "To specify a set of rules to explicitly exclude", + "examples": [["G401"]], + "items": { + "$ref": "#/definitions/gosec-rules" + } + }, + "exclude-generated": { + "description": "Exclude generated files", + "type": "boolean", + "default": false + }, + "severity": { + "description": "Filter out the issues with a lower severity than the given value", + "type": "string", + "enum": ["low", "medium", "high"], + "default": "low" + }, + "confidence": { + "description": "Filter out the issues with a lower confidence than the given value", + "type": "string", + "enum": ["low", "medium", "high"], + "default": "low" + }, + "config": { + "description": "To specify the configuration of rules", + "type": "object" + }, + "concurrency": { + "description": "Concurrency value", + "type": "integer" + } + } + }, + "gosmopolitan": { + "type": "object", + "additionalProperties": false, + "properties": { + "allow-time-local": { + "description": "Allow and ignore `time.Local` usages.", + "type": "boolean", + "default": false + }, + "escape-hatches": { + "description": "List of fully qualified names in the `full/pkg/path.name` form, to act as \"i18n escape hatches\".", + "type": "array", + "items": { + "type": "string" + } + }, + "ignore-tests": { + "description": "Ignore test files.", + "type": "boolean", + "default": false + }, + "watch-for-scripts": { + "description": "List of Unicode scripts to watch for any usage in string literals.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "govet": { + "type": "object", + "additionalProperties": false, + "properties": { + "settings": { + "description": "Settings per analyzer. Map of analyzer name to specific settings.\nRun `go tool vet help` to find out more.", + "type": "object", + "propertyNames": { + "$ref": "#/definitions/govet-analyzers" + }, + "patternProperties": { + "^.*$": { + "description": "Run `go tool vet help ` to see all settings.", + "type": "object" + } + } + }, + "enable": { + "description": "Enable analyzers by name.", + "type": "array", + "items": { + "$ref": "#/definitions/govet-analyzers" + } + }, + "disable": { + "description": "Disable analyzers by name.", + "type": "array", + "items": { + "$ref": "#/definitions/govet-analyzers" + } + }, + "enable-all": { + "description": "Enable all analyzers.", + "type": "boolean", + "default": false + }, + "disable-all": { + "description": "Disable all analyzers.", + "type": "boolean", + "default": false + } + } + }, + "grouper": { + "type": "object", + "additionalProperties": false, + "properties": { + "const-require-single-const": { + "type": "boolean", + "default": false + }, + "const-require-grouping": { + "type": "boolean", + "default": false + }, + "import-require-single-import": { + "type": "boolean", + "default": false + }, + "import-require-grouping": { + "type": "boolean", + "default": false + }, + "type-require-single-type": { + "type": "boolean", + "default": false + }, + "type-require-grouping": { + "type": "boolean", + "default": false + }, + "var-require-single-var": { + "type": "boolean", + "default": false + }, + "var-require-grouping": { + "type": "boolean", + "default": false + } + } + }, + "importas": { + "type": "object", + "additionalProperties": false, + "properties": { + "no-unaliased": { + "description": "Do not allow unaliased imports of aliased packages.", + "type": "boolean", + "default": false + }, + "no-extra-aliases": { + "description": "Do not allow non-required aliases.", + "type": "boolean", + "default": false + }, + "alias": { + "description": "List of aliases", + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "pkg": { + "description": "Package path e.g. knative.dev/serving/pkg/apis/autoscaling/v1alpha1", + "type": "string" + }, + "alias": { + "description": "Package alias e.g. autoscalingv1alpha1", + "type": "string" + } + }, + "required": ["pkg", "alias"] + } + } + } + }, + "inamedparam": { + "type": "object", + "additionalProperties": false, + "properties": { + "skip-single-param": { + "description": "Skips check for interface methods with only a single parameter.", + "type": "boolean", + "default": false + } + } + }, + "ireturn": { + "type": "object", + "additionalProperties": false, + "description": "Use either `reject` or `allow` properties for interfaces matching.", + "properties": { + "allow": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "enum": ["anon", "error", "empty", "stdlib"] + } + ] + } + }, + "reject": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "enum": ["anon", "error", "empty", "stdlib"] + } + ] + } + } + }, + "anyOf": [ + { + "not": { + "properties": { + "allow": { + "const": "reject" + } + } + }, + "required": ["allow"] + }, + { + "required": ["reject"] + } + ] + }, + "lll": { + "type": "object", + "additionalProperties": false, + "properties": { + "tab-width": { + "description": "Width of \"\\t\" in spaces.", + "type": "integer", + "minimum": 0, + "default": 1 + }, + "line-length": { + "description": "Maximum allowed line length, lines longer will be reported.", + "type": "integer", + "minimum": 1, + "default": 120 + } + } + }, + "maintidx": { + "description": "Maintainability index https://docs.microsoft.com/en-us/visualstudio/code-quality/code-metrics-maintainability-index-range-and-meaning?view=vs-2022", + "type": "object", + "additionalProperties": false, + "properties": { + "under": { + "description": "Minimum accatpable maintainability index level (see https://docs.microsoft.com/en-us/visualstudio/code-quality/code-metrics-maintainability-index-range-and-meaning?view=vs-2022)", + "type": "number", + "default": 20 + } + } + }, + "makezero": { + "type": "object", + "additionalProperties": false, + "properties": { + "always": { + "description": "Allow only slices initialized with a length of zero.", + "type": "boolean", + "default": false + } + } + }, + "loggercheck": { + "type": "object", + "additionalProperties": false, + "properties": { + "kitlog": { + "description": "Allow check for the github.com/go-kit/log library.", + "type": "boolean", + "default": true + }, + "klog": { + "description": "Allow check for the k8s.io/klog/v2 library.", + "type": "boolean", + "default": true + }, + "logr": { + "description": "Allow check for the github.com/go-logr/logr library.", + "type": "boolean", + "default": true + }, + "zap": { + "description": "Allow check for the \"sugar logger\" from go.uber.org/zap library.", + "type": "boolean", + "default": true + }, + "require-string-key": { + "description": "Require all logging keys to be inlined constant strings.", + "type": "boolean", + "default": false + }, + "no-printf-like": { + "description": "Require printf-like format specifier (%s, %d for example) not present.", + "type": "boolean", + "default": false + }, + "rules": { + "description": "List of custom rules to check against, where each rule is a single logger pattern, useful for wrapped loggers.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "misspell": { + "description": "Correct spellings using locale preferences for US or UK. Default is to use a neutral variety of English.", + "type": "object", + "additionalProperties": false, + "properties": { + "locale": { + "enum": ["US", "UK"] + }, + "ignore-words": { + "description": "List of words to ignore.", + "type": "array", + "items": { + "type": "string" + } + }, + "mode": { + "description": "Mode of the analysis.", + "enum": ["restricted", "", "default"], + "default": "" + }, + "extra-words": { + "description": "Extra word corrections.", + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "correction": { + "type": "string" + }, + "typo": { + "type": "string" + } + } + } + } + } + }, + "musttag": { + "type": "object", + "additionalProperties": false, + "properties": { + "functions": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "arg-pos": { + "type": "integer" + } + } + } + } + } + }, + "nakedret": { + "type": "object", + "additionalProperties": false, + "properties": { + "max-func-lines": { + "description": "Report if a function has more lines of code than this value and it has naked returns.", + "type": "integer", + "minimum": 0, + "default": 30 + } + } + }, + "nestif": { + "type": "object", + "additionalProperties": false, + "properties": { + "min-complexity": { + "description": "Minimum complexity of \"if\" statements to report.", + "type": "integer", + "default": 5 + } + } + }, + "nilnil": { + "type": "object", + "additionalProperties": false, + "properties": { + "checked-types": { + "type": "array", + "description": "List of return types to check.", + "items": { + "enum": ["ptr", "func", "iface", "map", "chan", "uintptr", "unsafeptr"] + }, + "default": ["ptr", "func", "iface", "map", "chan", "uintptr", "unsafeptr"] + } + } + }, + "nlreturn": { + "type": "object", + "additionalProperties": false, + "properties": { + "block-size": { + "description": "set block size that is still ok", + "type": "number", + "default": 0, + "minimum": 0 + } + } + }, + "mnd": { + "type": "object", + "additionalProperties": false, + "properties": { + "ignored-files": { + "description": "List of file patterns to exclude from analysis.", + "examples": [["magic1_.*.go"]], + "type": "array", + "items": { + "type": "string" + } + }, + "ignored-functions": { + "description": "Comma-separated list of function patterns to exclude from the analysis.", + "examples": [["math.*", "http.StatusText", "make"]], + "type": "array", + "items": { + "type": "string" + } + }, + "ignored-numbers": { + "description": "List of numbers to exclude from analysis.", + "examples": [["1000", "1234_567_890", "3.14159264"]], + "type": "array", + "items": { + "type": "string" + } + }, + "checks": { + "description": "The list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description.", + "type": "array", + "items": { + "enum": [ + "argument", + "case", + "condition", + "operation", + "return", + "assign" + ] + } + } + } + }, + "nolintlint": { + "type": "object", + "additionalProperties": false, + "properties": { + "allow-unused": { + "description": "Enable to ensure that nolint directives are all used.", + "type": "boolean", + "default": true + }, + "allow-no-explanation": { + "description": "Exclude these linters from requiring an explanation.", + "type": "array", + "items": { + "$ref": "#/definitions/linters" + }, + "default": [] + }, + "require-explanation": { + "description": "Enable to require an explanation of nonzero length after each nolint directive.", + "type": "boolean", + "default": false + }, + "require-specific": { + "description": "Enable to require nolint directives to mention the specific linter being suppressed.", + "type": "boolean", + "default": false + } + } + }, + "reassign": { + "type": "object", + "additionalProperties": false, + "properties": { + "patterns": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "nonamedreturns": { + "type": "object", + "additionalProperties": false, + "properties": { + "report-error-in-defer": { + "description": "Report named error if it is assigned inside defer.", + "type": "boolean", + "default": false + } + } + }, + "paralleltest": { + "type": "object", + "additionalProperties": false, + "properties": { + "ignore-missing": { + "description": "Ignore missing calls to `t.Parallel()` and only report incorrect uses of it.", + "type": "boolean", + "default": false + }, + "ignore-missing-subtests": { + "description": "Ignore missing calls to `t.Parallel()` in subtests. Top-level tests are still required to have `t.Parallel`, but subtests are allowed to skip it.", + "type": "boolean", + "default": false + } + } + }, + "perfsprint": { + "type": "object", + "additionalProperties": false, + "properties": { + "int-conversion": { + "description": "Optimizes even if it requires an int or uint type cast.", + "type": "boolean", + "default": true + }, + "err-error": { + "description": "Optimizes into `err.Error()` even if it is only equivalent for non-nil errors.", + "type": "boolean", + "default": false + }, + "errorf": { + "description": "Optimizes `fmt.Errorf`.", + "type": "boolean", + "default": true + }, + "sprintf1": { + "description": "Optimizes `fmt.Sprintf` with only one argument.", + "type": "boolean", + "default": true + }, + "strconcat": { + "description": "Optimizes into strings concatenation.", + "type": "boolean", + "default": true + } + } + }, + "prealloc": { + "description": "We do not recommend using this linter before doing performance profiling.\nFor most programs usage of `prealloc` will be premature optimization.", + "type": "object", + "additionalProperties": false, + "properties": { + "simple": { + "description": "Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.", + "type": "boolean", + "default": true + }, + "range-loops": { + "description": "Report preallocation suggestions on range loops.", + "type": "boolean", + "default": true + }, + "for-loops": { + "description": "Report preallocation suggestions on for loops.", + "type": "boolean", + "default": false + } + } + }, + "predeclared": { + "type": "object", + "additionalProperties": false, + "properties": { + "ignore": { + "description": "Comma-separated list of predeclared identifiers to not report on.", + "type": "string" + }, + "q": { + "description": "Include method names and field names (i.e., qualified names) in checks.", + "type": "boolean", + "default": false + } + } + }, + "promlinter": { + "type": "object", + "additionalProperties": false, + "properties": { + "strict": {}, + "disabled-linters": { + "type": "array", + "items": { + "enum": [ + "Help", + "MetricUnits", + "Counter", + "HistogramSummaryReserved", + "MetricTypeInName", + "ReservedChars", + "CamelCase", + "UnitAbbreviations" + ] + } + } + } + }, + "protogetter": { + "type": "object", + "additionalProperties": false, + "properties": { + "skip-generated-by": { + "type": "array", + "items": { + "type": "string", + "examples": ["protoc-gen-go-my-own-generator"] + } + }, + "skip-files": { + "type": "array", + "items": { + "type": "string", + "examples": ["*.pb.go"] + } + }, + "skip-any-generated": { + "description": "Skip any generated files from the checking.", + "type": "boolean", + "default": false + }, + "replace-first-arg-in-append": { + "description": "Skip first argument of append function.", + "type": "boolean", + "default": false + } + } + }, + "revive": { + "type": "object", + "additionalProperties": false, + "examples": [ + { + "ignore-generated-header": true, + "severity": "warning", + "rules": [ + { + "name": "indent-error-flow", + "severity": "warning" + }, + { + "name": "add-constant", + "severity": "warning", + "arguments": [ + { + "maxLitCount": "3", + "allowStrs": "\"\"", + "allowInts": "0,1,2", + "allowFloats": "0.0,0.,1.0,1.,2.0,2." + } + ] + } + ] + } + ], + "properties": { + "max-open-files": { + "type": "integer" + }, + "ignore-generated-header": { + "type": "boolean" + }, + "confidence": { + "type": "number" + }, + "severity": { + "type": "string", + "enum": ["warning", "error"] + }, + "enable-all-rules": { + "type": "boolean", + "default": false + }, + "rules": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": ["name"], + "properties": { + "name": { + "$ref": "#/definitions/revive-rules", + "title": "The rule name" + }, + "disabled": { + "type": "boolean" + }, + "severity": { + "type": "string", + "enum": ["warning", "error"] + }, + "exclude": { + "type": "array", + "items": { + "type": "string" + } + }, + "arguments": { + "type": "array" + } + } + } + } + } + }, + "rowserrcheck": { + "type": "object", + "additionalProperties": false, + "properties": { + "packages": { + "type": "array", + "items": { + "description": "", + "type": "string", + "examples": ["github.com/jmoiron/sqlx"] + } + } + } + }, + "sloglint": { + "type": "object", + "additionalProperties": false, + "properties": { + "kv-only": { + "description": "Enforce using key-value pairs only (incompatible with attr-only).", + "type": "boolean", + "default": false + }, + "no-global": { + "description": "Enforce not using global loggers.", + "enum": ["", "all", "default"], + "default": "" + }, + "no-mixed-args": { + "description": "Enforce not mixing key-value pairs and attributes.", + "type": "boolean", + "default": true + }, + "context": { + "description": "Enforce using methods that accept a context.", + "enum": ["", "all", "scope"], + "default": "" + }, + "static-msg": { + "description": "Enforce using static values for log messages.", + "type": "boolean", + "default": false + }, + "key-naming-case": { + "description": "Enforce a single key naming convention.", + "enum": ["snake", "kebab", "camel", "pascal"] + }, + "attr-only": { + "description": "Enforce using attributes only (incompatible with kv-only).", + "type": "boolean", + "default": false + }, + "no-raw-keys": { + "description": "Enforce using constants instead of raw keys.", + "type": "boolean", + "default": false + }, + "forbidden-keys": { + "description": "Enforce not using specific keys.", + "type": "array", + "items": { + "type": "string" + } + }, + "args-on-sep-lines": { + "description": "Enforce putting arguments on separate lines.", + "type": "boolean", + "default": false + } + } + }, + "spancheck": { + "type": "object", + "additionalProperties": false, + "properties": { + "checks": { + "description": "Checks to enable.", + "type": "array", + "items": { + "enum": ["end", "record-error", "set-status"] + } + }, + "ignore-check-signatures": { + "description": "A list of regexes for function signatures that silence `record-error` and `set-status` reports if found in the call path to a returned error.", + "type": "array", + "items": { + "type": "string" + } + }, + "extra-start-span-signatures": { + "description": "A list of regexes for additional function signatures that create spans.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "staticcheck": { + "type": "object", + "additionalProperties": false, + "properties": { + "checks": { + "type": "array", + "items": { + "anyOf": [ + { + "enum": ["all"] + }, + { + "type": "string" + } + ] + } + } + } + }, + "stylecheck": { + "type": "object", + "additionalProperties": false, + "properties": { + "checks": { + "type": "array", + "items": { + "anyOf": [ + { + "enum": ["all"] + }, + { + "type": "string" + } + ] + }, + "default": [ + "all", + "-ST1000", + "-ST1003", + "-ST1016", + "-ST1020", + "-ST1021", + "-ST1022" + ] + }, + "dot-import-whitelist": { + "description": "By default, ST1001 forbids all uses of dot imports in non-test packages. This setting allows setting a whitelist of import paths that can be dot-imported anywhere.", + "type": "array", + "items": { + "type": "string" + } + }, + "http-status-code-whitelist": { + "description": "ST1013 recommends using constants from the net/http package instead of hard-coding numeric HTTP status codes. This setting specifies a list of numeric status codes that this check does not complain about.", + "default": ["200", "400", "404", "500"], + "type": "array", + "items": { + "enum": [ + "100", + "101", + "102", + "103", + "200", + "201", + "202", + "203", + "204", + "205", + "206", + "207", + "208", + "226", + "300", + "301", + "302", + "303", + "304", + "305", + "306", + "307", + "308", + "400", + "401", + "402", + "403", + "404", + "405", + "406", + "407", + "408", + "409", + "410", + "411", + "412", + "413", + "414", + "415", + "416", + "417", + "418", + "421", + "422", + "423", + "424", + "425", + "426", + "428", + "429", + "431", + "451", + "500", + "501", + "502", + "503", + "504", + "505", + "506", + "507", + "508", + "510", + "511" + ] + } + }, + "initialisms": { + "description": "ST1003 check, among other things, for the correct capitalization of initialisms. The set of known initialisms can be configured with this option.", + "type": "array", + "items": { + "type": "string", + "default": [ + "ACL", + "API", + "ASCII", + "CPU", + "CSS", + "DNS", + "EOF", + "GUID", + "HTML", + "HTTP", + "HTTPS", + "ID", + "IP", + "JSON", + "QPS", + "RAM", + "RPC", + "SLA", + "SMTP", + "SQL", + "SSH", + "TCP", + "TLS", + "TTL", + "UDP", + "UI", + "GID", + "UID", + "UUID", + "URI", + "URL", + "UTF8", + "VM", + "XML", + "XMPP", + "XSRF", + "XSS", + "SIP", + "RTP", + "AMQP", + "DB", + "TS" + ] + } + } + } + }, + "tagalign": { + "type": "object", + "additionalProperties": false, + "properties": { + "align": { + "description": "Align and sort can be used together or separately.", + "type": "boolean", + "default": true + }, + "sort": { + "description": "Whether enable tags sort.", + "type": "boolean", + "default": true + }, + "order": { + "description": "Specify the order of tags, the other tags will be sorted by name.", + "type": "array", + "items": { + "type": "string" + }, + "default": [], + "examples": [ + [ + "json", + "yaml", + "yml", + "toml", + "mapstructure", + "binding", + "validate" + ] + ] + }, + "strict": { + "description": "Whether enable strict style.", + "type": "boolean", + "default": false + } + } + }, + "tagliatelle": { + "type": "object", + "additionalProperties": false, + "properties": { + "case": { + "type": "object", + "additionalProperties": false, + "properties": { + "use-field-name": { + "description": "Use the struct field name to check the name of the struct tag.", + "type": "boolean", + "default": false + }, + "rules": { + "type": "object", + "patternProperties": { + "^.+$": { + "enum": [ + "camel", + "pascal", + "kebab", + "snake", + "goCamel", + "goPascal", + "goKebab", + "goSnake", + "upper", + "upperSnake", + "lower", + "header" + ] + } + } + } + } + } + } + }, + "tenv": { + "type": "object", + "additionalProperties": false, + "properties": { + "all": { + "description": "The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures.", + "type": "boolean", + "default": false + } + } + }, + "testifylint": { + "type": "object", + "additionalProperties": false, + "properties": { + "enable-all": { + "description": "Enable all checkers.", + "type": "boolean", + "default": false + }, + "disable-all": { + "description": "Disable all checkers.", + "type": "boolean", + "default": false + }, + "enable": { + "description": "Enable specific checkers.", + "type": "array", + "items": { + "enum": [ + "blank-import", + "bool-compare", + "compares", + "empty", + "error-is-as", + "error-nil", + "expected-actual", + "float-compare", + "formatter", + "go-require", + "len", + "negative-positive", + "nil-compare", + "require-error", + "suite-broken-parallel", + "suite-dont-use-pkg", + "suite-extra-assert-call", + "suite-subtest-run", + "suite-thelper", + "useless-assert" + ] + }, + "default": [ + "blank-import", + "bool-compare", + "compares", + "empty", + "error-is-as", + "error-nil", + "expected-actual", + "float-compare", + "float-compare", + "go-require", + "len", + "negative-positive", + "nil-compare", + "require-error", + "suite-broken-parallel", + "suite-dont-use-pkg", + "suite-extra-assert-call", + "suite-subtest-run", + "useless-assert" + ] + }, + "disable": { + "description": "Disable specific checkers.", + "type": "array", + "items": { + "enum": [ + "blank-import", + "bool-compare", + "compares", + "empty", + "error-is-as", + "error-nil", + "expected-actual", + "float-compare", + "formatter", + "go-require", + "len", + "negative-positive", + "nil-compare", + "require-error", + "suite-broken-parallel", + "suite-dont-use-pkg", + "suite-extra-assert-call", + "suite-subtest-run", + "suite-thelper", + "useless-assert" + ], + "default": [ + "suite-thelper" + ] + } + }, + "bool-compare": { + "type": "object", + "additionalProperties": false, + "properties": { + "ignore-custom-types": { + "description": "To ignore user defined types (over builtin bool).", + "type": "boolean", + "default": false + } + } + }, + "expected-actual": { + "type": "object", + "additionalProperties": false, + "properties": { + "pattern": { + "description": "Regexp for expected variable name.", + "type": "string", + "default": "(^(exp(ected)?|want(ed)?)([A-Z]\\w*)?$)|(^(\\w*[a-z])?(Exp(ected)?|Want(ed)?)$)" + } + } + }, + "formatter": { + "type": "object", + "additionalProperties": false, + "properties": { + "check-format-string": { + "description": "To enable go vet's printf checks.", + "type": "boolean", + "default": true + }, + "require-f-funcs": { + "description": "To require f-assertions if format string is used.", + "type": "boolean", + "default": false + } + } + }, + "go-require": { + "type": "object", + "additionalProperties": false, + "properties": { + "ignore-http-handlers": { + "description": "To ignore HTTP handlers (like http.HandlerFunc).", + "type": "boolean", + "default": false + } + } + }, + "require-error": { + "type": "object", + "additionalProperties": false, + "properties": { + "fn-pattern": { + "description": "Regexp for assertions to analyze. If defined, then only matched error assertions will be reported.", + "type": "string", + "default": "" + } + } + }, + "suite-extra-assert-call": { + "type": "object", + "additionalProperties": false, + "properties": { + "mode": { + "description": "To require or remove extra Assert() call?", + "type": "string", + "enum": ["remove", "require"], + "default": "remove" + } + } + } + } + }, + "testpackage": { + "type": "object", + "additionalProperties": false, + "properties": { + "skip-regexp": { + "description": "Files with names matching this regular expression are skipped.", + "type": "string", + "examples": ["(export|internal)_test\\.go"] + }, + "allow-packages": { + "description": "List of packages that don't end with _test that tests are allowed to be in.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "examples": ["example"] + } + } + } + }, + "thelper": { + "type": "object", + "additionalProperties": false, + "properties": { + "test": { + "type": "object", + "additionalProperties": false, + "properties": { + "begin": { + "description": "Check if `t.Helper()` begins helper function.", + "default": true, + "type": "boolean" + }, + "first": { + "description": "Check if *testing.T is first param of helper function.", + "default": true, + "type": "boolean" + }, + "name": { + "description": "Check if *testing.T param has t name.", + "default": true, + "type": "boolean" + } + } + }, + "benchmark": { + "type": "object", + "additionalProperties": false, + "properties": { + "begin": { + "description": "Check if `b.Helper()` begins helper function.", + "default": true, + "type": "boolean" + }, + "first": { + "description": "Check if *testing.B is first param of helper function.", + "default": true, + "type": "boolean" + }, + "name": { + "description": "Check if *testing.B param has b name.", + "default": true, + "type": "boolean" + } + } + }, + "tb": { + "type": "object", + "additionalProperties": false, + "properties": { + "begin": { + "description": "Check if `tb.Helper()` begins helper function.", + "default": true, + "type": "boolean" + }, + "first": { + "description": "Check if *testing.TB is first param of helper function.", + "default": true, + "type": "boolean" + }, + "name": { + "description": "Check if *testing.TB param has tb name.", + "default": true, + "type": "boolean" + } + } + }, + "fuzz": { + "type": "object", + "additionalProperties": false, + "properties": { + "begin": { + "description": "Check if `f.Helper()` begins helper function.", + "default": true, + "type": "boolean" + }, + "first": { + "description": "Check if *testing.F is first param of helper function.", + "default": true, + "type": "boolean" + }, + "name": { + "description": "Check if *testing.F param has f name.", + "default": true, + "type": "boolean" + } + } + } + } + }, + "usestdlibvars": { + "type": "object", + "additionalProperties": false, + "properties": { + "http-method": { + "description": "Suggest the use of http.MethodXX.", + "type": "boolean", + "default": true + }, + "http-status-code": { + "description": "Suggest the use of http.StatusXX.", + "type": "boolean", + "default": true + }, + "time-weekday": { + "description": "Suggest the use of time.Weekday.String().", + "type": "boolean", + "default": false + }, + "time-month": { + "description": "Suggest the use of time.Month.String().", + "type": "boolean", + "default": false + }, + "time-layout": { + "description": "Suggest the use of time.Layout.", + "type": "boolean", + "default": false + }, + "crypto-hash": { + "description": "Suggest the use of crypto.Hash.String().", + "type": "boolean", + "default": false + }, + "default-rpc-path": { + "description": "Suggest the use of rpc.DefaultXXPath.", + "type": "boolean", + "default": false + }, + "sql-isolation-level": { + "description": "Suggest the use of sql.LevelXX.String().", + "type": "boolean", + "default": false + }, + "tls-signature-scheme": { + "description": "Suggest the use of tls.SignatureScheme.String().", + "type": "boolean", + "default": false + }, + "constant-kind": { + "description": "Suggest the use of constant.Kind.String().", + "type": "boolean", + "default": false + } + } + }, + "unconvert": { + "type": "object", + "additionalProperties": false, + "properties": { + "fast-math": { + "type": "boolean", + "default": false + }, + "safe": { + "type": "boolean", + "default": false + } + } + }, + "unparam": { + "type": "object", + "additionalProperties": false, + "properties": { + "check-exported": { + "description": "Inspect exported functions. Set to true if no external program/library imports your code.\n\nWARNING: if you enable this setting, unparam will report a lot of false-positives in text editors:\nif it's called for subdir of a project it can't find external interfaces. All text editor integrations\nwith golangci-lint call it on a directory with the changed file.", + "type": "boolean", + "default": false + } + } + }, + "unused": { + "type": "object", + "additionalProperties": false, + "properties": { + "field-writes-are-uses": { + "description": "", + "type": "boolean", + "default": true + }, + "post-statements-are-reads": { + "description": "", + "type": "boolean", + "default": false + }, + "exported-fields-are-used": { + "description": "", + "type": "boolean", + "default": true + }, + "parameters-are-used": { + "description": "", + "type": "boolean", + "default": true + }, + "local-variables-are-used": { + "description": "", + "type": "boolean", + "default": true + }, + "generated-is-used": { + "description": "", + "type": "boolean", + "default": true + } + } + }, + "varnamelen": { + "type": "object", + "additionalProperties": false, + "properties": { + "max-distance": { + "description": "Variables used in at most this N-many lines will be ignored.", + "type": "integer", + "default": 5 + }, + "min-name-length": { + "description": "The minimum length of a variable's name that is considered `long`.", + "type": "integer", + "default": 3 + }, + "check-receiver": { + "description": "Check method receiver names.", + "default": false, + "type": "boolean" + }, + "check-return": { + "description": "Check named return values.", + "default": false, + "type": "boolean" + }, + "check-type-param": { + "description": "Check type parameters.", + "default": false, + "type": "boolean" + }, + "ignore-type-assert-ok": { + "description": "Ignore `ok` variables that hold the bool return value of a type assertion", + "default": false, + "type": "boolean" + }, + "ignore-map-index-ok": { + "description": "Ignore `ok` variables that hold the bool return value of a map index.", + "default": false, + "type": "boolean" + }, + "ignore-chan-recv-ok": { + "description": "Ignore `ok` variables that hold the bool return value of a channel receive.", + "default": false, + "type": "boolean" + }, + "ignore-names": { + "description": "Optional list of variable names that should be ignored completely.", + "default": [[]], + "type": "array", + "items": { + "type": "string" + } + }, + "ignore-decls": { + "description": "Optional list of variable declarations that should be ignored completely.", + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + ["c echo.Context", "t testing.T", "f *foo.Bar", "const C"] + ] + } + } + }, + "whitespace": { + "type": "object", + "additionalProperties": false, + "properties": { + "multi-if": { + "description": "Enforces newlines (or comments) after every multi-line if statement", + "type": "boolean", + "default": false + }, + "multi-func": { + "description": "Enforces newlines (or comments) after every multi-line function signature", + "type": "boolean", + "default": false + } + } + }, + "wrapcheck": { + "type": "object", + "additionalProperties": false, + "properties": { + "ignoreSigs": { + "description": "An array of strings which specify substrings of signatures to ignore.", + "default": [ + ".Errorf(", + "errors.New(", + "errors.Unwrap(", + ".Wrap(", + ".Wrapf(", + ".WithMessage(", + ".WithMessagef(", + ".WithStack(" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "ignoreSigRegexps": { + "description": "An array of strings which specify regular expressions of signatures to ignore.", + "default": [""], + "type": "array", + "items": { + "type": "string" + } + }, + "ignorePackageGlobs": { + "description": "An array of glob patterns which, if any match the package of the function returning the error, will skip wrapcheck analysis for this error.", + "default": [""], + "type": "array", + "items": { + "type": "string" + } + }, + "ignoreInterfaceRegexps": { + "description": "An array of glob patterns which, if matched to an underlying interface name, will ignore unwrapped errors returned from a function whose call is defined on the given interface.", + "default": [""], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "wsl": { + "type": "object", + "additionalProperties": false, + "properties": { + "allow-assign-and-anything": { + "description": "Controls if you may cuddle assignments and anything without needing an empty line between them.", + "type": "boolean", + "default": false + }, + "allow-assign-and-call": { + "description": "Allow calls and assignments to be cuddled as long as the lines have any matching variables, fields or types.", + "type": "boolean", + "default": true + }, + "allow-cuddle-declarations": { + "description": "Allow declarations (var) to be cuddled.", + "type": "boolean", + "default": false + }, + "allow-cuddle-with-calls": { + "description": "A list of call idents that everything can be cuddled with.", + "type": "array", + "items": { + "type": "string" + } + }, + "allow-cuddle-with-rhs": { + "description": "AllowCuddleWithRHS is a list of right hand side variables that is allowed to be cuddled with anything.", + "type": "array", + "items": { + "type": "string" + } + }, + "allow-multiline-assign": { + "description": "Allow multiline assignments to be cuddled.", + "type": "boolean", + "default": true + }, + "allow-separated-leading-comment": { + "description": "Allow leading comments to be separated with empty lines.", + "type": "boolean", + "default": false + }, + "allow-trailing-comment": { + "description": "Allow trailing comments in ending of blocks.", + "type": "boolean", + "default": false + }, + "error-variable-names": { + "description": "When force-err-cuddling is enabled this is a list of names used for error variables to check for in the conditional.", + "type": "array", + "items": { + "type": "string" + } + }, + "force-case-trailing-whitespace": { + "description": "Force newlines in end of case at this limit (0 = never).", + "type": "integer", + "minimum": 0, + "default": 0 + }, + "force-err-cuddling": { + "description": "Causes an error when an If statement that checks an error variable doesn't cuddle with the assignment of that variable.", + "type": "boolean", + "default": false + }, + "force-short-decl-cuddling": { + "description": "Causes an error if a short declaration (:=) cuddles with anything other than another short declaration.", + "type": "boolean", + "default": false + }, + "strict-append": { + "description": "If true, append is only allowed to be cuddled if appending value is matching variables, fields or types on line above.", + "type": "boolean", + "default": true + } + } + }, + "copyloopvar": { + "type": "object", + "additionalProperties": false, + "properties": { + "check-alias": { + "type": "boolean", + "default": false + } + } + }, + "custom": { + "description": "The custom section can be used to define linter plugins to be loaded at runtime. See README of golangci-lint for more information.\nEach custom linter should have a unique name.", + "type": "object", + "patternProperties": { + "^.*$": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "description": "The plugin type.", + "enum": ["module", "goplugin"], + "default": "goplugin" + }, + "path": { + "description": "The path to the plugin *.so. Can be absolute or local.", + "type": "string", + "examples": ["/path/to/example.so"] + }, + "description": { + "description": "The description of the linter, for documentation purposes only.", + "type": "string" + }, + "original-url": { + "description": "Intended to point to the repo location of the linter, for documentation purposes only.", + "type": "string" + }, + "settings": { + "description": "Plugins settings/configuration. Only work with plugin based on `linterdb.PluginConstructor`.", + "type": "object" + } + }, + "oneOf": [ + { + "properties": { + "type": {"enum": ["module"] } + } + }, + { + "required": ["path"] + } + ] + } + } + } + } + }, + "linters": { + "type": "object", + "additionalProperties": false, + "properties": { + "enable": { + "description": "List of enabled linters.", + "type": "array", + "items": { + "$ref": "#/definitions/linters" + } + }, + "disable": { + "description": "List of disabled linters.", + "type": "array", + "items": { + "$ref": "#/definitions/linters" + } + }, + "enable-all": { + "description": "Whether to enable all linters. You can re-disable them with `disable` explicitly.", + "type": "boolean", + "default": false + }, + "disable-all": { + "description": "Whether to disable all linters. You can re-enable them with `enable` explicitly.", + "type": "boolean", + "default": false + }, + "presets": { + "description": "Allow to use different presets of linters", + "type": "array", + "items": { + "enum": [ + "bugs", + "comment", + "complexity", + "error", + "format", + "import", + "metalinter", + "module", + "performance", + "sql", + "style", + "test", + "unused" + ] + } + }, + "fast": { + "description": "Enable run of fast linters.", + "type": "boolean", + "default": false + } + } + }, + "issues": { + "type": "object", + "additionalProperties": false, + "properties": { + "exclude": { + "description": "List of regular expressions of issue texts to exclude.\nBut independently from this option we use default exclude patterns. Their usage can be controlled through `exclude-use-default`.", + "type": "array", + "items": { + "type": "string" + } + }, + "exclude-rules": { + "description": "Exclude configuration per-path, per-linter, per-text and per-source", + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "path": { + "type": "string" + }, + "path-except": { + "type": "string" + }, + "linters": { + "type": "array", + "items": { + "$ref": "#/definitions/linters" + } + }, + "text": { + "type": "string" + }, + "source": { + "type": "string" + } + } + } + }, + "exclude-use-default": { + "description": "Independently from option `exclude` we use default exclude patterns. This behavior can be disabled by this option.", + "type": "boolean", + "default": true + }, + "exclude-case-sensitive": { + "description": "If set to true, exclude and exclude-rules regular expressions become case sensitive.", + "type": "boolean", + "default": false + }, + "exclude-generated": { + "description": "Mode of the generated files analysis.", + "enum": ["lax", "strict", "disable"], + "default": "lax" + }, + "exclude-dirs": { + "description": "Which directories to exclude: issues from them won't be reported.", + "type": "array", + "items": { + "description": "You can use regexp here. The regexp is applied on the full path.\n\"/\" will be replaced by current OS file path separator to properly work on Windows.", + "type": "string", + "examples": ["generated.*"] + }, + "default": [], + "examples": [["src/external_libs", "autogenerated_by_my_lib"]] + }, + "exclude-dirs-use-default": { + "description": "Enable exclusion of directories \"vendor\", \"third_party\", \"testdata\", \"examples\", \"Godeps\", and \"builtin\".", + "type": "boolean", + "default": true + }, + "exclude-files": { + "description": "Which files to exclude: they will be analyzed, but issues from them will not be reported.", + "type": "array", + "items": { + "description": "You can use regexp here. There is no need to include all autogenerated files, we confidently recognize them. If that is not the case, please let us know.\n\"/\" will be replaced by current OS file path separator to properly work on Windows.", + "type": "string", + "examples": [".*\\.my\\.go$"] + }, + "default": [], + "examples": [[".*\\.my\\.go$", "lib/bad.go"]] + }, + "include": { + "description": "The list of ids of default excludes to include or disable.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "max-issues-per-linter": { + "description": "Maximum issues count per one linter. Set to 0 to disable.", + "type": "integer", + "default": 50, + "minimum": 0 + }, + "max-same-issues": { + "description": "Maximum count of issues with the same text. Set to 0 to disable.", + "type": "integer", + "default": 3, + "minimum": 0 + }, + "new": { + "description": "Show only new issues: if there are unstaged changes or untracked files, only those changes are analyzed, else only changes in HEAD~ are analyzed.", + "type": "boolean", + "default": false + }, + "new-from-rev": { + "description": "Show only new issues created after this git revision.", + "type": "string" + }, + "new-from-patch": { + "description": "Show only new issues created in git patch with this file path.", + "type": "string", + "examples": ["path/to/patch/file"] + }, + "fix": { + "description": "Fix found issues (if it's supported by the linter).", + "type": "boolean", + "default": false + }, + "whole-files": { + "description": "Show issues in any part of update files (requires new-from-rev or new-from-patch).", + "type": "boolean", + "default": false + } + } + }, + "severity": { + "type": "object", + "additionalProperties": false, + "properties": { + "default-severity": { + "description": "Set the default severity for issues. If severity rules are defined and the issues do not match or no severity is provided to the rule this will be the default severity applied. Severities should match the supported severity names of the selected out format.", + "type": "string", + "default": "" + }, + "case-sensitive": { + "description": "If set to true, severity-rules regular expressions become case sensitive.", + "type": "boolean", + "default": false + }, + "rules": { + "description": "When a list of severity rules are provided, severity information will be added to lint issues. Severity rules have the same filtering capability as exclude rules except you are allowed to specify one matcher per severity rule.\nOnly affects out formats that support setting severity information.", + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "severity": { + "type": "string" + }, + "path": { + "type": "string" + }, + "path-except": { + "type": "string" + }, + "linters": { + "type": "array", + "items": { + "$ref": "#/definitions/linters" + } + }, + "text": { + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": ["severity"], + "anyOf": [ + { "required": ["path"] }, + { "required": ["path-except"] }, + { "required": ["linters"] }, + { "required": ["text"] }, + { "required": ["source"] } + ] + }, + "default": [] + } + }, + "required": ["default-severity"] + } + } +} diff --git a/pkg/result/processors/sort_results.go b/pkg/result/processors/sort_results.go index 4da73c72ea39..7eebea6315ef 100644 --- a/pkg/result/processors/sort_results.go +++ b/pkg/result/processors/sort_results.go @@ -1,10 +1,9 @@ package processors import ( - "errors" + "cmp" "fmt" "slices" - "sort" "strings" "github.com/golangci/golangci-lint/pkg/config" @@ -22,24 +21,32 @@ const ( orderNameSeverity = "severity" ) +const ( + less = iota - 1 + equal + greater +) + var _ Processor = (*SortResults)(nil) +type issueComparator func(a, b *result.Issue) int + type SortResults struct { - cmps map[string]*comparator + cmps map[string][]issueComparator cfg *config.Output } func NewSortResults(cfg *config.Config) *SortResults { return &SortResults{ - cmps: map[string]*comparator{ + cmps: map[string][]issueComparator{ // For sorting we are comparing (in next order): // file names, line numbers, position, and finally - giving up. - orderNameFile: byFileName().SetNext(byLine().SetNext(byColumn())), + orderNameFile: {byFileName, byLine, byColumn}, // For sorting we are comparing: linter name - orderNameLinter: byLinter(), + orderNameLinter: {byLinter}, // For sorting we are comparing: severity - orderNameSeverity: bySeverity(), + orderNameSeverity: {bySeverity}, }, cfg: &cfg.Output, } @@ -57,23 +64,21 @@ func (p SortResults) Process(issues []result.Issue) ([]result.Issue, error) { p.cfg.SortOrder = []string{orderNameFile} } - var cmps []*comparator + var cmps []issueComparator + for _, name := range p.cfg.SortOrder { c, ok := p.cmps[name] if !ok { return nil, fmt.Errorf("unsupported sort-order name %q", name) } - cmps = append(cmps, c) + cmps = append(cmps, c...) } - cmp, err := mergeComparators(cmps) - if err != nil { - return nil, err - } + comp := mergeComparators(cmps...) - sort.Slice(issues, func(i, j int) bool { - return cmp.Compare(&issues[i], &issues[j]) == less + slices.SortFunc(issues, func(a, b result.Issue) int { + return comp(&a, &b) }) return issues, nil @@ -81,147 +86,32 @@ func (p SortResults) Process(issues []result.Issue) ([]result.Issue, error) { func (SortResults) Finish() {} -type compareResult int - -const ( - less compareResult = iota - 1 - equal - greater - none -) - -func (c compareResult) isNeutral() bool { - // return true if compare result is incomparable or equal. - return c == none || c == equal -} - -func (c compareResult) String() string { - switch c { - case less: - return "less" - case equal: - return "equal" - case greater: - return "greater" - default: - return "none" - } -} - -// comparator describes how to implement compare for two "issues". -type comparator struct { - name string - compare func(a, b *result.Issue) compareResult - next *comparator -} - -func (cmp *comparator) Next() *comparator { return cmp.next } - -func (cmp *comparator) SetNext(c *comparator) *comparator { - cmp.next = c - return cmp +func byFileName(a, b *result.Issue) int { + return strings.Compare(a.FilePath(), b.FilePath()) } -func (cmp *comparator) String() string { - s := cmp.name - if cmp.Next() != nil { - s += " > " + cmp.Next().String() - } - - return s +func byLine(a, b *result.Issue) int { + return numericCompare(a.Line(), b.Line()) } -func (cmp *comparator) Compare(a, b *result.Issue) compareResult { - res := cmp.compare(a, b) - if !res.isNeutral() { - return res - } - - if next := cmp.Next(); next != nil { - return next.Compare(a, b) - } - - return res +func byColumn(a, b *result.Issue) int { + return numericCompare(a.Column(), b.Column()) } -func byFileName() *comparator { - return &comparator{ - name: "byFileName", - compare: func(a, b *result.Issue) compareResult { - return compareResult(strings.Compare(a.FilePath(), b.FilePath())) - }, - } +func byLinter(a, b *result.Issue) int { + return strings.Compare(a.FromLinter, b.FromLinter) } -func byLine() *comparator { - return &comparator{ - name: "byLine", - compare: func(a, b *result.Issue) compareResult { - return numericCompare(a.Line(), b.Line()) - }, - } +func bySeverity(a, b *result.Issue) int { + return severityCompare(a.Severity, b.Severity) } -func byColumn() *comparator { - return &comparator{ - name: "byColumn", - compare: func(a, b *result.Issue) compareResult { - return numericCompare(a.Column(), b.Column()) - }, - } -} - -func byLinter() *comparator { - return &comparator{ - name: "byLinter", - compare: func(a, b *result.Issue) compareResult { - return compareResult(strings.Compare(a.FromLinter, b.FromLinter)) - }, - } -} - -func bySeverity() *comparator { - return &comparator{ - name: "bySeverity", - compare: func(a, b *result.Issue) compareResult { - return severityCompare(a.Severity, b.Severity) - }, - } -} - -func mergeComparators(cmps []*comparator) (*comparator, error) { - if len(cmps) == 0 { - return nil, errors.New("no comparator") - } - - for i := range len(cmps) - 1 { - findComparatorTip(cmps[i]).SetNext(cmps[i+1]) - } - - return cmps[0], nil -} - -func findComparatorTip(cmp *comparator) *comparator { - if cmp.Next() != nil { - return findComparatorTip(cmp.Next()) - } - - return cmp -} - -func severityCompare(a, b string) compareResult { +func severityCompare(a, b string) int { // The position inside the slice define the importance (lower to higher). classic := []string{"low", "medium", "high", "warning", "error"} if slices.Contains(classic, a) && slices.Contains(classic, b) { - switch { - case slices.Index(classic, a) > slices.Index(classic, b): - return greater - case slices.Index(classic, a) < slices.Index(classic, b): - return less - default: - return equal - } + return cmp.Compare(slices.Index(classic, a), slices.Index(classic, b)) } if slices.Contains(classic, a) { @@ -232,28 +122,27 @@ func severityCompare(a, b string) compareResult { return less } - return compareResult(strings.Compare(a, b)) + return strings.Compare(a, b) } -func numericCompare(a, b int) compareResult { - var ( - isValuesInvalid = a < 0 || b < 0 - isZeroValuesBoth = a == 0 && b == 0 - isEqual = a == b - isZeroValueInA = b > 0 && a == 0 - isZeroValueInB = a > 0 && b == 0 - ) - - switch { - case isZeroValuesBoth || isEqual: +func numericCompare(a, b int) int { + // Negative values and zeros are skipped (equal) because they either invalid or "neutral" (default int value). + if a <= 0 || b <= 0 { return equal - case isValuesInvalid || isZeroValueInA || isZeroValueInB: - return none - case a > b: - return greater - case a < b: - return less } - return equal + return cmp.Compare(a, b) +} + +func mergeComparators(comps ...issueComparator) issueComparator { + return func(a, b *result.Issue) int { + for _, comp := range comps { + i := comp(a, b) + if i != equal { + return i + } + } + + return equal + } } diff --git a/pkg/result/processors/sort_results_test.go b/pkg/result/processors/sort_results_test.go index cc5b32ace543..b2aaa824daee 100644 --- a/pkg/result/processors/sort_results_test.go +++ b/pkg/result/processors/sort_results_test.go @@ -73,22 +73,23 @@ var extraSeverityIssues = []result.Issue{ type compareTestCase struct { a, b result.Issue - expected compareResult + expected int } -func testCompareValues(t *testing.T, cmp *comparator, name string, tests []compareTestCase) { - t.Parallel() - +func testCompareValues(t *testing.T, cmp issueComparator, name string, tests []compareTestCase) { for i, test := range tests { //nolint:gocritic // To ignore rangeValCopy rule t.Run(fmt.Sprintf("%s(%d)", name, i), func(t *testing.T) { - res := cmp.Compare(&test.a, &test.b) - assert.Equal(t, test.expected.String(), res.String()) + t.Parallel() + + res := cmp(&test.a, &test.b) + + assert.Equal(t, compToString(test.expected), compToString(res)) }) } } -func TestCompareByLine(t *testing.T) { - testCompareValues(t, byLine(), "Compare By Line", []compareTestCase{ +func Test_byLine(t *testing.T) { + testCompareValues(t, byLine, "Compare By Line", []compareTestCase{ {issues[0], issues[1], less}, // 10 vs 11 {issues[0], issues[0], equal}, // 10 vs 10 {issues[3], issues[3], equal}, // 10 vs 10 @@ -103,8 +104,8 @@ func TestCompareByLine(t *testing.T) { }) } -func TestCompareByFileName(t *testing.T) { - testCompareValues(t, byFileName(), "Compare By File Name", []compareTestCase{ +func Test_byFileName(t *testing.T) { + testCompareValues(t, byFileName, "Compare By File Name", []compareTestCase{ {issues[0], issues[1], greater}, // file_windows.go vs file_linux.go {issues[1], issues[2], greater}, // file_linux.go vs file_darwin.go {issues[2], issues[3], equal}, // file_darwin.go vs file_darwin.go @@ -118,23 +119,23 @@ func TestCompareByFileName(t *testing.T) { }) } -func TestCompareByColumn(t *testing.T) { - testCompareValues(t, byColumn(), "Compare By Column", []compareTestCase{ +func Test_byColumn(t *testing.T) { + testCompareValues(t, byColumn, "Compare By Column", []compareTestCase{ {issues[0], issues[1], greater}, // 80 vs 70 - {issues[1], issues[2], none}, // 70 vs zero value + {issues[1], issues[2], equal}, // 70 vs zero value {issues[3], issues[3], equal}, // 60 vs 60 - {issues[2], issues[3], none}, // zero value vs 60 - {issues[2], issues[1], none}, // zero value vs 70 + {issues[2], issues[3], equal}, // zero value vs 60 + {issues[2], issues[1], equal}, // zero value vs 70 {issues[1], issues[0], less}, // 70 vs 80 {issues[1], issues[1], equal}, // 70 vs 70 - {issues[3], issues[2], none}, // vs zero value + {issues[3], issues[2], equal}, // vs zero value {issues[2], issues[2], equal}, // zero value vs zero value {issues[1], issues[1], equal}, // 70 vs 70 }) } -func TestCompareByLinter(t *testing.T) { - testCompareValues(t, byLinter(), "Compare By Linter", []compareTestCase{ +func Test_byLinter(t *testing.T) { + testCompareValues(t, byLinter, "Compare By Linter", []compareTestCase{ {issues[0], issues[1], greater}, // b vs a {issues[1], issues[2], less}, // a vs c {issues[2], issues[3], equal}, // c vs c @@ -148,8 +149,8 @@ func TestCompareByLinter(t *testing.T) { }) } -func TestCompareBySeverity(t *testing.T) { - testCompareValues(t, bySeverity(), "Compare By Severity", []compareTestCase{ +func Test_bySeverity(t *testing.T) { + testCompareValues(t, bySeverity, "Compare By Severity", []compareTestCase{ {issues[0], issues[1], greater}, // medium vs low {issues[1], issues[2], less}, // low vs high {issues[2], issues[3], equal}, // high vs high @@ -165,49 +166,50 @@ func TestCompareBySeverity(t *testing.T) { }) } -func TestCompareNested(t *testing.T) { - cmp := byFileName().SetNext(byLine().SetNext(byColumn())) - - testCompareValues(t, cmp, "Nested Comparing", []compareTestCase{ - {issues[1], issues[0], less}, // file_linux.go vs file_windows.go - {issues[2], issues[1], less}, // file_darwin.go vs file_linux.go - {issues[0], issues[1], greater}, // file_windows.go vs file_linux.go - {issues[1], issues[2], greater}, // file_linux.go vs file_darwin.go - {issues[3], issues[2], less}, // file_darwin.go vs file_darwin.go, 10 vs 12 - {issues[0], issues[0], equal}, // file_windows.go vs file_windows.go - {issues[2], issues[3], greater}, // file_darwin.go vs file_darwin.go, 12 vs 10 - {issues[1], issues[1], equal}, // file_linux.go vs file_linux.go - {issues[2], issues[2], equal}, // file_darwin.go vs file_darwin.go - {issues[3], issues[3], equal}, // file_darwin.go vs file_darwin.go - }) +func Test_mergeComparators(t *testing.T) { + testCompareValues(t, mergeComparators(byFileName, byLine, byColumn), "Nested Comparing", + []compareTestCase{ + {issues[1], issues[0], less}, // file_linux.go vs file_windows.go + {issues[2], issues[1], less}, // file_darwin.go vs file_linux.go + {issues[0], issues[1], greater}, // file_windows.go vs file_linux.go + {issues[1], issues[2], greater}, // file_linux.go vs file_darwin.go + {issues[3], issues[2], less}, // file_darwin.go vs file_darwin.go, 10 vs 12 + {issues[0], issues[0], equal}, // file_windows.go vs file_windows.go + {issues[2], issues[3], greater}, // file_darwin.go vs file_darwin.go, 12 vs 10 + {issues[1], issues[1], equal}, // file_linux.go vs file_linux.go + {issues[2], issues[2], equal}, // file_darwin.go vs file_darwin.go + {issues[3], issues[3], equal}, // file_darwin.go vs file_darwin.go + }, + ) } -func TestNumericCompare(t *testing.T) { +func Test_numericCompare(t *testing.T) { tests := []struct { a, b int - expected compareResult + expected int }{ {0, 0, equal}, - {0, 1, none}, - {1, 0, none}, - {1, -1, none}, - {-1, 1, none}, + {0, 1, equal}, + {1, 0, equal}, + {1, -1, equal}, + {-1, 1, equal}, {1, 1, equal}, {1, 2, less}, {2, 1, greater}, } - t.Parallel() - for i, test := range tests { t.Run(fmt.Sprintf("%s(%d)", "Numeric Compare", i), func(t *testing.T) { + t.Parallel() + res := numericCompare(test.a, test.b) - assert.Equal(t, test.expected.String(), res.String()) + + assert.Equal(t, compToString(test.expected), compToString(res)) }) } } -func TestNoSorting(t *testing.T) { +func TestSortResults_Process_noSorting(t *testing.T) { tests := make([]result.Issue, len(issues)) copy(tests, issues) @@ -218,7 +220,7 @@ func TestNoSorting(t *testing.T) { assert.Equal(t, tests, results) } -func TestSorting(t *testing.T) { +func TestSortResults_Process_Sorting(t *testing.T) { tests := make([]result.Issue, len(issues)) copy(tests, issues) @@ -231,52 +233,15 @@ func TestSorting(t *testing.T) { assert.Equal(t, []result.Issue{issues[3], issues[2], issues[1], issues[0]}, results) } -func Test_mergeComparators(t *testing.T) { - testCases := []struct { - desc string - cmps []*comparator - expected string - }{ - { - desc: "one", - cmps: []*comparator{byLinter()}, - expected: "byLinter", - }, - { - desc: "two", - cmps: []*comparator{byLinter(), byFileName()}, - expected: "byLinter > byFileName", - }, - { - desc: "all", - cmps: []*comparator{bySeverity(), byLinter(), byFileName(), byLine(), byColumn()}, - expected: "bySeverity > byLinter > byFileName > byLine > byColumn", - }, - { - desc: "nested", - cmps: []*comparator{bySeverity(), byFileName().SetNext(byLine().SetNext(byColumn())), byLinter()}, - expected: "bySeverity > byFileName > byLine > byColumn > byLinter", - }, - { - desc: "all reverse", - cmps: []*comparator{byColumn(), byLine(), byFileName(), byLinter(), bySeverity()}, - expected: "byColumn > byLine > byFileName > byLinter > bySeverity", - }, +func compToString(c int) string { + switch c { + case less: + return "less" + case greater: + return "greater" + case equal: + return "equal" + default: + return "error" } - - for _, test := range testCases { - t.Run(test.desc, func(t *testing.T) { - t.Parallel() - - cmp, err := mergeComparators(test.cmps) - require.NoError(t, err) - - assert.Equal(t, test.expected, cmp.String()) - }) - } -} - -func Test_mergeComparators_error(t *testing.T) { - _, err := mergeComparators(nil) - require.EqualError(t, err, "no comparator") } diff --git a/scripts/gen_github_action_config/go.mod b/scripts/gen_github_action_config/go.mod index 41fb433a4e9b..92c6db2229d6 100644 --- a/scripts/gen_github_action_config/go.mod +++ b/scripts/gen_github_action_config/go.mod @@ -4,7 +4,7 @@ go 1.21.0 require ( github.com/shurcooL/githubv4 v0.0.0-20240429030203-be2daab69064 - golang.org/x/oauth2 v0.23.0 + golang.org/x/oauth2 v0.24.0 ) require github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466 // indirect diff --git a/scripts/gen_github_action_config/go.sum b/scripts/gen_github_action_config/go.sum index 8fb22429c0a2..275bd8b4446f 100644 --- a/scripts/gen_github_action_config/go.sum +++ b/scripts/gen_github_action_config/go.sum @@ -4,5 +4,5 @@ github.com/shurcooL/githubv4 v0.0.0-20240429030203-be2daab69064 h1:RCQBSFx5JrsbH github.com/shurcooL/githubv4 v0.0.0-20240429030203-be2daab69064/go.mod h1:zqMwyHmnN/eDOZOdiTohqIUKUrTFX62PNlu7IJdu0q8= github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466 h1:17JxqqJY66GmZVHkmAsGEkcIu0oCe3AM420QDgGwZx0= github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466/go.mod h1:9dIRpgIY7hVhoqfe0/FcYp0bpInZaT7dc3BYOprrIUE= -golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= -golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= +golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=