what do you think about golangci-lint?

Aperta
#789 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go
Ambito
tooling

Direzione di ricerca

The issue demonstrates golangci-lint findings in the ds18b20 driver and mentions the Makefile's existing gofmt target. Start by reading that Makefile target and checking how the ds18b20 driver is handled by the default linter settings. Determine which drivers can be linted without the machine package, then document or configure a repeatable lint check and address its reported findings.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

At least all drivers without the machine package import could be checked. I have tested this with the default settings of linter for the ds18b20 folder as an fast example and got 3 important issues regarding a missing check of error return value:

ds18b20.go:47:15: Error return value of `d.owd.Select` is not checked (errcheck)
		d.owd.Select(romid)
		            ^
ds18b20.go:57:14: Error return value of `d.owd.Select` is not checked (errcheck)
	d.owd.Select(romid)
	            ^
ds18b20.go:67:14: Error return value of `d.owd.Select` is not checked (errcheck)
	d.owd.Select(romid)
	            ^
ds18b20.go:32:23: ST1005: error strings should not end with punctuation or newlines (staticcheck)
	errReadTemperature = errors.New("Error: DS18B20. Read temperature error: CRC mismatch.")
	                     ^
4 issues:
* errcheck: 3
* staticcheck: 1

Currently gofmt is used in the Makefile.

Lingua principale
Go
Stelle
756
Fork
251
Merge medio
7g 12h
PR unite (30g)
8

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tinygo-org/drivers

Tutte le issue di tinygo-org/drivers

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.