File: autoformat_file

package info (click to toggle)
ipython 7.20.0-1%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 11,100 kB
  • sloc: python: 36,813; sh: 379; makefile: 243
file content (46 lines) | stat: -rwxr-xr-x 934 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/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"