From 61c8143fe853619ed9560d1fc95209cfc270a17c Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 7 Aug 2022 23:54:24 +0200 Subject: [PATCH] build: fix linting issues introduced by latest revive release --- Makefile | 2 +- common/clickhousedb/mocks/empty.go | 1 + common/helpers/subnetmap.go | 1 + common/helpers/tests.go | 2 ++ common/kafka/config.go | 2 ++ conntrackfixer/mocks/empty.go | 1 + console/authentication/root.go | 1 + console/database/root.go | 2 ++ console/filter/helpers.go | 1 + inlet/flow/decoder/root.go | 2 ++ inlet/flow/input/root.go | 1 + orchestrator/kafka/root.go | 1 + 12 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ebb9742d..d0ba7f79 100644 --- a/Makefile +++ b/Makefile @@ -148,7 +148,7 @@ test-coverage: | $(GOCOV) $(GOCOVXML) $(GOTESTSUM) ; $(info $(M) running coverag .PHONY: lint lint: .lint-go~ .lint-js~ ## Run linting .lint-go~: $(shell $(LSFILES) '*.go' 2> /dev/null) | $(REVIVE) ; $(info $(M) running golint…) - $Q $(REVIVE) -formatter friendly -set_exit_status $? + $Q $(REVIVE) -formatter friendly -set_exit_status ./... $Q touch $@ .lint-js~: $(shell $(LSFILES) '*.js' '*.vue' '*.html' 2> /dev/null) .lint-js~: console/frontend/node_modules ; $(info $(M) running jslint…) diff --git a/common/clickhousedb/mocks/empty.go b/common/clickhousedb/mocks/empty.go index 371019dc..987704ef 100644 --- a/common/clickhousedb/mocks/empty.go +++ b/common/clickhousedb/mocks/empty.go @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: 2022 Free Mobile // SPDX-License-Identifier: AGPL-3.0-only +// Package mocks contains mocks for clickhousedb package. package mocks // This is empty to ensure the package exists to help Dependabot. diff --git a/common/helpers/subnetmap.go b/common/helpers/subnetmap.go index 522528cc..b18cf008 100644 --- a/common/helpers/subnetmap.go +++ b/common/helpers/subnetmap.go @@ -160,6 +160,7 @@ func SubnetMapUnmarshallerHook[V any]() mapstructure.DecodeHookFunc { } } +// MarshalYAML turns a subnet into a map that can be marshaled. func (sm SubnetMap[V]) MarshalYAML() (interface{}, error) { return sm.ToMap(), nil } diff --git a/common/helpers/tests.go b/common/helpers/tests.go index a9662d17..8eb933ec 100644 --- a/common/helpers/tests.go +++ b/common/helpers/tests.go @@ -3,6 +3,8 @@ //go:build !release +// Package helpers contains small functions usable by any other +// package, both for testing or not. package helpers import ( diff --git a/common/kafka/config.go b/common/kafka/config.go index c1dfd0e8..08696366 100644 --- a/common/kafka/config.go +++ b/common/kafka/config.go @@ -1,6 +1,8 @@ // SPDX-FileCopyrightText: 2022 Free Mobile // SPDX-License-Identifier: AGPL-3.0-only +// Package kafka exposes some common helpers for Kafka, including the +// configuration struture. package kafka import "github.com/Shopify/sarama" diff --git a/conntrackfixer/mocks/empty.go b/conntrackfixer/mocks/empty.go index 371019dc..cd54069e 100644 --- a/conntrackfixer/mocks/empty.go +++ b/conntrackfixer/mocks/empty.go @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: 2022 Free Mobile // SPDX-License-Identifier: AGPL-3.0-only +// Package mocks contains mocks for conntrackfixer package. package mocks // This is empty to ensure the package exists to help Dependabot. diff --git a/console/authentication/root.go b/console/authentication/root.go index 31be2539..dab548e8 100644 --- a/console/authentication/root.go +++ b/console/authentication/root.go @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: 2022 Free Mobile // SPDX-License-Identifier: AGPL-3.0-only +// Package authentication handles user authentication for the console. package authentication import "akvorado/common/reporter" diff --git a/console/database/root.go b/console/database/root.go index 8cdcb3b6..9bf9786b 100644 --- a/console/database/root.go +++ b/console/database/root.go @@ -1,6 +1,8 @@ // SPDX-FileCopyrightText: 2022 Free Mobile // SPDX-License-Identifier: AGPL-3.0-only +// Package database handles connection to a persistent database to +// save console settings. package database import ( diff --git a/console/filter/helpers.go b/console/filter/helpers.go index 8e3b9e87..bd060759 100644 --- a/console/filter/helpers.go +++ b/console/filter/helpers.go @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: 2022 Free Mobile // SPDX-License-Identifier: AGPL-3.0-only +// Package filter parses and transforms a user filter. package filter import ( diff --git a/inlet/flow/decoder/root.go b/inlet/flow/decoder/root.go index 8f607d51..3b775079 100644 --- a/inlet/flow/decoder/root.go +++ b/inlet/flow/decoder/root.go @@ -1,6 +1,8 @@ // SPDX-FileCopyrightText: 2022 Free Mobile // SPDX-License-Identifier: AGPL-3.0-only +// Package decoder handles the protocol-independent part of flow +// decoding. package decoder import ( diff --git a/inlet/flow/input/root.go b/inlet/flow/input/root.go index 41df3057..1652fe5a 100644 --- a/inlet/flow/input/root.go +++ b/inlet/flow/input/root.go @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: 2022 Free Mobile // SPDX-License-Identifier: AGPL-3.0-only +// Package input defines the interface of an input module for inlet. package input import ( diff --git a/orchestrator/kafka/root.go b/orchestrator/kafka/root.go index 75a59567..026408d7 100644 --- a/orchestrator/kafka/root.go +++ b/orchestrator/kafka/root.go @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: 2022 Free Mobile // SPDX-License-Identifier: AGPL-3.0-only +// Package kafka handles Kafka-related configuration for the orchestrator. package kafka import (