Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Fixing the import alias leaves orphaned symbols #6

Open
jpeach opened this issue Jan 3, 2021 · 0 comments · May be fixed by #13
Open

Fixing the import alias leaves orphaned symbols #6

jpeach opened this issue Jan 3, 2021 · 0 comments · May be fixed by #13
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@jpeach
Copy link
Contributor

jpeach commented Jan 3, 2021

After running with the -fix option, the linter rewrites the import paths,

diff --git internal/k8s/log.go internal/k8s/log.go
index 8a6974fc..73899219 100644
--- internal/k8s/log.go
+++ internal/k8s/log.go
@@ -24,7 +24,7 @@ import (
        "strings"

        "github.com/sirupsen/logrus"
-       klog "k8s.io/klog/v2"
+       klog_v2 "k8s.io/klog/v2"
 )

 type klogParams struct {

But all the symbols that are used from that package are still using the old import path. It's left to the maintainer to update each file that gets it import paths fixed.

This is OK for the CI use case since the goal there is to give automated style feedback to contributors (it's not too onerous for them to fix it by hand). It's a bit more onerous to get the existing codebase up to standard, but that's a one time cost.

So we could rewrite all the symbols, but if it's a lot of extra AST work, it might not be worth the effort.

@jpeach jpeach added kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature. and removed kind/bug Categorizes issue or PR as related to a bug. labels Jan 3, 2021
Glyphack added a commit to Glyphack/lint that referenced this issue Apr 25, 2021
Resolves: projectcontour#6

Signed-off-by: Shayegan Hooshyari <sh.hooshyari@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant