Skip to content

Commit

Permalink
chore(build): configure 'revive' and 'nolintlint' linters (#984)
Browse files Browse the repository at this point in the history
spring cleaning in the `// nolint` comments ;)

Signed-off-by: Xavier Coulon <[email protected]>
  • Loading branch information
xcoulon authored Mar 19, 2022
1 parent 50a5106 commit f9a3bdb
Show file tree
Hide file tree
Showing 183 changed files with 382 additions and 357 deletions.
28 changes: 27 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,47 @@ linters:
- revive
- misspell
- exportloopref
- nolintlint
disable-all: false
disable:
- maligned
- prealloc
- scopelint
- golint
presets:
- bugs
- unused
fast: false

linters-settings:
revive:
# Enable all available rules.
# Default: false
# enable-all-rules: true
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports
- name: dot-imports
disabled: true
exhaustive:
# check switch statements in generated files also
check-generated: false
# indicates that switch statements are to be considered exhaustive if a
# 'default' case is present, even if all enum members aren't listed in the
# switch
default-signifies-exhaustive: true
default-signifies-exhaustive: true
nolintlint:
# Disable to ensure that all nolint directives actually have an effect.
# Default: false
allow-unused: false
# Disable to ensure that nolint directives don't have a leading space.
# Default: true
allow-leading-space: false
# Exclude following linters from requiring an explanation.
# Default: []
allow-no-explanation: []
# Enable to require an explanation of nonzero length after each nolint directive.
# Default: false
require-explanation: false
# Enable to require nolint directives to mention the specific linter being suppressed.
# Default: false
require-specific: true
4 changes: 2 additions & 2 deletions cmd/libasciidoc/cmd_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main_test

import (
. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"testing"

Expand Down
2 changes: 1 addition & 1 deletion cmd/libasciidoc/root_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewRootCmd() *cobra.Command {
for _, sourcePath := range args {
out, close := getOut(cmd, sourcePath, outputName)
if out != nil {
defer close() // nolint errcheck
defer close() //nolint:errcheck
// log.Debugf("Starting to process file %v", path)
config := configuration.NewConfiguration(
configuration.WithFilename(sourcePath),
Expand Down
4 changes: 2 additions & 2 deletions cmd/libasciidoc/root_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

main "github.com/bytesparadise/libasciidoc/cmd/libasciidoc"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("root cmd", func() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/libasciidoc/version_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

main "github.com/bytesparadise/libasciidoc/cmd/libasciidoc"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("version cmd", func() {
Expand Down
4 changes: 2 additions & 2 deletions libasciidoc_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package libasciidoc_test
import (
"testing"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

func TestLibasciidoc(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions libasciidoc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
log "github.com/sirupsen/logrus"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/attribute_substitution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("attribute substitutions", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/attributes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
. "github.com/bytesparadise/libasciidoc/testsupport"
log "github.com/sirupsen/logrus"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("attributes", func() {
Expand Down
6 changes: 3 additions & 3 deletions pkg/parser/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (

"github.com/bytesparadise/libasciidoc/pkg/parser"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/ginkgo/v2/extensions/table" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2" //nolint:revive
. "github.com/onsi/ginkgo/v2/extensions/table" //nolint:revive
. "github.com/onsi/gomega" //nolint:revive
)

const (
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/blank_line_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("blank lines", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/check_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("checked lists", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("comments", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/cross_reference_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("cross references", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_admonition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package parser_test
import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"
. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("admonition blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("example blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_fenced_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("fenced blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_listing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
. "github.com/bytesparadise/libasciidoc/testsupport"
log "github.com/sirupsen/logrus"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("listing blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_literal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("literal blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_markdown_quote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("markdown-style quote blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_passthrough_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("passthrough blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_quote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("quote blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_sidebar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("sidebar blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("source blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_verse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("verse blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_fragment_processing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("document processing", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("headers", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_preprocessing_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/configuration"
"github.com/bytesparadise/libasciidoc/pkg/types"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("preprocessing condition stack", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_preprocessing_conditionals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/configuration"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("conditional inclusions", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_preprocessing_include_files_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
log "github.com/sirupsen/logrus"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_processing_aggregate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo/v2" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("aggregate fragments", func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/parser/document_processing_apply_substitutions.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ const (
// Callouts the "callouts" substitution
Callouts string = "callouts"
// InlinePassthroughs the "inline_passthrough" substitution
InlinePassthroughs string = "inline_passthrough" // nolint:gosec
InlinePassthroughs string = "inline_passthrough" //nolint:gosec
// Macros the "macros" substitution
Macros string = "macros"
// None the "none" substitution
Expand Down
Loading

0 comments on commit f9a3bdb

Please sign in to comment.