Skip to content

Commit

Permalink
Merge pull request #799 from SiaFoundation/add-tag-lint
Browse files Browse the repository at this point in the history
Add Tag Linting
  • Loading branch information
ChrisSchinnerl authored Dec 7, 2023
2 parents 31feba0 + 12c6d0e commit a62b125
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 11 deletions.
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ linters-settings:
- name: package-comments
disabled: true

tagliatelle:
case:
rules:
json: goCamel
yaml: goCamel

linters:
disable-all: true
fast: false
Expand All @@ -95,6 +101,7 @@ linters:
- misspell
- typecheck
- whitespace
- tagliatelle

issues:
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
Expand Down
2 changes: 1 addition & 1 deletion api/autopilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ type (
PruningLastStart TimeRFC3339 `json:"pruningLastStart"`
Scanning bool `json:"scanning"`
ScanningLastStart TimeRFC3339 `json:"scanningLastStart"`
UptimeMS DurationMS `json:"uptimeMS"`
UptimeMS DurationMS `json:"uptimeMs"`

StartTime TimeRFC3339 `json:"startTime"`
BuildState
Expand Down
2 changes: 1 addition & 1 deletion api/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type (
Network string `json:"network"`
Version string `json:"version"`
Commit string `json:"commit"`
OS string `json:"OS"`
OS string `json:"os"`
BuildTime TimeRFC3339 `json:"buildTime"`
}
)
8 changes: 4 additions & 4 deletions api/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,29 +176,29 @@ type (

// DownloadStatsResponse is the response type for the /stats/downloads endpoint.
DownloadStatsResponse struct {
AvgDownloadSpeedMBPS float64 `json:"avgDownloadSpeedMBPS"`
AvgDownloadSpeedMBPS float64 `json:"avgDownloadSpeedMbps"`
AvgOverdrivePct float64 `json:"avgOverdrivePct"`
HealthyDownloaders uint64 `json:"healthyDownloaders"`
NumDownloaders uint64 `json:"numDownloaders"`
DownloadersStats []DownloaderStats `json:"downloadersStats"`
}
DownloaderStats struct {
AvgSectorDownloadSpeedMBPS float64 `json:"avgSectorDownloadSpeedMBPS"`
AvgSectorDownloadSpeedMBPS float64 `json:"avgSectorDownloadSpeedMbps"`
HostKey types.PublicKey `json:"hostKey"`
NumDownloads uint64 `json:"numDownloads"`
}

// UploadStatsResponse is the response type for the /stats/uploads endpoint.
UploadStatsResponse struct {
AvgSlabUploadSpeedMBPS float64 `json:"avgSlabUploadSpeedMBPS"`
AvgSlabUploadSpeedMBPS float64 `json:"avgSlabUploadSpeedMbps"`
AvgOverdrivePct float64 `json:"avgOverdrivePct"`
HealthyUploaders uint64 `json:"healthyUploaders"`
NumUploaders uint64 `json:"numUploaders"`
UploadersStats []UploaderStats `json:"uploadersStats"`
}
UploaderStats struct {
HostKey types.PublicKey `json:"hostKey"`
AvgSectorUploadSpeedMBPS float64 `json:"avgSectorUploadSpeedMBPS"`
AvgSectorUploadSpeedMBPS float64 `json:"avgSectorUploadSpeedMbps"`
}

// WorkerStateResponse is the response type for the /worker/state endpoint.
Expand Down
4 changes: 2 additions & 2 deletions build/meta.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cmd/renterd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ func runCompatMigrateAutopilotJSONToStore(bc *bus.Client, id, dir string) (err e

// read the json config
log.Println("migration: reading autopilot.json")
//nolint:tagliatelle
var cfg struct {
Config api.AutopilotConfig `json:"Config"`
}
Expand Down
6 changes: 3 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type (
RemoteAddr string `yaml:"remoteAddr"`
RemotePassword string `yaml:"remotePassword"`
PersistInterval time.Duration `yaml:"persistInterval"`
UsedUTXOExpiry time.Duration `yaml:"usedUTXOExpiry"`
UsedUTXOExpiry time.Duration `yaml:"usedUtxoExpiry"`
SlabBufferCompletionThreshold int64 `yaml:"slabBufferCompleionThreshold"`
}

Expand All @@ -67,7 +67,7 @@ type (

// MySQL contains the configuration for an optional MySQL database.
MySQL struct {
URI string `yaml:"URI"`
URI string `yaml:"uri"`
User string `yaml:"user"`
Password string `yaml:"password"`
Database string `yaml:"database"`
Expand All @@ -90,7 +90,7 @@ type (
// Worker contains the configuration for a worker.
Worker struct {
Enabled bool `yaml:"enabled"`
ID string `yaml:"ID"`
ID string `yaml:"id"`
Remotes []RemoteWorker `yaml:"remotes"`
AllowPrivateIPs bool `yaml:"allowPrivateIPs"`
BusFlushInterval time.Duration `yaml:"busFlushInterval"`
Expand Down

0 comments on commit a62b125

Please sign in to comment.