-
Notifications
You must be signed in to change notification settings - Fork 1.6k
golangci lint v2 #1707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
ccoVeille
wants to merge
297
commits into
gofr-dev:development
from
ccoveille-forks:golangci-lint-v2
Closed
golangci lint v2 #1707
ccoVeille
wants to merge
297
commits into
gofr-dev:development
from
ccoveille-forks:golangci-lint-v2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…from crashing (gofr-dev#525) * fix server crash by adding panic recover * add test to test panic recovery of subscription and migrations * fix linters * add TODO statement to move panic recovery to a central location * refactor code * fix linters --------- Co-authored-by: aryan-mehrotra-zs <aryan.mehrotra@zopsmart.com>
* update otel packages * implement sql connection retry * resolve linters * fix go.mod file size * revert changes * add tests * fix configs import * modify how we check if SQL DB is connected for container test * check error once * remove error logs case * update log messages * update implementation to log when the database get connected to database
* update otel packages * fix migration entry not being create
* update otel packages * add tests for grpc logs * fix mod file
Release v1.4.1
Release v1.5.0
Release/v1.35.2
* Bump github.com/redis/go-redis/v9 in the go_modules group (gofr-dev#1593) * Bump github.com/redis/go-redis/v9 (gofr-dev#1592) * Bump github.com/golang-jwt/jwt/v5 in the go_modules group (gofr-dev#1596) * Bump github.com/golang-jwt/jwt/v5 (gofr-dev#1597) * Moving pprof endpoint to metrics port (gofr-dev#1594) * Bump google.golang.org/protobuf from 1.36.5 to 1.36.6 (gofr-dev#1606) * Bump github.com/go-sql-driver/mysql from 1.9.0 to 1.9.1 (gofr-dev#1603) * Bump google.golang.org/api from 0.226.0 to 0.227.0 (gofr-dev#1602) * Bump modernc.org/sqlite from 1.36.1 to 1.36.2 (gofr-dev#1604) * Bump github.com/redis/go-redis/extra/redisotel/v9 from 9.7.1 to 9.7.3 (gofr-dev#1605) * Add migrations for surreal DB(gofr-dev#1591) * add metrics for surrealDB (gofr-dev#1600) * update linter to v1.64.0 (gofr-dev#1607) * update and test linter v1.64 * remove unwanted code --------- Co-authored-by: Aryan Mehrotra <aryanmehrotra2000@gmail.com> * Adding Verification for JWT Claims (gofr-dev#1580) Co-authored-by: Umang Mundhra <mundhraumang.02@gmail.com> Co-authored-by: Aryan Mehrotra <aryanmehrotra2000@gmail.com> Co-authored-by: @ccoVeille <3875889+ccoVeille@users.noreply.github.com> * Fix: Dockerfile to deploy website build fail (gofr-dev#1609) * update release version to v1.36.0 --------- Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Divya Darshana <98943137+coolwednesday@users.noreply.github.com> Co-authored-by: Aryan Mehrotra <aryanmehrotra2000@gmail.com> Co-authored-by: @ccoVeille <3875889+ccoVeille@users.noreply.github.com>
* remove unwanted docker commands * add grafanna dashboard in observability section * add DB_CHARSET config in documentation * change designation of Christophe Colombier as per request * adding one more testimonial * Bump github.com/XSAM/otelsql from 0.37.0 to 0.38.0 (gofr-dev#1622) * Bump modernc.org/sqlite from 1.36.2 to 1.37.0 (gofr-dev#1621) * Bump google.golang.org/api from 0.227.0 to 0.228.0 (gofr-dev#1620) * Bump ls-lint/action from 2.2.3 to 2.3.0 in the actions group (gofr-dev#1619) * minor change * En/dgraph migrations (gofr-dev#1623) * Fix/surreal db update (gofr-dev#1628) * Bump google.golang.org/grpc from 1.71.0 to 1.71.1 (gofr-dev#1636) * Bump golang.org/x/text from 0.23.0 to 0.24.0 (gofr-dev#1631) * Bump golang.org/x/term from 0.30.0 to 0.31.0 (gofr-dev#1633) * Bump golang.org/x/oauth2 from 0.28.0 to 0.29.0 (gofr-dev#1634) * Bump cloud.google.com/go/pubsub from 1.48.0 to 1.49.0 (gofr-dev#1635) * Bump go.uber.org/mock from 0.5.0 to 0.5.1 (gofr-dev#1629) * Bump github.com/go-sql-driver/mysql from 1.9.1 to 1.9.2 (gofr-dev#1630) * Adding configurational options for gRPC Servers & Client in GoFr (gofr-dev#1618) * update the reviews with image or reviewers * change image format for webp for reviewers * delete unused images * update version to v1.37.0 --------- Co-authored-by: Aryan Mehrotra <aryanmehrotra2000@gmail.com> Co-authored-by: Divya <divi229moc@gmail.com> Co-authored-by: Divya Darshana <98943137+coolwednesday@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Vikash Kumar <vikash.iitb@gmail.com> Co-authored-by: naveen-bandela-au2 <b.naveen2085@gmail.com>
Release/v1.37.1
* Bump google.golang.org/api from 0.228.0 to 0.229.0 Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.228.0 to 0.229.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](googleapis/google-api-go-client@v0.228.0...v0.229.0) --- updated-dependencies: - dependency-name: google.golang.org/api dependency-version: 0.229.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update migration docs * Bump golang.org/x/net from 0.37.0 to 0.38.0 in the go_modules group Bumps the go_modules group with 1 update: [golang.org/x/net](https://github.com/golang/net). Updates `golang.org/x/net` from 0.37.0 to 0.38.0 - [Commits](golang/net@v0.37.0...v0.38.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-version: 0.38.0 dependency-type: indirect dependency-group: go_modules ... Signed-off-by: dependabot[bot] <support@github.com> * doc: fix gofr.dev link * doc: use Markdown notes for formatting notes * Merge pull request gofr-dev#1662 from ccoveille-forks/documentation-fix-go-version * Update go version in Dockerfile (gofr-dev#1641) * Update go version in Dockerfile * update go version to 1.24 across all docker files --------- Co-authored-by: umang01-hash <mundhraumang.02@gmail.com> Co-authored-by: Aryan Mehrotra <aryanmehrotra2000@gmail.com> * Fix incorrect websocket documentation link in README.md (gofr-dev#1665) * fix: typo in opentsdb SubQuery struct (gofr-dev#1663) * Enabled usetesting linter in golangci-lint (gofr-dev#1668) * minor * enabled the usetesting and used fixed usetesting command to fix some issue * removed unused context from import * updated go.work.sum after rebase * removed usetesting unused settings * reverted the go.work.sum file * resolve linter in gofr/config dir --------- Co-authored-by: umang01-hash <mundhraumang.02@gmail.com> Co-authored-by: Aryan Mehrotra <aryanmehrotra2000@gmail.com> * Add support for elastic search (gofr-dev#1670) * enhance circuit breaker config * resolve review comments * revert change on NOTE formatting * Update framework version to v1.38.0 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Naveen <naveen246@gmail.com> Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Co-authored-by: Aryan Mehrotra <aryanmehrotra2000@gmail.com> Co-authored-by: Vikash Kumar <vikash.iitb@gmail.com> Co-authored-by: Bishnupada Nandi <bishnu.nandi123@gmail.com> Co-authored-by: Joe Bird <shuaiqijianhao@qq.com> Co-authored-by: Anurag Yadav <95437051+Yadavanurag13@users.noreply.github.com>
Release/v1.39.0
I simply launched the following command $ golangci-lint migrate The configuration file was updated to the new format. The comments were stripped by the migration tool.
I copy pasted them manually from the v1 configuration file.
Also fix "examples" folder exclusions. This folder was previously excluded by golangci-lint v1. The migration tool failed to migrate this. Later, we can remove the exclusions for "examples". But the idea is to keep the same behavior as before.
We don't need it, we can use the default value. lax was the default behavior in the golangci-lint v1. We can remove it as we don't need it.
We may want to fix these errors reported by golangci-lint in the future. But as they were already in golangci-lint v1, we will not fix them now.
These rules were not activated in golangci-lint v1. They were added in v2 by default, but they are reporting a lot of issues. This commit restores the previous behavior. We might want to re-enable them in the future, but for now.
These rules weren't not enabled in golangci-lint v1. Because we enabled EXC0014, the migration tool disabled the "comment" presets. So it removed all the exclusions about the Go comments. While we only expected to remove the EXC0014 exclusion. This commit restores the previous and expected behavior. We might want to re-enable them in the future, but for now.
testifylint was improved, so it reports more issues now. These errors were fixed by simply running the following command: $ golangci-lint run --fix --enable-only testifylint
pkg/gofr/datasource/arangodb/arango_document_test.go:51:2: formatter: using msgAndArgs with non-string first element (msg) causes panic (testifylint) require.ErrorIs(t, err, errDocumentNotFound, err, "Expected error when document not found") ^ pkg/gofr/datasource/arangodb/arango_document_test.go:87:2: formatter: using msgAndArgs with non-string first element (msg) causes panic (testifylint) require.ErrorIs(t, err, errDocumentNotFound, err, "Expected error when document not found")
gci was improved, so it reports more issues now. These errors were fixed by simply running the following command: $ golangci-lint fmt --fix
Opened on the wrong branch, replaced by #1708 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
‘
with ```\`` with
'` for the right wordingPull Request Template
Description:
Breaking Changes (if applicable):
Additional Information:
Checklist:
goimport
andgolangci-lint
.Thank you for your contribution!