Skip to content

Commit 846705a

Browse files
committed
as: Fix linter issues
1 parent e3a47c3 commit 846705a

File tree

3 files changed

+42
-32
lines changed

3 files changed

+42
-32
lines changed

.golangci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
run:
2-
skip-dirs:
3-
- node_modules
4-
51
linters:
62
disable-all: true
73
enable:
@@ -113,3 +109,6 @@ issues:
113109
- linters:
114110
- paralleltest
115111
text: 'does not use range value in test Run'
112+
exclude-dirs:
113+
- node_modules
114+

pkg/applicationserver/config.go

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ type InteropConfig struct {
4949

5050
// EndDeviceFetcherConfig represents configuration for the end device fetcher in Application Server.
5151
type EndDeviceFetcherConfig struct {
52-
Timeout time.Duration `name:"timeout" description:"Timeout of the end device retrival operation"`
53-
Cache EndDeviceFetcherCacheConfig `name:"cache" description:"Cache configuration options for the end device fetcher"`
54-
CircuitBreaker EndDeviceFetcherCircuitBreakerConfig `name:"circuit-breaker" description:"Circuit breaker options for the end device fetcher"`
52+
Timeout time.Duration `name:"timeout" description:"Timeout of the end device retrival operation"` // nolint:lll
53+
Cache EndDeviceFetcherCacheConfig `name:"cache" description:"Cache configuration options for the end device fetcher"` // nolint:lll
54+
CircuitBreaker EndDeviceFetcherCircuitBreakerConfig `name:"circuit-breaker" description:"Circuit breaker options for the end device fetcher"` // nolint:lll
5555
}
5656

5757
// EndDeviceFetcherCacheConfig represents configuration for device information caching in Application Server.
@@ -65,7 +65,7 @@ type EndDeviceFetcherCacheConfig struct {
6565
type EndDeviceFetcherCircuitBreakerConfig struct {
6666
Enable bool `name:"enable" description:"Enable circuit breaker behavior on burst errors"`
6767
Timeout time.Duration `name:"timeout" description:"Timeout after which the circuit breaker closes"`
68-
Threshold int `name:"threshold" description:"Number of failed fetching attempts after which the circuit breaker opens"`
68+
Threshold int `name:"threshold" description:"Number of failed fetching attempts after which the circuit breaker opens"` // nolint:lll
6969
}
7070

7171
// EndDeviceMetadataStorageConfig represents the configuration of end device metadata operations.
@@ -77,38 +77,38 @@ type EndDeviceMetadataStorageConfig struct {
7777
// EndDeviceLocationStorageConfig represents the configuration of end device locations storage.
7878
type EndDeviceLocationStorageConfig struct {
7979
Registry metadata.EndDeviceLocationRegistry `name:"-"`
80-
Timeout time.Duration `name:"timeout" description:"Timeout of the end device retrieval operation"`
80+
Timeout time.Duration `name:"timeout" description:"Timeout of the end device retrieval operation"` // nolint:lll
8181
Cache EndDeviceLocationStorageCacheConfig `name:"cache"`
8282
}
8383

8484
// EndDeviceLocationStorageCacheConfig represents the configuration of end device location registry caching.
8585
type EndDeviceLocationStorageCacheConfig struct {
8686
Cache metadata.EndDeviceLocationCache `name:"-"`
87-
Enable bool `name:"enable" description:"Enable caching of end device locations"`
88-
MinRefreshInterval time.Duration `name:"min-refresh-interval" description:"Minimum time interval between two asynchronous refreshes"`
89-
MaxRefreshInterval time.Duration `name:"max-refresh-interval" description:"Maximum time interval between two asynchronous refreshes"`
90-
TTL time.Duration `name:"eviction-ttl" description:"Time to live of cached locations"`
87+
Enable bool `name:"enable" description:"Enable caching of end device locations"` // nolint:lll
88+
MinRefreshInterval time.Duration `name:"min-refresh-interval" description:"Minimum time interval between two asynchronous refreshes"` // nolint:lll
89+
MaxRefreshInterval time.Duration `name:"max-refresh-interval" description:"Maximum time interval between two asynchronous refreshes"` // nolint:lll
90+
TTL time.Duration `name:"eviction-ttl" description:"Time to live of cached locations"` // nolint:lll
9191
}
9292

9393
// EndDeviceAttributesStorageConfig represents the configuration of end device attributes storage.
9494
type EndDeviceAttributesStorageConfig struct {
9595
Registry metadata.EndDeviceAttributesRegistry `name:"-"`
96-
Timeout time.Duration `name:"timeout" description:"Timeout of the end device retrieval operation"`
96+
Timeout time.Duration `name:"timeout" description:"Timeout of the end device retrieval operation"` // nolint:lll
9797
Cache EndDeviceAttributesStorageCacheConfig `name:"cache"`
9898
}
9999

100100
// EndDeviceAttributesStorageCacheConfig represents the configuration of end device attributes registry caching.
101101
type EndDeviceAttributesStorageCacheConfig struct {
102102
Cache metadata.EndDeviceAttributesCache `name:"-"`
103-
Enable bool `name:"enable" description:"Enable caching of end device attributes"`
104-
MinRefreshInterval time.Duration `name:"min-refresh-interval" description:"Minimum time interval between two asynchronous refreshes"`
105-
MaxRefreshInterval time.Duration `name:"max-refresh-interval" description:"Maximum time interval between two asynchronous refreshes"`
106-
TTL time.Duration `name:"eviction-ttl" description:"Time to live of cached attributes"`
103+
Enable bool `name:"enable" description:"Enable caching of end device attributes"` // nolint:lll
104+
MinRefreshInterval time.Duration `name:"min-refresh-interval" description:"Minimum time interval between two asynchronous refreshes"` // nolint:lll
105+
MaxRefreshInterval time.Duration `name:"max-refresh-interval" description:"Maximum time interval between two asynchronous refreshes"` // nolint:lll
106+
TTL time.Duration `name:"eviction-ttl" description:"Time to live of cached attributes"` // nolint:lll
107107
}
108108

109109
// FormattersConfig represents the configuration for payload formatters.
110110
type FormattersConfig struct {
111-
MaxParameterLength int `name:"max-parameter-length" description:"Maximum allowed size for length of formatter parameters (payload formatter scripts)"`
111+
MaxParameterLength int `name:"max-parameter-length" description:"Maximum allowed size for length of formatter parameters (payload formatter scripts)"` // nolint:lll
112112
}
113113

114114
// ConfirmationConfig represents the configuration for confirmed downlink.
@@ -129,21 +129,21 @@ type PaginationConfig struct {
129129

130130
// Config represents the ApplicationServer configuration.
131131
type Config struct {
132-
LinkMode string `name:"link-mode" description:"Deprecated - mode to link applications to their Network Server (all, explicit)"`
132+
LinkMode string `name:"link-mode" description:"Deprecated - mode to link applications to their Network Server (all, explicit)"` // nolint:lll
133133
Devices DeviceRegistry `name:"-"`
134134
Links LinkRegistry `name:"-"`
135135
UplinkStorage UplinkStorageConfig `name:"uplink-storage" description:"Application uplinks storage configuration"`
136136
Formatters FormattersConfig `name:"formatters" description:"Payload formatters configuration"`
137137
Distribution DistributionConfig `name:"distribution" description:"Distribution configuration"`
138-
EndDeviceFetcher EndDeviceFetcherConfig `name:"fetcher" description:"Deprecated - End Device fetcher configuration"`
139-
EndDeviceMetadataStorage EndDeviceMetadataStorageConfig `name:"end-device-metadata-storage" description:"End device metadata storage configuration"`
138+
EndDeviceFetcher EndDeviceFetcherConfig `name:"fetcher" description:"Deprecated - End Device fetcher configuration"` // nolint:lll
139+
EndDeviceMetadataStorage EndDeviceMetadataStorageConfig `name:"end-device-metadata-storage" description:"End device metadata storage configuration"` // nolint:lll
140140
MQTT config.MQTT `name:"mqtt" description:"MQTT configuration"`
141141
Webhooks WebhooksConfig `name:"webhooks" description:"Webhooks configuration"`
142142
PubSub PubSubConfig `name:"pubsub" description:"Pub/sub messaging configuration"`
143143
Packages ApplicationPackagesConfig `name:"packages" description:"Application packages configuration"`
144144
Interop InteropConfig `name:"interop" description:"Interop client configuration"`
145-
DeviceKEKLabel string `name:"device-kek-label" description:"Label of KEK used to encrypt device keys at rest"`
146-
DeviceLastSeen LastSeenConfig `name:"device-last-seen" description:"End Device last seen batch update configuration"`
145+
DeviceKEKLabel string `name:"device-kek-label" description:"Label of KEK used to encrypt device keys at rest"` // nolint:lll
146+
DeviceLastSeen LastSeenConfig `name:"device-last-seen" description:"End Device last seen batch update configuration"` // nolint:lll
147147
Downlinks DownlinksConfig `name:"downlinks" description:"Downlink configuration"`
148148
Pagination PaginationConfig `name:"pagination" description:"Pagination configuration"`
149149
}
@@ -170,10 +170,10 @@ type UplinkStorageConfig struct {
170170
type WebhooksConfig struct {
171171
Registry web.WebhookRegistry `name:"-"`
172172
Target string `name:"target" description:"Target of the integration (direct)"`
173-
Timeout time.Duration `name:"timeout" description:"Wait timeout of the target to process the request"`
173+
Timeout time.Duration `name:"timeout" description:"Wait timeout of the target to process the request"` // nolint:lll
174174
QueueSize int `name:"queue-size" description:"Number of requests to queue"`
175175
Workers int `name:"workers" description:"Number of workers to process requests"`
176-
UnhealthyAttemptsThreshold int `name:"unhealthy-attempts-threshold" description:"Number of failed webhook attempts before the webhook is disabled"`
176+
UnhealthyAttemptsThreshold int `name:"unhealthy-attempts-threshold" description:"Number of failed webhook attempts before the webhook is disabled"` // nolint:lll
177177
UnhealthyRetryInterval time.Duration `name:"unhealthy-retry-interval" description:"Time interval after which disabled webhooks may execute again"`
178178
Templates web.TemplatesConfig `name:"templates" description:"The store of the webhook templates"`
179179
Downlinks web.DownlinksConfig `name:"downlink" description:"The downlink queue operations configuration"`
@@ -309,7 +309,10 @@ func (c PubSubConfig) NewPubSub(comp *component.Component, server io.Server) (*p
309309

310310
// NewApplicationPackages returns a new applications packages frontend based on the configuration.
311311
// If the registry is nil, it returns nil.
312-
func (c ApplicationPackagesConfig) NewApplicationPackages(ctx context.Context, server io.Server) (packages.Server, error) {
312+
func (c ApplicationPackagesConfig) NewApplicationPackages(
313+
ctx context.Context,
314+
server io.Server,
315+
) (packages.Server, error) {
313316
if c.Registry == nil {
314317
return nil, nil
315318
}
@@ -333,7 +336,10 @@ var (
333336
)
334337

335338
// NewRegistry returns a new end device location registry based on the configuration.
336-
func (c EndDeviceLocationStorageConfig) NewRegistry(ctx context.Context, comp *component.Component) (metadata.EndDeviceLocationRegistry, error) {
339+
func (c EndDeviceLocationStorageConfig) NewRegistry(
340+
ctx context.Context,
341+
comp *component.Component,
342+
) (metadata.EndDeviceLocationRegistry, error) {
337343
if c.Timeout <= 0 {
338344
return nil, errInvalidTimeout.WithAttributes("timeout", c.Timeout)
339345
}
@@ -346,13 +352,17 @@ func (c EndDeviceLocationStorageConfig) NewRegistry(ctx context.Context, comp *c
346352
}
347353
}
348354
cache := metadata.NewMetricsEndDeviceLocationCache(c.Cache.Cache)
349-
registry = metadata.NewCachedEndDeviceLocationRegistry(ctx, comp, registry, cache, c.Cache.MinRefreshInterval, c.Cache.MaxRefreshInterval, c.Cache.TTL)
355+
registry = metadata.NewCachedEndDeviceLocationRegistry(
356+
ctx, comp, registry, cache, c.Cache.MinRefreshInterval, c.Cache.MaxRefreshInterval, c.Cache.TTL)
350357
}
351358
return registry, nil
352359
}
353360

354361
// NewRegistry returns a new end device attributes registry based on the configuration.
355-
func (c EndDeviceAttributesStorageConfig) NewRegistry(ctx context.Context, comp *component.Component) (metadata.EndDeviceAttributesRegistry, error) {
362+
func (c EndDeviceAttributesStorageConfig) NewRegistry(
363+
ctx context.Context,
364+
comp *component.Component,
365+
) (metadata.EndDeviceAttributesRegistry, error) {
356366
if c.Timeout <= 0 {
357367
return nil, errInvalidTimeout.WithAttributes("timeout", c.Timeout)
358368
}
@@ -365,7 +375,8 @@ func (c EndDeviceAttributesStorageConfig) NewRegistry(ctx context.Context, comp
365375
}
366376
}
367377
cache := metadata.NewMetricsEndDeviceAttributesCache(c.Cache.Cache)
368-
registry = metadata.NewCachedEndDeviceAttributesRegistry(ctx, comp, registry, cache, c.Cache.MinRefreshInterval, c.Cache.MaxRefreshInterval, c.Cache.TTL)
378+
registry = metadata.NewCachedEndDeviceAttributesRegistry(
379+
ctx, comp, registry, cache, c.Cache.MinRefreshInterval, c.Cache.MaxRefreshInterval, c.Cache.TTL)
369380
}
370381
return registry, nil
371382
}

pkg/webui/components/map/map.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
// stylelint-disable
3838

39-
:global {
39+
:global {
4040
.leaflet-pane,
4141
.leaflet-tile,
4242
.leaflet-marker-icon,

0 commit comments

Comments
 (0)