8000 Fixing the import alias leaves orphaned symbols · Issue #6 · projectcontour/lint · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jun 28, 2022. It is now read-only.
This repository was archived by the owner on Jun 28, 2022. It is now read-only.
Fixing the import alias leaves orphaned symbols #6
Open

Description

@jpeach

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0