Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 50 additions & 65 deletions .github/linters/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,62 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
#########################
#########################
## Golang Linter rules ##
#########################
#########################

# configure golangci-lint
# see https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
run:
timeout: 60m
issues:
exclude-dirs:
- gnmi/oc
- integration_tests # Loading ondatra is very slow
exclude:
exclude-rules:
- path: _test\.go
linters:
- dupl
- gosec
- goconst
- path: gribi/gribi.go
text: "grpc.Dial is deprecated" # TODO(https://github.com/openconfig/lemming/issues/433): bgp/tests/local_tests -- TestRoutePropagation fails.
version: "2"
linters:
disable-all: true
default: none
enable:
- gosec
- unconvert
- goconst
- goimports
- gofmt
- gocritic
- gosec
- govet
- revive
- staticcheck
- unconvert
- unused
- wastedassign
- whitespace
linters-settings:
errcheck:
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: true
govet:
# report about shadowed variables
check-shadowing: false
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
gocritic:
disabled-checks:
- singleCaseSwitch
- appendAssign
gosec:
excludes:
- G204
- G115
revive:
settings:
errcheck:
check-blank: true
gocritic:
disabled-checks:
- singleCaseSwitch
- appendAssign
gosec:
excludes:
- G204
- G115
revive:
rules:
- name: unused-parameter
disabled: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- name: unused-parameter
disabled: true
- linters:
- dupl
- goconst
- gosec
path: _test\.go
- path: gribi/gribi.go
text: grpc.Dial is deprecated
paths:
- gnmi/oc
- integration_tests
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- gnmi/oc
- integration_tests
- third_party$
- builtin$
- examples$
4 changes: 4 additions & 0 deletions .github/linters/.hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ignored:
- DL3008
- DL3009
- DL3015
25 changes: 3 additions & 22 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,15 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.25.6
go-version: 1.26.1
cache: false
- uses: actions/checkout@v3
- name: Install pcap
run: |
sudo apt-get install libpcap-dev libnl-genl-3-dev libnl-3-dev
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
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: latest

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

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0
args: "--out-${NO_FUTURE}format colored-line-number"

# 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
only-new-issues: true
1 change: 0 additions & 1 deletion .golangci.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile.lemming
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/golang:1.23-bookworm AS build
FROM docker.io/golang:1.26-bookworm AS build
WORKDIR /build
COPY go.* ./
RUN go mod download
Expand All @@ -22,4 +22,4 @@ COPY --from=debug-build /go/bin/dlv /dlv/dlv
FROM docker.io/debian:bookworm as release
RUN apt-get update && apt-get install -y libpcap-dev ca-certificates
COPY --from=release-build /out/lemming /lemming/lemming
COPY --from=release-build /build/THIRD_PARTY_LICENSES /lemming/THIRD_PARTY
COPY --from=release-build /build/THIRD_PARTY_LICENSES /lemming/THIRD_PARTY
2 changes: 1 addition & 1 deletion Dockerfile.operator
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM docker.io/golang:1.23-bookworm as builder
FROM docker.io/golang:1.26-bookworm as builder
ARG license=true

WORKDIR /workspace
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ python.toolchain(
######### Golang ####################
######################################
go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.24.2")
go_sdk.download(version = "1.26.1")

go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_work = "//:go.work")
Expand Down
154 changes: 50 additions & 104 deletions dataplane/proto/packetio/packetio.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading