Skip to content

Commit

Permalink
Merge #340: AuxPoW: Add lint_diff.sh script
Browse files Browse the repository at this point in the history
083e202 Namecoin / AuxPoW: Add lint_diff.sh script (Jeremy Rand)

Pull request description:

  This script filters linter warnings to only find issues relative to upstream Electrum.

  Refs #339

Top commit has no ACKs.
  • Loading branch information
Jeremy Rand committed Aug 13, 2023
2 parents 10906cc + 083e202 commit 5070885
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions contrib/lint_diff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

set -euo pipefail
shopt -s failglob

# Prereqs:
# sudo apt install flake8
# go install -v github.com/bradleyfalzon/revgrep/cmd/revgrep@master

CURRENT_BRANCH="$(git branch --show-current)"

if echo "${CURRENT_BRANCH}" | grep auxpow > /dev/null
then
BASE_BRANCH="$(echo ${CURRENT_BRANCH} | sed s/auxpow/bitcoin/)"
else
if echo "${CURRENT_BRANCH}" | grep master > /dev/null
then
BASE_BRANCH="$(echo ${CURRENT_BRANCH} | sed s/master/auxpow/)"
else
echo "Unrecognized current branch: ${CURRENT_BRANCH}"
exit 1
fi
fi

flake8 . --select E,F,W,C90 --extend-ignore E501 --extend-exclude ./electrum_nmc/electrum/null_impl |& revgrep -regexp '\./(.*?):([0-9]+):([0-9]+)?:?\s*(.*)' "${BASE_BRANCH}" "${CURRENT_BRANCH}"

0 comments on commit 5070885

Please sign in to comment.