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

update github.com/golangci/golangci-lint from 1.51.1 to 1.52.2 causes issues #20424

Closed
4 tasks done
codeboten opened this issue Mar 27, 2023 · 2 comments · Fixed by #22983
Closed
4 tasks done
Assignees
Labels
ci-cd CI, CD, testing, build issues

Comments

@codeboten
Copy link
Contributor

codeboten commented Mar 27, 2023

Component(s)

Describe the issue you're reporting

This upgrades causes many lint failures. Creating a separate issue to address them.

@codeboten codeboten added the ci-cd CI, CD, testing, build issues label Mar 27, 2023
@codeboten codeboten self-assigned this Mar 27, 2023
@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label May 29, 2023
codeboten pushed a commit to codeboten/opentelemetry-collector-contrib that referenced this issue May 29, 2023
Updating golangci-lint raises the following warnings:

```
integration_test.go:385:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
        if err := recordsWaitAndCheck(func() (recordsCheckable, as.Error) {
                return c.Query(queryPolicy, geoStm1)
        }); err != nil {
                return err
        }
integration_test.go:145:2: empty-block: this block is empty, you can remove it (revive)
        for range chk.Results() {
        }
scraper.go:112:36: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (r *aerospikeReceiver) scrape(ctx context.Context) (pmetric.Metrics, error) {
                                   ^
config.go:54:72: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
                return multierr.Append(allErrs, fmt.Errorf("%w: %s", errBadEndpoint, err))
                                                                                     ^
config.go:63:71: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
                allErrs = multierr.Append(allErrs, fmt.Errorf("%w: %s", errBadPort, err))
                                                                                    ^
config.go:84:78: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
                        allErrs = multierr.Append(allErrs, fmt.Errorf("%w: %s", errFailedTLSLoad, err))
```

Linked issue: open-telemetry#20424

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit to codeboten/opentelemetry-collector-contrib that referenced this issue May 29, 2023
Updating golangci-lint raises the following warnings:

```
factory.go:26:2: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
        ctx context.Context,
        ^
logs.go:133:51: unused-parameter: parameter 'host' seems to be unused, consider removing or renaming it as _ (revive)
func (l *logsReceiver) Start(ctx context.Context, host component.Host) error {
                                                  ^
logs.go:140:33: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (l *logsReceiver) Shutdown(ctx context.Context) error {
```

Linked issue: open-telemetry#20424

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit to codeboten/opentelemetry-collector-contrib that referenced this issue May 29, 2023
Updating golangci-lint raises the following warnings:

```
receiver.go:42:53: unused-parameter: parameter 'host' seems to be unused, consider removing or renaming it as _ (revive)
func (m *metricReceiver) Start(ctx context.Context, host component.Host) error {
                                                    ^
receiver.go:49:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (m *metricReceiver) Shutdown(ctx context.Context) error {
```

Linked issue: open-telemetry#20424

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit that referenced this issue May 29, 2023
Updating golangci-lint raises the following warnings:

```
integration_test.go:385:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
        if err := recordsWaitAndCheck(func() (recordsCheckable, as.Error) {
                return c.Query(queryPolicy, geoStm1)
        }); err != nil {
                return err
        }
integration_test.go:145:2: empty-block: this block is empty, you can remove it (revive)
        for range chk.Results() {
        }
scraper.go:112:36: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (r *aerospikeReceiver) scrape(ctx context.Context) (pmetric.Metrics, error) {
                                   ^
config.go:54:72: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
                return multierr.Append(allErrs, fmt.Errorf("%w: %s", errBadEndpoint, err))
                                                                                     ^
config.go:63:71: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
                allErrs = multierr.Append(allErrs, fmt.Errorf("%w: %s", errBadPort, err))
                                                                                    ^
config.go:84:78: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
                        allErrs = multierr.Append(allErrs, fmt.Errorf("%w: %s", errFailedTLSLoad, err))
```

Linked issue: #20424

Signed-off-by: Alex Boten <[email protected]>
@codeboten codeboten removed the Stale label May 29, 2023
codeboten pushed a commit to codeboten/opentelemetry-collector-contrib that referenced this issue May 29, 2023
Updating golangci-lint raises many unused-parameter errors, this is addressing some of those.

Linked issue: open-telemetry#20424

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit that referenced this issue May 29, 2023
Updating golangci-lint raises the following warnings:

```
factory.go:26:2: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
        ctx context.Context,
        ^
logs.go:133:51: unused-parameter: parameter 'host' seems to be unused, consider removing or renaming it as _ (revive)
func (l *logsReceiver) Start(ctx context.Context, host component.Host) error {
                                                  ^
logs.go:140:33: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (l *logsReceiver) Shutdown(ctx context.Context) error {
```

Linked issue: #20424

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit that referenced this issue May 29, 2023
Updating golangci-lint raises the following warnings:

```
receiver.go:42:53: unused-parameter: parameter 'host' seems to be unused, consider removing or renaming it as _ (revive)
func (m *metricReceiver) Start(ctx context.Context, host component.Host) error {
                                                    ^
receiver.go:49:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (m *metricReceiver) Shutdown(ctx context.Context) error {
```

Linked issue: #20424

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit that referenced this issue May 29, 2023
Updating golangci-lint raises many unused-parameter errors, this is addressing some of those. Note in some cases, the context passed into start methods wasn't used, I fixed this.

Linked issue: #20424

---------

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit to codeboten/opentelemetry-collector-contrib that referenced this issue May 29, 2023
codeboten pushed a commit to codeboten/opentelemetry-collector-contrib that referenced this issue May 29, 2023
Linked issue: open-telemetry#20424

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit to codeboten/opentelemetry-collector-contrib that referenced this issue May 29, 2023
Linked issue: open-telemetry#20424

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit that referenced this issue May 29, 2023
Linked issue: #20424

---------

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit to codeboten/opentelemetry-collector-contrib that referenced this issue May 30, 2023
Linked issue: open-telemetry#20424

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit that referenced this issue May 30, 2023
Linked issue: #20424

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit that referenced this issue May 30, 2023
codeboten pushed a commit that referenced this issue May 30, 2023
Linked issue: #20424

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit to codeboten/opentelemetry-collector-contrib that referenced this issue May 30, 2023
Linked issue: open-telemetry#20424

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit that referenced this issue May 30, 2023
Linked issue: #20424

Signed-off-by: Alex Boten <[email protected]>
codeboten pushed a commit to codeboten/opentelemetry-collector-contrib that referenced this issue May 31, 2023
Linked issue: open-telemetry#20424

Signed-off-by: Alex Boten <[email protected]>
mx-psi pushed a commit that referenced this issue May 31, 2023
Linked issue: #20424

Signed-off-by: Alex Boten <[email protected]>
@fatsheep9146
Copy link
Contributor

This issue could be closed? @codeboten

codeboten pushed a commit to codeboten/opentelemetry-collector-contrib that referenced this issue May 31, 2023
codeboten pushed a commit that referenced this issue Jun 1, 2023
Fixes #20424

---------

Signed-off-by: Alex Boten <[email protected]>
Caleb-Hurshman pushed a commit to observIQ/opentelemetry-collector-contrib that referenced this issue Jul 6, 2023
Caleb-Hurshman pushed a commit to observIQ/opentelemetry-collector-contrib that referenced this issue Jul 6, 2023
Caleb-Hurshman pushed a commit to observIQ/opentelemetry-collector-contrib that referenced this issue Jul 6, 2023
Caleb-Hurshman pushed a commit to observIQ/opentelemetry-collector-contrib that referenced this issue Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-cd CI, CD, testing, build issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants