tests/test-check-flake8.t
author Martin von Zweigbergk <martinvonz@google.com>
Wed, 23 Jan 2019 12:11:36 -0800
changeset 4377 c2f9de28415a
parent 3390 b3dbba6e34c9
permissions -rw-r--r--
evolve: document the "if not shouldupdate" block I missed the "not" in "if not shouldupdate: ... hg.updaterepo()" and it took a long time for me to realize it's about updating *back* to the original commit (or to its successor). Let's add a comment to maybe help the person not make the same mistake.

#require test-repo

  $ checkflake8() {
  >   if ! (which flake8 > /dev/null); then
  >     echo skipped: missing tool: flake8;
  >     exit 80;
  >   fi;
  > };
  $ checkflake8

Copied from Mercurial core (60ee2593a270)

  $ cd "`dirname "$TESTDIR"`"

run flake8 if it exists; if it doesn't, then just skip

  $ hg files -0 'set:(**.py or grep("^#!.*python")) - removed()' \
  > -X hgext3rd/evolve/thirdparty \
  > 2>/dev/null \
  > | xargs -0 flake8