From d78825df41e10a460af74419d0cb0251528bfe5c Mon Sep 17 00:00:00 2001 From: Petr Studeny Date: Tue, 30 Jan 2024 14:25:17 +0100 Subject: [PATCH 1/2] fix: #218 do not add - to sys.argv, already added as default in filenames argument --- yamlfixer/__main__.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/yamlfixer/__main__.py b/yamlfixer/__main__.py index 0dac7f4..ec13d28 100755 --- a/yamlfixer/__main__.py +++ b/yamlfixer/__main__.py @@ -43,14 +43,6 @@ def parse_commandline(argv=None): """Parse the command line and return the parsed arguments.""" - # Ensure we read from stdin in case it's redirected - # We add some additional checks because GitHub actions don't - # provide a TTY - if ("-" not in sys.argv[1:]) \ - and not sys.stdin.isatty() \ - and not os.environ.get("GITHUB_ACTIONS") \ - and not os.environ.get("CI"): - sys.argv.append("-") # Parse the command line arguments cmdline = argparse.ArgumentParser(description="Fix formatting problems in YAML documents. " From 4e8437f294c13f0a80f5249854b9fa8a72e412ed Mon Sep 17 00:00:00 2001 From: Petr Studeny Date: Tue, 30 Jan 2024 14:43:55 +0100 Subject: [PATCH 2/2] fix: lint --- yamlfixer/__main__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/yamlfixer/__main__.py b/yamlfixer/__main__.py index ec13d28..1af3507 100755 --- a/yamlfixer/__main__.py +++ b/yamlfixer/__main__.py @@ -43,7 +43,6 @@ def parse_commandline(argv=None): """Parse the command line and return the parsed arguments.""" - # Parse the command line arguments cmdline = argparse.ArgumentParser(description="Fix formatting problems in YAML documents. " "If no file is specified, then reads input from `stdin`.",