@@ -25,7 +25,9 @@ def tidy_html(path, html_tidy_config=None):
2525 cmd = shlex .split (f'tidy -config "{ html_tidy_config .resolve ()} " -q "{ path } "' )
2626 else :
2727 cmd = shlex .split (f'tidy -q "{ path } "' )
28- result = subprocess .run (cmd , stdout = subprocess .PIPE , stderr = subprocess .STDOUT , text = True )
28+ result = subprocess .run (
29+ cmd , stdout = subprocess .PIPE , stderr = subprocess .STDOUT , text = True
30+ )
2931 if result .returncode == 1 :
3032 print (result .stdout )
3133 return 1
@@ -61,9 +63,7 @@ def tidy_dir(path, level=0, prefix="", html_tidy_config=None):
6163 }
6264
6365 items = [path / name for name in path .iterdir ()]
64- files = sorted (
65- [path for path in items if path .is_file () and tidyable_file (path )]
66- )
66+ files = sorted ([path for path in items if path .is_file () and tidyable_file (path )])
6767 dirs = sorted ([path for path in items if path .is_dir ()])
6868
6969 for filename in [path .name for path in files ]:
@@ -95,7 +95,9 @@ def tidy_dir(path, level=0, prefix="", html_tidy_config=None):
9595def main ():
9696 parser = argparse .ArgumentParser ()
9797 parser .add_argument ("path" , type = Path , help = "Path to directory to tidy" )
98- parser .add_argument ("--html-tidy-config" , type = Path , help = "Path to tidy config file" )
98+ parser .add_argument (
99+ "--html-tidy-config" , type = Path , help = "Path to tidy config file"
100+ )
99101 args = parser .parse_args ()
100102
101103 result = tidy_dir (args .path , html_tidy_config = args .html_tidy_config )
0 commit comments