diff-suppression-keys-with-docs.sh 739 B

123456789101112131415161718192021222324
  1. #!/bin/bash -e
  2. # this script reports some false positives, but is helpful in comparing the keys listed
  3. # in suppressing-instrumentation.md with the keys listed in the source files
  4. set -e -u -o pipefail
  5. curl https://raw.githubusercontent.com/open-telemetry/opentelemetry.io/main/content/en/docs/instrumentation/java/automatic/agent-config.md > agent-config.md
  6. comm -3 \
  7. <(
  8. # shellcheck disable=SC2016 # "Expressions don't expand in single quotes"
  9. sed -n '/----------------------/,${p;/^$/q}' agent-config.md \
  10. | sed '1d;$d' \
  11. | cut -d '|' -f 3 \
  12. | tr -d ' ' \
  13. | sort -u
  14. ) \
  15. <(
  16. git ls-files '*Module.java' \
  17. | xargs grep super \
  18. | grep -oP '(?<=super\(")[^"]+' \
  19. | sort -u
  20. )