Skip to content

Commit

Permalink
Add --stdin-filepath command line argument
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Apr 24, 2022
1 parent 05a0ce7 commit bc7f705
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/darker/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def add_arg(help_text: Optional[str], *name_or_flags: str, **kwargs: Any) -> Non
add_arg(hlp.REVISION, "-r", "--revision", default="HEAD", metavar="REV")
add_arg(hlp.DIFF, "--diff", action="store_true")
add_arg(hlp.STDOUT, "-d", "--stdout", action="store_true")
add_arg(hlp.STDIN_FILEPATH, "--stdin-filepath", metavar="PATH")
add_arg(hlp.CHECK, "--check", action="store_true")
add_arg(hlp.ISORT, "-i", "--isort", action="store_true")
add_arg(hlp.LINT, "-L", "--lint", action="append", metavar="CMD", default=[])
Expand Down
5 changes: 5 additions & 0 deletions src/darker/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
" `pygments` package is available, or if enabled by configuration."
)

STDIN_FILEPATH = (
"Path to the file in the Git repository that Darker will treat stdin as. Only valid"
" with `--revision=<rev1>..:WORKTREE:` (`:WORKTREE:` being the default for `rev2`)"
)

ISORT_PARTS = ["Also sort imports using the `isort` package"]
if not isort:
ISORT_PARTS.append(f". {ISORT_INSTRUCTION} to enable usage of this option.")
Expand Down

0 comments on commit bc7f705

Please sign in to comment.