Skip to content

Commit

Permalink
Update code linter job (#117)
Browse files Browse the repository at this point in the history
* Update code linter job

* Update lint config URI

* Fix lint issues for godox
  • Loading branch information
marcobebway authored Feb 8, 2024
1 parent 36b77d4 commit c0c58e7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 47 deletions.
59 changes: 15 additions & 44 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,19 @@
name: golangci-lint
name: Lint Go code

on:
push:
tags:
- v*
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.55
args: --timeout=5m

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0
- "main"
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true then the all caching functionality will be complete disabled,
# takes precedence over all other caching options.
# skip-cache: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
jobs:
code-linter:
name: "Run golangci-lint"
uses: kyma-project/eventing-tools/.github/workflows/lint-go-reusable.yml@main
with:
go-version: '1.21'
lint-config-uri: https://raw.githubusercontent.com/kyma-project/eventing-tools/83087ca8c46e23c653dbeecffe695a5d8e350acb/config/lint/.golangci.yaml
3 changes: 0 additions & 3 deletions controllers/eventingauth_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ func NewEventingAuthReconciler(c kpkgclient.Client, s *runtime.Scheme) ManagedRe
}
}

// TODO: Check if conditions are correctly represented
// +kubebuilder:rbac:groups=operator.kyma-project.io,resources=eventingauths,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=operator.kyma-project.io,resources=eventingauths/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=operator.kyma-project.io,resources=eventingauths/finalizers,verbs=update
Expand Down Expand Up @@ -113,8 +112,6 @@ func (r *eventingAuthReconciler) handleApplicationSecret(ctx context.Context, lo
return kcontrollerruntime.Result{}, nil
}

// TODO: check if secret creation condition is also true, otherwise it never updates false secret ready condition

iasApplication, appExists := r.existingIasApplications[cr.Name]
if !appExists {
var createAppErr error
Expand Down

0 comments on commit c0c58e7

Please sign in to comment.