Skip to content
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

enable exhaustruct linter #1034

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open

Conversation

kozyrev-m
Copy link

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: #931

What is the new behavior?

Other information

@codecov-commenter
Copy link

codecov-commenter commented Feb 19, 2024

Codecov Report

Attention: Patch coverage is 75.86207% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 54.64%. Comparing base (72c8364) to head (db2ee7f).

Files Patch % Lines
internal/allocator/allocator.go 44.00% 14 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1034       +/-   ##
===========================================
- Coverage   66.64%   54.64%   -12.00%     
===========================================
  Files         283      280        -3     
  Lines       27583    26506     -1077     
===========================================
- Hits        18382    14484     -3898     
- Misses       8342    11030     +2688     
- Partials      859      992      +133     
Flag Coverage Δ
54.64% <75.86%> (+0.11%) ⬆️
go-1.21.x 54.51% <75.86%> (-13.94%) ⬇️
go-1.22.x 54.54% <75.86%> (-11.99%) ⬇️
integration 54.64% <75.86%> (+0.11%) ⬆️
macOS ?
ubuntu ?
unit ?
windows ?
ydb-22.5 52.49% <75.86%> (+0.02%) ⬆️
ydb-23.1 52.41% <75.86%> (+0.14%) ⬆️
ydb-23.2 52.33% <75.86%> (-0.17%) ⬇️
ydb-23.3 52.38% <75.86%> (-0.15%) ⬇️
ydb-24.1 54.48% <75.86%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -5,6 +5,7 @@ import (

"github.com/ydb-platform/ydb-go-genproto/protos/Ydb"
"github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Table"
"google.golang.org/protobuf/types/known/structpb"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the order of imported packages. Standard library packages should be imported at first place, then external packages and project internal packages as last one. Refer other files in the projects for examples.

{gte: 0, lte: 8 * time.Second},
{gte: 0, lte: 8 * time.Second},
{gte: 0, lte: 8 * time.Second},
{eq: 0, gte: 0, lte: time.Second},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is a linter required for tests too?
this code is too detailed for tests

Copy link
Author

@kozyrev-m kozyrev-m Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is.
Exhaustruct linter checks all files, including tests.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you disable this linter for tests?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try if possible.
Now, I don't know how to switch off the linter for tests.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use something like this

issues:
  exclude-rules:
    - path: _test.go
      linters:
        - exhaustruct

@@ -29,14 +29,17 @@

func getService(ctx context.Context, dsn string, opts ...ydb.Option) (s *service, err error) {
once.Do(func() {
transport := new(http.Transport)
transport.TLSClientConfig = new(tls.Config)
transport.TLSClientConfig.InsecureSkipVerify = true

Check failure

Code scanning / CodeQL

Disabled TLS certificate check High

InsecureSkipVerify should not be used in production code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants