Add diff-suppression-keys-with-docs script back (#6046)

* Add diff-suppression-keys-with-docs script back

* feedback
This commit is contained in:
Trask Stalnaker 2022-05-18 11:08:47 -07:00 committed by GitHub
parent 089f4d48dd
commit 47f6504dc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
# this script reports some false positives, but is helpful in comparing the keys listed
# in suppressing-instrumentation.md with the keys listed in the source files
set -e -u -o pipefail
curl https://raw.githubusercontent.com/open-telemetry/opentelemetry.io/main/content/en/docs/instrumentation/java/automatic/agent-config.md > agent-config.md
comm -3 \
<(
sed -n '/----------------------/,${p;/^$/q}' agent-config.md \
| sed '1d;$d' \
| cut -d '|' -f 3 \
| tr -d ' ' \
| sort -u
) \
<(
git ls-files '*Module.java' \
| xargs grep super \
| grep -oP '(?<=super\(")[^"]+' \
| sort -u
)