From 47f6504dc898ebb8110e6e0f9a1aff3899d5b1a3 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 18 May 2022 11:08:47 -0700 Subject: [PATCH] Add diff-suppression-keys-with-docs script back (#6046) * Add diff-suppression-keys-with-docs script back * feedback --- .../diff-suppression-keys-with-docs.sh | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/scripts/diff-suppression-keys-with-docs.sh diff --git a/.github/scripts/diff-suppression-keys-with-docs.sh b/.github/scripts/diff-suppression-keys-with-docs.sh new file mode 100644 index 0000000000..deb37984eb --- /dev/null +++ b/.github/scripts/diff-suppression-keys-with-docs.sh @@ -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 + )