From 6cb738094201c862c5eaf61155534d4d71246ee9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Sun, 8 Sep 2024 22:43:50 +0000 Subject: [PATCH] [pre-commit.ci lite] apply automatic fixes --- .vscode/settings.json | 2 +- .../.devcontainer/devcontainer.json | 2 +- .../.markdownlint.json | 2 +- .../.vscode/settings.json | 2 +- .../{{ cookiecutter.project_slug }}/Brewfile | 2 +- .../{{ cookiecutter.project_slug }}/LICENSE | 2 +- .../{{ cookiecutter.project_slug }}/justfile | 2 +- .../scriptTemplates/pythonScriptTemplate.py | 75 ++++++++++--------- os/git/.gitconfig | 2 +- os/mac/mackup/.mackup.cfg | 2 +- os/shell/dotfiles/.functions | 2 +- 11 files changed, 48 insertions(+), 47 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index f853b0a..8161566 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,4 @@ { "shiftleft-core.slHomePath": "/Users/evan/.shiftleft", "restructuredtext.pythonRecommendation.disabled": true -} \ No newline at end of file +} diff --git a/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/.devcontainer/devcontainer.json b/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/.devcontainer/devcontainer.json index d2621ed..76ed71f 100644 --- a/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/.devcontainer/devcontainer.json +++ b/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/.devcontainer/devcontainer.json @@ -65,4 +65,4 @@ // "shutdownAction": "none", // Uncomment the next line to run commands after the container is created. "postCreateCommand": "cat .devcontainer/bashrc.override.sh >> ~/.bashrc" -} \ No newline at end of file +} diff --git a/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/.markdownlint.json b/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/.markdownlint.json index a59de97..ad838c8 100644 --- a/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/.markdownlint.json +++ b/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/.markdownlint.json @@ -2,4 +2,4 @@ "default": true, "MD003": { "style": "atx" }, "blanks-around-headings": false -} \ No newline at end of file +} diff --git a/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/.vscode/settings.json b/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/.vscode/settings.json index 9e26dfe..0967ef4 100644 --- a/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/.vscode/settings.json +++ b/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/.vscode/settings.json @@ -1 +1 @@ -{} \ No newline at end of file +{} diff --git a/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/Brewfile b/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/Brewfile index b197f86..a5205f0 100644 --- a/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/Brewfile +++ b/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/Brewfile @@ -238,4 +238,4 @@ brew "imagemagick" # # PHP # #------------------------------------------------------------------------------ # brew "php" -# cask "hook" \ No newline at end of file +# cask "hook" diff --git a/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/LICENSE b/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/LICENSE index bdcf7fe..56feb62 100644 --- a/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/LICENSE +++ b/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/LICENSE @@ -63,4 +63,4 @@ This License shall be governed by and construed in accordance with the laws of { This License constitutes the entire agreement between you and Licensor regarding the use of the Software and supersedes all prior agreements, whether written or oral, relating to its subject matter. -{% endif %} \ No newline at end of file +{% endif %} diff --git a/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/justfile b/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/justfile index 0b42c0b..29491f9 100644 --- a/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/justfile +++ b/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/justfile @@ -14,4 +14,4 @@ test-all: build # run a specific test test TEST: build - ./test --test someVar \ No newline at end of file + ./test --test someVar diff --git a/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/scriptTemplates/pythonScriptTemplate.py b/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/scriptTemplates/pythonScriptTemplate.py index 8d88076..1e905aa 100644 --- a/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/scriptTemplates/pythonScriptTemplate.py +++ b/dev/newProjectTemplate/{{ cookiecutter.project_slug }}/scriptTemplates/pythonScriptTemplate.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -#============================================================================== +# ============================================================================== # pythonScriptTemplate.py -#============================================================================== +# ============================================================================== # Template to create new python cli scripts. # Author: Evan Harmon # Usage: python script.py --input input.txt --output output.txt --verbose @@ -17,77 +17,76 @@ # Configure logging logging.basicConfig( level=logging.INFO, - format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', - handlers=[logging.StreamHandler()] + format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", + handlers=[logging.StreamHandler()], ) logger = logging.getLogger(__name__) + def parse_args(): """ Parse command line arguments. """ parser = argparse.ArgumentParser( description="A Python CLI script", - epilog="Example: python script.py --input file.txt" + epilog="Example: python script.py --input file.txt", ) - + # Define arguments parser.add_argument( - '-i', '--input', - type=str, - required=True, - help='Path to the input file' + "-i", "--input", type=str, required=True, help="Path to the input file" ) - + parser.add_argument( - '-o', '--output', - type=str, - default='output.txt', - help='Path to the output file (default: output.txt)' + "-o", + "--output", + type=str, + default="output.txt", + help="Path to the output file (default: output.txt)", ) - + parser.add_argument( - '-v', '--verbose', - action='store_true', - help='Enable verbose mode' + "-v", "--verbose", action="store_true", help="Enable verbose mode" ) - + parser.add_argument( - '--version', - action='version', - version=f'%(prog)s {__version__}', - help='Show the script version and exit' + "--version", + action="version", + version=f"%(prog)s {__version__}", + help="Show the script version and exit", ) - + return parser.parse_args() + def validate_args(args): """ Validate command line arguments. """ # Example validation: check if the input file exists - if not args.input.endswith('.txt'): + if not args.input.endswith(".txt"): logger.error("Invalid input file. Must be a .txt file.") sys.exit(1) - + logger.info(f"Using input file: {args.input}") logger.info(f"Output will be saved to: {args.output}") + def process_file(input_path, output_path): """ Placeholder for the main file processing logic. """ try: - with open(input_path, 'r') as infile: + with open(input_path, "r") as infile: content = infile.read() - + # Example processing: just write the content to the output file - with open(output_path, 'w') as outfile: + with open(output_path, "w") as outfile: outfile.write(content) - + logger.info(f"File processed successfully. Output saved to {output_path}") - + except FileNotFoundError: logger.error(f"File {input_path} not found.") sys.exit(1) @@ -95,23 +94,25 @@ def process_file(input_path, output_path): logger.error(f"An error occurred: {str(e)}") sys.exit(1) + def main(): """ Main entry point of the script. """ args = parse_args() - + # Enable verbose mode if requested if args.verbose: logger.setLevel(logging.DEBUG) - + logger.debug("Arguments parsed successfully.") - + # Validate the arguments validate_args(args) - + # Process the file process_file(args.input, args.output) + if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/os/git/.gitconfig b/os/git/.gitconfig index 2eef34b..b21859d 100644 --- a/os/git/.gitconfig +++ b/os/git/.gitconfig @@ -43,7 +43,7 @@ autoSetupRemote = true [difftool "sourcetree"] cmd = opendiff \"$LOCAL\" \"$REMOTE\" - path = + path = [mergetool "sourcetree"] cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" trustExitCode = true diff --git a/os/mac/mackup/.mackup.cfg b/os/mac/mackup/.mackup.cfg index 1fe5697..7143ff8 100644 --- a/os/mac/mackup/.mackup.cfg +++ b/os/mac/mackup/.mackup.cfg @@ -6,4 +6,4 @@ ssh aws ansible kubectl -iterm2 \ No newline at end of file +iterm2 diff --git a/os/shell/dotfiles/.functions b/os/shell/dotfiles/.functions index 8d79134..144c6ab 100644 --- a/os/shell/dotfiles/.functions +++ b/os/shell/dotfiles/.functions @@ -37,4 +37,4 @@ seqn() { echo $((current + 1)) > "$SEQN_FILE" fi cat "$SEQN_FILE" -} \ No newline at end of file +}