##// END OF EJS Templates
Require pygments>=2.4.0...
Require pygments>=2.4.0 As noted in #13441, running ipython with an old version of pygments leads to problems. Ipython sends ANSI color names to pygments to color output, but these names aren't in old versions of pygments. Before: with pygments 2.3.1 and ipython 8.0.0, opening an ipython instance and running In [1]: 1 / 0 # Expect ZeroDivisionError will crash ipython as `ansiyellow` is used to highlight the error. This PR requires pygments>=2.4.0, which is when pygments changed their ANSI color names.

File last commit:

r25464:108fec78
r27425:e902466b
Show More
autoformat_file
46 lines | 934 B | text/plain | TextLexer
#!/bin/bash
set -ueo pipefail
FILE=$1
echo "will update $FILE"
echo $LINENO $?
pyupgrade --py36-plus --exit-zero-even-if-changed $FILE
echo $LINENO $?
git commit -am"Apply pyupgrade to $FILE
pyupgrade --py36-plus $FILE
To ignore those changes when using git blame see the content of
.git-blame-ignore-revs"
HASH=$(git rev-parse HEAD)
echo "$HASH # apply pyupgrade to $FILE" >> .git-blame-ignore-revs
git commit -am'Update .git-blame-ignore-revs with previous commit'
#####
black --target-version py36 $FILE
git commit -am"Apply black to $FILE
black --target-version py36 $FILE
To ignore those changes when using git blame see the content of
.git-blame-ignore-revs"
HASH=$(git rev-parse HEAD)
echo "$HASH # apply black to $FILE" >> .git-blame-ignore-revs
git commit -am'Update .git-blame-ignore-revs with previous commit'
echo
echo "Updating, reformatting and adding to .git-blame-ignore-revs successful"