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

Fix and update golanci-lint reported issues #892

Merged
merged 6 commits into from
Dec 25, 2021

Conversation

mjtrangoni
Copy link
Contributor

Hi @carlpett @breed808,

First of all, thank you for this project!

This PR update golangci-lint to the latest version, replacing some deprecated linters from the configuration file. Also took the opportunity to fix some spelling issues detected by codespell, which could be added to the CI in a future.

Note that go1.17 was used so this adds the new go command format changes, see go-command.

See,
```
collector/os.go:306:10: unnecessary conversion (unconvert)
		float64(fsipf),
		       ^
```

Signed-off-by: Mario Trangoni <[email protected]>
See,
```
$ codespell --skip=".git,./vendor" --ignore-words-list=calle
./exporter.go:262: overriden ==> overridden
./collector/dfsr.go:132: receieved ==> received
./collector/dns.go:140: reponses ==> responses
./collector/exchange.go:238: occational ==> occasional
./collector/mssql.go:1961: shoud ==> should
./collector/process.go:137: sharable ==> shareable
./collector/remote_fx.go:64: seccond ==> second
./docs/collector.dfsr.md:47: fils ==> fills, files, file
./docs/collector.exchange.md:39: lengt ==> length
./docs/collector.fsrmquota.md:3: Ressource ==> Resource
./docs/collector.fsrmquota.md:51: Ressource ==> Resource
./docs/collector.os.md:20: sotred ==> sorted, stored
./docs/collector.process.md:56: sharable ==> shareable
./docs/collector.smtp.md:27: mailformed ==> malformed
```

Signed-off-by: Mario Trangoni <[email protected]>
See,
```
$ GOOS=windows GOARCH=amd64 golangci-lint run  ./... 2>1 | grep var-declaration
collector/os.go:205:22: var-declaration: should drop = 0 from declaration of var fsipf; it is the zero value (revive)
collector/os.go:226:23: var-declaration: should drop = 0 from declaration of var pfbRaw; it is the zero value (revive)
```

Signed-off-by: Mario Trangoni <[email protected]>
See,
```
log/gokit_adapter.go:9:26: unexported-return: exported func NewToolkitAdapter returns unexported type *log.logAdapter, which can be annoying to use (revive)
func NewToolkitAdapter() *logAdapter {
                         ^
```

Signed-off-by: Mario Trangoni <[email protected]>
@mjtrangoni mjtrangoni requested a review from a team as a code owner December 24, 2021 10:25
Copy link
Contributor

@breed808 breed808 left a comment

Choose a reason for hiding this comment

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

Excellent work, this is great 👍

@breed808 breed808 merged commit 4d771d2 into prometheus-community:master Dec 25, 2021
@mjtrangoni mjtrangoni deleted the fix-golanci-lint branch December 25, 2021 00:52
mjtrangoni added a commit to mjtrangoni/windows_exporter that referenced this pull request Dec 29, 2021
After fixing all spelling issues in prometheus-community#892, this will prevent us for
adding new ones.

Signed-off-by: Mario Trangoni <[email protected]>
mjtrangoni added a commit to mjtrangoni/windows_exporter that referenced this pull request Jan 2, 2022
After fixing all spelling issues in prometheus-community#892, this will prevent us for
adding new ones.

Signed-off-by: Mario Trangoni <[email protected]>
akrauza pushed a commit to akrauza/windows_exporter that referenced this pull request Jan 4, 2022
After fixing all spelling issues in prometheus-community#892, this will prevent us for
adding new ones.

Signed-off-by: Mario Trangoni <[email protected]>
jsturtevant pushed a commit to jsturtevant/windows_exporter that referenced this pull request Jan 10, 2022
After fixing all spelling issues in prometheus-community#892, this will prevent us for
adding new ones.

Signed-off-by: Mario Trangoni <[email protected]>
mansikulkarni96 pushed a commit to mansikulkarni96/prometheus-community-windows_exporter that referenced this pull request Jul 7, 2022
After fixing all spelling issues in prometheus-community#892, this will prevent us for
adding new ones.

Signed-off-by: Mario Trangoni <[email protected]>
mansikulkarni96 pushed a commit to mansikulkarni96/prometheus-community-windows_exporter that referenced this pull request Jul 7, 2022
After fixing all spelling issues in prometheus-community#892, this will prevent us for
adding new ones.

Signed-off-by: Mario Trangoni <[email protected]>
anubhavg-icpl pushed a commit to anubhavg-icpl/windows_exporter that referenced this pull request Sep 22, 2024
…ci-lint

Fix and update golanci-lint reported issues
anubhavg-icpl pushed a commit to anubhavg-icpl/windows_exporter that referenced this pull request Sep 22, 2024
After fixing all spelling issues in prometheus-community#892, this will prevent us for
adding new ones.

Signed-off-by: Mario Trangoni <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants