diff --git a/capability_baseline.txt b/capability_baseline.txt index 3fad912..a3059fc 100644 --- a/capability_baseline.txt +++ b/capability_baseline.txt @@ -1,11 +1 @@ -github.com/pelletier/go-toml/v2: CAPABILITY_FILES, CAPABILITY_REFLECT, CAPABILITY_UNANALYZED -github.com/pelletier/go-toml/v2/cmd/gotoml-test-decoder: CAPABILITY_FILES, CAPABILITY_MODIFY_SYSTEM_STATE, CAPABILITY_REFLECT, CAPABILITY_UNANALYZED -github.com/pelletier/go-toml/v2/cmd/gotoml-test-encoder: CAPABILITY_FILES, CAPABILITY_MODIFY_SYSTEM_STATE, CAPABILITY_REFLECT, CAPABILITY_UNANALYZED -github.com/pelletier/go-toml/v2/cmd/jsontoml: CAPABILITY_FILES, CAPABILITY_REFLECT, CAPABILITY_UNANALYZED -github.com/pelletier/go-toml/v2/cmd/tomljson: CAPABILITY_FILES, CAPABILITY_REFLECT, CAPABILITY_UNANALYZED -github.com/pelletier/go-toml/v2/cmd/tomll: CAPABILITY_FILES, CAPABILITY_REFLECT, CAPABILITY_UNANALYZED -github.com/pelletier/go-toml/v2/cmd/tomltestgen: CAPABILITY_FILES, CAPABILITY_REFLECT, CAPABILITY_UNANALYZED -github.com/pelletier/go-toml/v2/internal/cli: CAPABILITY_FILES, CAPABILITY_REFLECT, CAPABILITY_UNANALYZED -github.com/pelletier/go-toml/v2/internal/testsuite: CAPABILITY_FILES, CAPABILITY_REFLECT, CAPABILITY_UNANALYZED -github.com/pelletier/go-toml/v2/internal/tracker: CAPABILITY_UNANALYZED -github.com/pelletier/go-toml/v2/ossfuzz: CAPABILITY_FILES, CAPABILITY_REFLECT, CAPABILITY_UNANALYZED +github.com/pelletier/go-toml/v2: CAPABILITY_REFLECT, CAPABILITY_UNANALYZED diff --git a/caps.sh b/caps.sh index 88b0038..2a02b6e 100755 --- a/caps.sh +++ b/caps.sh @@ -21,7 +21,7 @@ FORBIDDEN_CAPS=( ) capslock_to_baseline() { - "$CAPSLOCK" -packages=./... -output=package -granularity=package \ + "$CAPSLOCK" -packages=. -output=package -granularity=package \ | jq -r 'to_entries | sort_by(.key) | .[] | .key + ": " + (.value | sort | join(", "))' } @@ -47,7 +47,8 @@ check() { # Capslock may report CAPABILITY_UNSAFE_POINTER due to stdlib internals # (e.g. reflect -> unsafe), which is a false positive. Instead of relying # on capslock for this, we check the source directly. - unsafe_imports=$(find . -name '*.go' -not -name '*_test.go' -not -path './vendor/*' \ + unsafe_imports=$(find . -name '*.go' -not -name '*_test.go' \ + -not -path './vendor/*' -not -path './cmd/*' -not -path './internal/*' \ -exec grep -l '"unsafe"' {} +) || true if [ -n "$unsafe_imports" ]; then echo "FORBIDDEN: direct unsafe import found in:"