add black as a formatter and format stuff with it
parent
80655a109f
commit
72b581f474
|
@ -146,6 +146,24 @@ in {
|
|||
option = ".*.hs";
|
||||
}
|
||||
|
||||
# Python
|
||||
{
|
||||
name = "WinCreate";
|
||||
option = ".*.py";
|
||||
commands = ''
|
||||
evaluate-commands %sh{
|
||||
if which black > /dev/null; then
|
||||
echo 'set-option buffer formatcmd "black - --quiet --fast"'
|
||||
fi
|
||||
}
|
||||
'';
|
||||
}
|
||||
{
|
||||
commands = "format";
|
||||
name = "BufWritePre";
|
||||
option = ".*.py";
|
||||
}
|
||||
|
||||
# Indents
|
||||
{
|
||||
name = "WinCreate";
|
||||
|
|
|
@ -3,7 +3,7 @@ from __future__ import print_function, unicode_literals
|
|||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('num_chapters', type=int)
|
||||
parser.add_argument("num_chapters", type=int)
|
||||
args = parser.parse_args()
|
||||
|
||||
task_templates = [
|
||||
|
@ -12,6 +12,6 @@ task_templates = [
|
|||
"make flashcards for chapter {}",
|
||||
]
|
||||
|
||||
for i in range(1, args.num_chapters+1):
|
||||
for i in range(1, args.num_chapters + 1):
|
||||
for template in task_templates:
|
||||
print(template.format(i))
|
||||
|
|
|
@ -3,12 +3,12 @@ import sys
|
|||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--name', default=None)
|
||||
parser.add_argument("--name", default=None)
|
||||
args = parser.parse_args()
|
||||
|
||||
for line in sys.stdin.read().split('\n'):
|
||||
out = line.strip('- ').split('|')
|
||||
for line in sys.stdin.read().split("\n"):
|
||||
out = line.strip("- ").split("|")
|
||||
if args.name is not None:
|
||||
out.append(args.name)
|
||||
|
||||
print('\t'.join(out))
|
||||
print("\t".join(out))
|
||||
|
|
Reference in New Issue