Skip to content

Commit

Permalink
Remove default values for -l and -S
Browse files Browse the repository at this point in the history
The default values are now handled inside of `run_black`, since it uses
the function `read_pyproject_toml` from `black`, which will handle
setting default values if the keys are not defined in a `pyproject.toml`
file
  • Loading branch information
CorreyL committed Jun 25, 2020
1 parent 8b9c0c1 commit 0e822e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/darker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,11 @@ def main(argv: List[str] = None) -> None:
logger.error(f"{ISORT_INSTRUCTION} to use the `--isort` option.")
exit(1)

black_args = {
"line_length": args.line_length,
"skip_string_normalization": args.skip_string_normalization,
}
black_args = {}
if args.line_length:
black_args["line_length"] = args.line_length
if args.skip_string_normalization:
black_args["skip_string_normalization"] = args.skip_string_normalization

paths = {Path(p) for p in args.src}
format_edited_parts(paths, args.isort, black_args, args.config)
Expand Down
2 changes: 0 additions & 2 deletions src/darker/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,13 @@ def parse_command_line(argv: List[str]) -> Namespace:
"--skip-string-normalization",
action="store_true",
dest="skip_string_normalization",
default=False,
help="Don't normalize string quotes or prefixes",
)
parser.add_argument(
"-l",
"--line-length",
type=int,
dest="line_length",
default=88,
help="How many characters per line to allow [default: 88]",
)
return parser.parse_args(argv)

0 comments on commit 0e822e9

Please sign in to comment.