From c3e0a6f0a9391aa5e934fb133f4c0883c9c51ef0 Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Fri, 13 Dec 2024 21:56:33 +0100 Subject: [PATCH 1/2] importas: document the feature of using empty alias --- .golangci.next.reference.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.golangci.next.reference.yml b/.golangci.next.reference.yml index c9741a326765..90318931df4e 100644 --- a/.golangci.next.reference.yml +++ b/.golangci.next.reference.yml @@ -1998,6 +1998,12 @@ linters-settings: # see https://github.com/julz/importas#use-regular-expression for details - pkg: knative.dev/serving/pkg/apis/(\w+)/(v[\w\d]+) alias: $1$2 + # Here the `errors` and `fmt` packages will be enforced to have no aliases. + # The linter allows multiple packages for empty alias + - pkg: errors + alias: "" + - pkg: fmt + alias: "" inamedparam: # Skips check for interface methods with only a single parameter. From 65bee38bb80fb893a9c3d3c3b8af8a5ea2161b75 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 14 Dec 2024 00:42:12 +0100 Subject: [PATCH 2/2] review --- .golangci.next.reference.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.golangci.next.reference.yml b/.golangci.next.reference.yml index 90318931df4e..991538600ef5 100644 --- a/.golangci.next.reference.yml +++ b/.golangci.next.reference.yml @@ -1998,12 +1998,11 @@ linters-settings: # see https://github.com/julz/importas#use-regular-expression for details - pkg: knative.dev/serving/pkg/apis/(\w+)/(v[\w\d]+) alias: $1$2 - # Here the `errors` and `fmt` packages will be enforced to have no aliases. - # The linter allows multiple packages for empty alias + # An explicit empty alias can be used to ensure no aliases are used for a package. + # This can be useful if `no-extra-aliases: true` doesn't fit your need. + # Multiple packages can use an empty alias. - pkg: errors alias: "" - - pkg: fmt - alias: "" inamedparam: # Skips check for interface methods with only a single parameter.