Skip to content

Commit

Permalink
Add line-length & skip-string-normalization args
Browse files Browse the repository at this point in the history
`black` supports the the command line arguments `--line-length` (-l) and
`--skip-string-normalization` (-S), and can be invoked through the
`black.FileMode` class

As such, add arg parse support for `darker` for `--line-length` and
`--skip-string-normalization` to pass into `black.FileMode`

Set the default values of the args to their `black` defaults, ensuring
that they are not required arguments to run `darker`
  • Loading branch information
CorreyL committed May 7, 2020
1 parent 6059676 commit d7e1de8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/darker/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,20 @@ def parse_command_line(argv: List[str]) -> Namespace:
parser.add_argument(
"--version", action="store_true", help="Show the version of `darker`"
)
parser.add_argument(
"-S",
"--skip-string-normalization",
action="store_true",
dest="skip_string_normalization",
default=False,
help="Sets the `--skip-string-normalization` flag for `black`",
)
parser.add_argument(
"-l",
"--line-length",
type=int,
dest="line_length",
default=88,
help="Sets the `--line-length` argument for `black`",
)
return parser.parse_args(argv)

0 comments on commit d7e1de8

Please sign in to comment.