Skip to content

Commit

Permalink
.golangci.yml- Disallow OSS -> x-pack dependencies
Browse files Browse the repository at this point in the history
According to LICENSE.txt, the Beats project uses both Apache 2.0 (OSS)
and Elastic licenses. The OSS code may not depend on the Elastic
License code otherwise the OSS-only binaries become tainted.

This makes golangci-lint emit warnings for OSS code that depends on
x-pack code.

Closes elastic#38719
  • Loading branch information
andrewkroh committed Apr 3, 2024
1 parent aaa4829 commit 3980134
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,19 @@ linters:
- wastedassign # wastedassign finds wasted assignment statements.
- gomodguard # check for blocked dependencies
- prealloc # Finds slice declarations that could potentially be pre-allocated
- depguard

# all available settings of specific linters
linters-settings:
depguard:
rules:
apache-licensed-code:
list-mode: lax
files:
- '!**/x-pack/**/*.go'
deny:
- pkg: github.com/elastic/beats/v7/x-pack
desc: Apache 2.0 licensed code cannot depend on Elastic licensed code (x-pack/).
errcheck:
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
check-type-assertions: false
Expand Down

0 comments on commit 3980134

Please sign in to comment.