forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 34
Install golangci-lint from binary #363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,14 +50,31 @@ CHLOGGEN_CONFIG := .chloggen/config.yaml | |
JUNIT_OUT_DIR ?= $(TOOLS_MOD_DIR)/testresults | ||
|
||
.PHONY: install-tools | ||
install-tools: $(TOOLS_BIN_NAMES) | ||
install-tools: $(TOOLS_BIN_NAMES) $(TOOLS_BIN_DIR)/golangci-lint | ||
|
||
$(TOOLS_BIN_DIR): | ||
mkdir -p $@ | ||
|
||
$(TOOLS_BIN_NAMES): $(TOOLS_BIN_DIR) $(TOOLS_MOD_DIR)/go.mod | ||
cd $(TOOLS_MOD_DIR) && GOOS="" GOARCH="" $(GOCMD) build -o $@ -trimpath $(filter %/$(notdir $@),$(TOOLS_PKG_NAMES)) | ||
|
||
# === CWA Fork === | ||
# One of the build dependency repo's for golangci-lint no longer exists so we are unable to build golangci-lint from source | ||
# The golangci-lint maintainers ran into this problem: https://github.com/golangci/golangci-lint/issues/6017 | ||
# They have unreleased fix: https://github.com/golangci/golangci-lint/pull/6018 | ||
# Install golangci-lint by downloading the binary directly instead | ||
# We should remove this block once golangci-lint releases a fix, the fix is pulled into OTel upstream repo, and we | ||
# sync with OTel upstream | ||
$(TOOLS_BIN_DIR)/golangci-lint: $(TOOLS_BIN_DIR) | ||
@(\ | ||
flock -x 200; \ | ||
if [ ! -f $@ ]; then \ | ||
echo "Downloading golangci-lint..."; \ | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(TOOLS_BIN_DIR) v2.1.1; \ | ||
fi \ | ||
) 200>[email protected] | ||
# === CWA Fork === | ||
|
||
ADDLICENSE := $(TOOLS_BIN_DIR)/addlicense | ||
MDLINKCHECK := $(TOOLS_BIN_DIR)/markdown-link-check | ||
MISSPELL := $(TOOLS_BIN_DIR)/misspell -error | ||
|
@@ -211,7 +228,7 @@ fmt: $(GOFUMPT) $(GOIMPORTS) | |
$(GOIMPORTS) -w -local github.com/open-telemetry/opentelemetry-collector-contrib ./ | ||
|
||
.PHONY: lint | ||
lint: $(LINT) checklicense misspell | ||
lint: $(LINT) checklicense misspell | ||
$(LINT) run | ||
|
||
.PHONY: govulncheck | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ require ( | |
github.com/Khan/genqlient v0.8.0 | ||
github.com/client9/misspell v0.3.4 | ||
github.com/daixiang0/gci v0.13.6 | ||
github.com/golangci/golangci-lint/v2 v2.1.1 | ||
github.com/google/addlicense v1.1.1 | ||
github.com/jcchavezs/porto v0.6.0 | ||
github.com/jstemmer/go-junit-report v1.0.0 | ||
|
@@ -27,225 +26,69 @@ require ( | |
) | ||
|
||
require ( | ||
4d63.com/gocheckcompilerdirectives v1.3.0 // indirect | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all of these dependencies are used to build golangci? wow There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah thats kind of wild |
||
4d63.com/gochecknoglobals v0.2.2 // indirect | ||
dario.cat/mergo v1.0.0 // indirect | ||
github.com/4meepo/tagalign v1.4.2 // indirect | ||
github.com/Abirdcfly/dupword v0.1.3 // indirect | ||
github.com/Antonboom/errname v1.1.0 // indirect | ||
github.com/Antonboom/nilnil v1.1.0 // indirect | ||
github.com/Antonboom/testifylint v1.6.1 // indirect | ||
github.com/BurntSushi/toml v1.5.0 // indirect | ||
github.com/Crocmagnon/fatcontext v0.7.2 // indirect | ||
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect | ||
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 // indirect | ||
github.com/Masterminds/semver/v3 v3.3.1 // indirect | ||
github.com/Microsoft/go-winio v0.6.2 // indirect | ||
github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect | ||
github.com/ProtonMail/go-crypto v1.1.5 // indirect | ||
github.com/agnivade/levenshtein v1.1.1 // indirect | ||
github.com/alecthomas/chroma/v2 v2.16.0 // indirect | ||
github.com/alecthomas/go-check-sumtype v0.3.1 // indirect | ||
github.com/alexflint/go-arg v1.5.0 // indirect | ||
github.com/alexflint/go-scalar v1.2.0 // indirect | ||
github.com/alexkohler/nakedret/v2 v2.0.6 // indirect | ||
github.com/alexkohler/prealloc v1.0.0 // indirect | ||
github.com/alingse/asasalint v0.0.11 // indirect | ||
github.com/alingse/nilnesserr v0.2.0 // indirect | ||
github.com/ashanbrown/forbidigo v1.6.0 // indirect | ||
github.com/ashanbrown/makezero v1.2.0 // indirect | ||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect | ||
github.com/beorn7/perks v1.0.1 // indirect | ||
github.com/bitfield/gotestdox v0.2.2 // indirect | ||
github.com/bkielbasa/cyclop v1.2.3 // indirect | ||
github.com/blizzy78/varnamelen v0.8.0 // indirect | ||
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect | ||
github.com/bombsimon/wsl/v4 v4.7.0 // indirect | ||
github.com/breml/bidichk v0.3.3 // indirect | ||
github.com/breml/errchkjson v0.4.1 // indirect | ||
github.com/butuzov/ireturn v0.4.0 // indirect | ||
github.com/butuzov/mirror v1.3.0 // indirect | ||
github.com/catenacyber/perfsprint v0.9.1 // indirect | ||
github.com/ccojocar/zxcvbn-go v1.0.2 // indirect | ||
github.com/cespare/xxhash/v2 v2.3.0 // indirect | ||
github.com/charithe/durationcheck v0.0.10 // indirect | ||
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect | ||
github.com/charmbracelet/lipgloss v1.1.0 // indirect | ||
github.com/charmbracelet/x/ansi v0.8.0 // indirect | ||
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect | ||
github.com/charmbracelet/x/term v0.2.1 // indirect | ||
github.com/chavacava/garif v0.1.0 // indirect | ||
github.com/ckaznocha/intrange v0.3.1 // indirect | ||
github.com/cloudflare/circl v1.6.0 // indirect | ||
github.com/curioswitch/go-reassign v0.3.0 // indirect | ||
github.com/cyphar/filepath-securejoin v0.4.1 // indirect | ||
github.com/dave/dst v0.27.3 // indirect | ||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect | ||
github.com/denis-tingaikin/go-header v0.5.0 // indirect | ||
github.com/dlclark/regexp2 v1.11.5 // indirect | ||
github.com/dnephin/pflag v1.0.7 // indirect | ||
github.com/emirpasic/gods v1.18.1 // indirect | ||
github.com/ettle/strcase v0.2.0 // indirect | ||
github.com/fatih/color v1.18.0 // indirect | ||
github.com/fatih/structtag v1.2.0 // indirect | ||
github.com/firefart/nonamedreturns v1.0.6 // indirect | ||
github.com/fsnotify/fsnotify v1.8.0 // indirect | ||
github.com/fzipp/gocyclo v0.6.0 // indirect | ||
github.com/ghostiam/protogetter v0.3.13 // indirect | ||
github.com/go-critic/go-critic v0.13.0 // indirect | ||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect | ||
github.com/go-git/go-billy/v5 v5.6.2 // indirect | ||
github.com/go-git/go-git/v5 v5.14.0 // indirect | ||
github.com/go-logr/logr v1.4.2 // indirect | ||
github.com/go-logr/stdr v1.2.2 // indirect | ||
github.com/go-toolsmith/astcast v1.1.0 // indirect | ||
github.com/go-toolsmith/astcopy v1.1.0 // indirect | ||
github.com/go-toolsmith/astequal v1.2.0 // indirect | ||
github.com/go-toolsmith/astfmt v1.1.0 // indirect | ||
github.com/go-toolsmith/astp v1.1.0 // indirect | ||
github.com/go-toolsmith/strparse v1.1.0 // indirect | ||
github.com/go-toolsmith/typep v1.1.0 // indirect | ||
github.com/go-viper/mapstructure/v2 v2.3.0 // indirect | ||
github.com/go-xmlfmt/xmlfmt v1.1.3 // indirect | ||
github.com/gobwas/glob v0.2.3 // indirect | ||
github.com/gofrs/flock v0.12.1 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect | ||
github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect | ||
github.com/golangci/go-printf-func-name v0.1.0 // indirect | ||
github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d // indirect | ||
github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95 // indirect | ||
github.com/golangci/misspell v0.6.0 // indirect | ||
github.com/golangci/plugin-module-register v0.1.1 // indirect | ||
github.com/golangci/revgrep v0.8.0 // indirect | ||
github.com/golangci/unconvert v0.0.0-20250410112200-a129a6e6413e // indirect | ||
github.com/google/go-cmp v0.7.0 // indirect | ||
github.com/google/go-github v17.0.0+incompatible // indirect | ||
github.com/google/go-github/v66 v66.0.0 // indirect | ||
github.com/google/go-querystring v1.1.0 // indirect | ||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect | ||
github.com/google/uuid v1.6.0 // indirect | ||
github.com/gordonklaus/ineffassign v0.1.0 // indirect | ||
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect | ||
github.com/gostaticanalysis/comment v1.5.0 // indirect | ||
github.com/gostaticanalysis/forcetypeassert v0.2.0 // indirect | ||
github.com/gostaticanalysis/nilerr v0.1.1 // indirect | ||
github.com/hashicorp/go-immutable-radix/v2 v2.1.0 // indirect | ||
github.com/hashicorp/go-version v1.7.0 // indirect | ||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect | ||
github.com/hexops/gotextdiff v1.0.3 // indirect | ||
github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect | ||
github.com/jgautheron/goconst v1.8.1 // indirect | ||
github.com/jingyugao/rowserrcheck v1.1.1 // indirect | ||
github.com/jjti/go-spancheck v0.6.4 // indirect | ||
github.com/joshdk/go-junit v1.0.0 // indirect | ||
github.com/json-iterator/go v1.1.12 // indirect | ||
github.com/julz/importas v0.2.0 // indirect | ||
github.com/karamaru-alpha/copyloopvar v1.2.1 // indirect | ||
github.com/kevinburke/ssh_config v1.2.0 // indirect | ||
github.com/kisielk/errcheck v1.9.0 // indirect | ||
github.com/kkHAIKE/contextcheck v1.1.6 // indirect | ||
github.com/knadh/koanf/maps v0.1.2 // indirect | ||
github.com/knadh/koanf/parsers/yaml v0.1.0 // indirect | ||
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect | ||
github.com/knadh/koanf/providers/env v1.0.0 // indirect | ||
github.com/knadh/koanf/providers/file v1.1.2 // indirect | ||
github.com/knadh/koanf/providers/fs v0.1.0 // indirect | ||
github.com/knadh/koanf/v2 v2.1.2 // indirect | ||
github.com/kulti/thelper v0.6.3 // indirect | ||
github.com/kunwardeep/paralleltest v1.0.14 // indirect | ||
github.com/lasiar/canonicalheader v1.1.2 // indirect | ||
github.com/ldez/exptostd v0.4.2 // indirect | ||
github.com/ldez/gomoddirectives v0.6.1 // indirect | ||
github.com/ldez/grignotin v0.9.0 // indirect | ||
github.com/ldez/tagliatelle v0.7.1 // indirect | ||
github.com/ldez/usetesting v0.4.2 // indirect | ||
github.com/leonklingele/grouper v1.1.2 // indirect | ||
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect | ||
github.com/macabu/inamedparam v0.2.0 // indirect | ||
github.com/manuelarte/funcorder v0.2.1 // indirect | ||
github.com/maratori/testableexamples v1.0.0 // indirect | ||
github.com/maratori/testpackage v1.1.1 // indirect | ||
github.com/matoous/godox v1.1.0 // indirect | ||
github.com/mattn/go-colorable v0.1.14 // indirect | ||
github.com/mattn/go-isatty v0.0.20 // indirect | ||
github.com/mattn/go-runewidth v0.0.16 // indirect | ||
github.com/mgechev/revive v1.9.0 // indirect | ||
github.com/mitchellh/copystructure v1.2.0 // indirect | ||
github.com/mitchellh/go-homedir v1.1.0 // indirect | ||
github.com/mitchellh/reflectwalk v1.0.2 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.2 // indirect | ||
github.com/moricho/tparallel v0.3.2 // indirect | ||
github.com/muesli/termenv v0.16.0 // indirect | ||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect | ||
github.com/nakabonne/nestif v0.3.1 // indirect | ||
github.com/nishanths/exhaustive v0.12.0 // indirect | ||
github.com/nishanths/predeclared v0.2.2 // indirect | ||
github.com/nunnatsa/ginkgolinter v0.19.1 // indirect | ||
github.com/olekukonko/tablewriter v0.0.5 // indirect | ||
github.com/onsi/gomega v1.36.3 // indirect | ||
github.com/pelletier/go-toml/v2 v2.2.4 // indirect | ||
github.com/pjbgf/sha1cd v0.3.2 // indirect | ||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect | ||
github.com/polyfloyd/go-errorlint v1.8.0 // indirect | ||
github.com/prometheus/client_golang v1.20.3 // indirect | ||
github.com/prometheus/client_model v0.6.1 // indirect | ||
github.com/prometheus/common v0.59.1 // indirect | ||
github.com/prometheus/procfs v0.15.1 // indirect | ||
github.com/quasilyte/go-ruleguard v0.4.4 // indirect | ||
github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect | ||
github.com/quasilyte/gogrep v0.5.0 // indirect | ||
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect | ||
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect | ||
github.com/raeperd/recvcheck v0.2.0 // indirect | ||
github.com/rivo/uniseg v0.4.7 // indirect | ||
github.com/rogpeppe/go-internal v1.14.1 // indirect | ||
github.com/ryancurrah/gomodguard v1.4.1 // indirect | ||
github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect | ||
github.com/sagikazarmark/locafero v0.7.0 // indirect | ||
github.com/sanposhiho/wastedassign/v2 v2.1.0 // indirect | ||
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect | ||
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect | ||
github.com/sashamelentyev/usestdlibvars v1.28.0 // indirect | ||
github.com/securego/gosec/v2 v2.22.3 // indirect | ||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect | ||
github.com/sirupsen/logrus v1.9.3 // indirect | ||
github.com/sivchari/containedctx v1.0.3 // indirect | ||
github.com/skeema/knownhosts v1.3.1 // indirect | ||
github.com/sonatard/noctx v0.1.0 // indirect | ||
github.com/sourcegraph/conc v0.3.0 // indirect | ||
github.com/sourcegraph/go-diff v0.7.0 // indirect | ||
github.com/spf13/afero v1.14.0 // indirect | ||
github.com/spf13/cast v1.7.1 // indirect | ||
github.com/spf13/cobra v1.9.1 // indirect | ||
github.com/spf13/pflag v1.0.6 // indirect | ||
github.com/spf13/viper v1.20.0 // indirect | ||
github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect | ||
github.com/stbenjam/no-sprintf-host-port v0.2.0 // indirect | ||
github.com/stretchr/objx v0.5.2 // indirect | ||
github.com/stretchr/testify v1.10.0 // indirect | ||
github.com/subosito/gotenv v1.6.0 // indirect | ||
github.com/tdakkota/asciicheck v0.4.1 // indirect | ||
github.com/tetafro/godot v1.5.0 // indirect | ||
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 // indirect | ||
github.com/timonwong/loggercheck v0.11.0 // indirect | ||
github.com/tomarrell/wrapcheck/v2 v2.11.0 // indirect | ||
github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect | ||
github.com/ultraware/funlen v0.2.0 // indirect | ||
github.com/ultraware/whitespace v0.2.0 // indirect | ||
github.com/uudashr/gocognit v1.2.0 // indirect | ||
github.com/uudashr/iface v1.3.1 // indirect | ||
github.com/vektah/gqlparser/v2 v2.5.19 // indirect | ||
github.com/xanzy/ssh-agent v0.3.3 // indirect | ||
github.com/xen0n/gosmopolitan v1.3.0 // indirect | ||
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect | ||
github.com/yagipy/maintidx v1.0.0 // indirect | ||
github.com/yeya24/promlinter v0.3.0 // indirect | ||
github.com/ykadowak/zerologlint v0.1.5 // indirect | ||
gitlab.com/bosi/decorder v0.4.2 // indirect | ||
go-simpler.org/musttag v0.13.0 // indirect | ||
go-simpler.org/sloglint v0.11.0 // indirect | ||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect | ||
go.opentelemetry.io/build-tools v0.21.0 // indirect | ||
go.opentelemetry.io/collector/component v1.30.0 // indirect | ||
|
@@ -261,11 +104,9 @@ require ( | |
go.opentelemetry.io/otel/metric v1.35.0 // indirect | ||
go.opentelemetry.io/otel/sdk v1.35.0 // indirect | ||
go.opentelemetry.io/otel/trace v1.35.0 // indirect | ||
go.uber.org/automaxprocs v1.6.0 // indirect | ||
go.uber.org/multierr v1.11.0 // indirect | ||
go.uber.org/zap v1.27.0 // indirect | ||
golang.org/x/crypto v0.37.0 // indirect | ||
golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect | ||
golang.org/x/mod v0.24.0 // indirect | ||
golang.org/x/net v0.39.0 // indirect | ||
golang.org/x/oauth2 v0.28.0 // indirect | ||
|
@@ -280,8 +121,6 @@ require ( | |
gopkg.in/warnings.v0 v0.1.2 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
honnef.co/go/tools v0.6.1 // indirect | ||
mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4 // indirect | ||
) | ||
|
||
// openshift removed all tags from their repo, use the pseudoversion from the release-3.9 branch HEAD | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v2.1.1 was chosen as that is the version that was used in the
internal/tools/go.mod
file previously, so this will keep the linting rules consistent. Trying to use the latest version caused additional linting rules to identify linting issues.