SAP / cloud-authorization-buildpack

You can use the content of this repository to leverage the Open Policy Agent (https://www.openpolicyagent.org/) for cloud foundry environments. If offers runtime support to make calls to the open policy server from a CF application and support to manage and distribute Open Policy Agent bundles.
Apache License 2.0
5 stars 6 forks source link

Fix linting in pipeline #75

Closed johanneskra closed 11 months ago

johanneskra commented 11 months ago

Currently, the pipeline is failing in the lint step with the following log output:

run golangci-lint
  Running [/home/runner/golangci-lint-1.55.1-linux-amd64/golangci-lint run --out-format=github-actions] in [] ...
  Warning: dot-imports: should not use dot imports (revive)
  Warning: dot-imports: should not use dot imports (revive)
  Warning: dot-imports: should not use dot imports (revive)
  Error: import 'github.com/go-playground/validator/v10' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/cloudfoundry/libbuildpack' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/cloudfoundry/libbuildpack' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/cloudfoundry/libbuildpack' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/SAP/cloud-authorization-buildpack/pkg/supply/env' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/open-policy-agent/opa/download' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/open-policy-agent/opa/plugins/bundle' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/SAP/cloud-authorization-buildpack/pkg/common/services' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/SAP/cloud-authorization-buildpack/pkg/supply/env' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/SAP/cloud-authorization-buildpack/pkg/uploader' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/SAP/cloud-authorization-buildpack/pkg/supply' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/SAP/cloud-authorization-buildpack/pkg/uploader' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/SAP/cloud-authorization-buildpack/pkg/common/services' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/stretchr/testify/assert' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/SAP/cloud-authorization-buildpack/resources/testdata' is not allowed from list 'Main' (depguard)
  Error: import 'code.cloudfoundry.org/buildpackapplifecycle/buildpackrunner/resources' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/golang/mock/gomock' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/open-policy-agent/opa/config' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/open-policy-agent/opa/plugins/bundle' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/open-policy-agent/opa/plugins/rest' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/SAP/cloud-authorization-buildpack/pkg/supply/env' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/SAP/cloud-authorization-buildpack/pkg/uploader' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/SAP/cloud-authorization-buildpack/resources/testdata' is not allowed from list 'Main' (depguard)
  Error: import 'github.com/SAP/cloud-authorization-buildpack/pkg/supply' is not allowed from list 'Main' (depguard)

  Error: issues found
  Ran golangci-lint in [81](https://github.com/SAP/cloud-authorization-buildpack/actions/runs/6694959079/job/18189434385#step:4:83)167ms
johanneskra commented 11 months ago

I found the fix here: https://github.com/golangci/golangci-lint-action/issues/759