Skip to content

Instantly share code, notes, and snippets.

@patrickelectric
Created September 2, 2020 17:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrickelectric/123512d85c9ece966f74fc7e4a7f3e44 to your computer and use it in GitHub Desktop.
Save patrickelectric/123512d85c9ece966f74fc7e4a7f3e44 to your computer and use it in GitHub Desktop.
Find all pylint checks that are failing and print human friendly name for pylintrc
#!/usr/bin/env bash
keys=( $(pylint $(git ls-files '*.py') | rg '.*py:\d+:\d+: (.*):.*' -r '$1' | sort | uniq) )
msgs=( $(pylint --list-msgs | rg ":(.*) \(([A-Z]\d+)\).*" -r '$1,$2' | sort) )
for msg in "${msgs[@]}"; do
for key in "${keys[@]}"; do
if [[ $msg == *"$key" ]]; then
echo "${msg::-5}"
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment