From 648ef787b86c0b949052fbcb79f3fab3df210cee Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Fri, 29 Jul 2022 09:44:46 -0500 Subject: [PATCH] feat: add black formatting to linting rules --- Makefile | 3 +++ bin/welcome.py | 13 ++++++++++--- home/private_bin/executable_ssh-serve-files | 2 +- home/private_bin/executable_tools | 4 ++-- vscode/generate_install_scripts.py | 1 + 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 02719bf..9535726 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ .PHONY: lint + lint: shfmt -s -w $(shell shfmt -f .) + black $(shell find -type f -name "*.py") + diff --git a/bin/welcome.py b/bin/welcome.py index 8dde2be..4ef364b 100755 --- a/bin/welcome.py +++ b/bin/welcome.py @@ -48,15 +48,17 @@ def dots(): console.print(Text(" ").join([Text("●", style=color) for color in colors[:8]])) + def double_dots(): """ - ● ● ● ● ● ● ● ● + ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● """ - + console.print(Text(" ").join([Text("●", style=color) for color in colors[:8]])) console.print(Text(" ").join([Text("●", style=color) for color in colors[8:]])) + def wave_w_dots(): """ Alternating colors from red to white with @@ -80,7 +82,12 @@ def wave_w_dots(): def main(): - prompts = {"wave": wave, "dots": dots,'double-dots':double_dots, "wave-dots": wave_w_dots} + prompts = { + "wave": wave, + "dots": dots, + "double-dots": double_dots, + "wave-dots": wave_w_dots, + } parser = argparse.ArgumentParser( description="generate ansi color coded login prompts" ) diff --git a/home/private_bin/executable_ssh-serve-files b/home/private_bin/executable_ssh-serve-files index fa3f1c4..a7fa846 100644 --- a/home/private_bin/executable_ssh-serve-files +++ b/home/private_bin/executable_ssh-serve-files @@ -58,7 +58,7 @@ echo "serving directory:" echo "->>$DIR" echo "opening $URL using $BROWSER" -$BROWSER $URL > /dev/null 2>&1 & +$BROWSER $URL >/dev/null 2>&1 & # first change directory in case python<3.7 ssh -tL localhost:$PORT:localhost:$PORT $USER_HOST \ diff --git a/home/private_bin/executable_tools b/home/private_bin/executable_tools index fd8b5b4..accf78a 100644 --- a/home/private_bin/executable_tools +++ b/home/private_bin/executable_tools @@ -40,14 +40,14 @@ eget_tool() { file=$(key=$tool yq e 'explode(.) | .[env(key)].file // ""' $YAMLDOC) to=$(key=$tool yq e 'explode(.) | .[env(key)].to // ""' $YAMLDOC) download_only=$(key=$tool yq e 'explode(.) | .[env(key)].download-only // ""' $YAMLDOC) - custom_flags=$(key=$tool yq e 'explode(.) | .[env(key)].custom_flags // ""' $YAMLDOC) + custom_flags=$(key=$tool yq e 'explode(.) | .[env(key)].custom_flags // ""' $YAMLDOC) eget $user/$tool \ ${asset:+--asset $asset} \ ${file:+--file $file} \ ${to:+--to $to} \ ${download_only:+--download-only} \ - ${custom_flags} \ + ${custom_flags} \ -q if [[ $download_only ]]; then diff --git a/vscode/generate_install_scripts.py b/vscode/generate_install_scripts.py index f0b74ec..745716d 100644 --- a/vscode/generate_install_scripts.py +++ b/vscode/generate_install_scripts.py @@ -12,6 +12,7 @@ Regenerate with generate_install_scripts.py FILE_DIR = Path(__file__).parent + def shell_script_writer(extensions_dict, filename): with Path(filename).open("w") as f: f.write("#!/bin/bash\n")