mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Some manual .format() -> f-strings
This commit is contained in:
parent
aefbe71765
commit
9000e9dd41
27 changed files with 133 additions and 173 deletions
|
|
@ -1,13 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
for i in range(6):
|
||||
f = sys.stdout if i % 2 == 0 else sys.stderr
|
||||
f.write(f'{i}\n')
|
||||
f.flush()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
exit(main())
|
||||
#!/usr/bin/env bash
|
||||
echo 0
|
||||
echo 1 1>&2
|
||||
echo 2
|
||||
echo 3 1>&2
|
||||
echo 4
|
||||
echo 5 1>&2
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
#!/usr/bin/env python
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
print('stdin: {}'.format(sys.stdin.isatty()))
|
||||
print('stdout: {}'.format(sys.stdout.isatty()))
|
||||
print('stderr: {}'.format(sys.stderr.isatty()))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
exit(main())
|
||||
#!/usr/bin/env bash
|
||||
t() {
|
||||
if [ -t "$1" ]; then
|
||||
echo "$2: True"
|
||||
else
|
||||
echo "$2: False"
|
||||
fi
|
||||
}
|
||||
t 0 stdin
|
||||
t 1 stdout
|
||||
t 2 stderr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue