mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Some packages licensed under MPL-2.0 were incorrectly importing code from packages licensed under BUSL-1.1. Not all imports are fixed here as they will require additional work to untangle them. To help track progress this commit adds a Semgrep rule that detects incorrect BUSL-1.1 imports in MPL-2.0 packages.
55 lines
1.6 KiB
YAML
55 lines
1.6 KiB
YAML
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
rules:
|
|
- id: "mpl_busl"
|
|
patterns:
|
|
- pattern-either:
|
|
- pattern-inside: |
|
|
...
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
...
|
|
package $A
|
|
...
|
|
import (
|
|
...
|
|
...
|
|
)
|
|
...
|
|
- pattern-inside: |
|
|
...
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
...
|
|
package $A
|
|
...
|
|
import ...
|
|
...
|
|
- pattern: |
|
|
"github.com/hashicorp/nomad/$...B"
|
|
- metavariable-pattern:
|
|
metavariable: $...B
|
|
patterns:
|
|
# List of MPL-2.0 packages that are allowed to be imported.
|
|
# Command to find packages:
|
|
# find . -name LICENSE ! -path '*node_modules*' | sort
|
|
- pattern-not: "api..."
|
|
- pattern-not: "demo..."
|
|
- pattern-not: "drivers/shared..."
|
|
- pattern-not: "helper/crypto..."
|
|
- pattern-not: "helper/grpc-middleware..."
|
|
- pattern-not: "helper/pluginutils/grpcutils..."
|
|
- pattern-not: "helper/pluginutils/hclspecutils..."
|
|
- pattern-not: "helper/pointer..."
|
|
- pattern-not: "helper/testlog..."
|
|
- pattern-not: "helper/uuid..."
|
|
- pattern-not: "jobspec..."
|
|
- pattern-not: "jobspec2..."
|
|
- pattern-not: "plugins..."
|
|
message: "BUSL package `github.com/hashicorp/nomad/$...B` imported in MPL package `$A`"
|
|
languages:
|
|
- "generic"
|
|
paths:
|
|
exclude:
|
|
- "*_test.go"
|
|
severity: "ERROR"
|