Skip to content

importas: config seems to get sorted before execution #1110

@grosser

Description

@grosser

Welcome

  • Yes, I understand that the GitHub action repository is not the repository of golangci-lint itself.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Description of the problem

I'm using import amissionv1 "k8s.io/api/admissionregistration/v1/admissionregistration/v1"
and locally it does not complain, but when running CI it does
so I looks like the config is getting sorted/shuffled before execution somehow

Version of golangci-lint

v1.60.3

Version of the GitHub Action

4

Workflow file

  lint:
    name: make lint
    runs-on: [self-hosted, zendesk-stable]
    steps:
      - name: Checkout source
        uses: actions/checkout@v4
      - name: Setup Golang
        uses: actions/setup-go@v5
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v4
        with:
          version: v1.60.3
          skip-go-installation: true
          working-directory: workload-migration

Golangci-lint configuration

linters:
  disable-all: true
  enable:
    - importas
linters-settings:
  importas:
    alias:
      - pkg: k8s.io/api/admissionregistration/v1
        alias: admissionv1
      - pkg: k8s.io/api/(\w+)/(v\d+\w*)
        alias: "$1$2"

Go version

1.22.2

Code example or link to a public repository

import amissionv1 "k8s.io/api/admissionregistration/v1/admissionregistration/v1"

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions