Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #218 do not add - to sys.argv #219

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions yamlfixer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +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. "
"If no file is specified, then reads input from `stdin`.",
Expand Down