8000 Expose `backups` opt as stdin argument by zacharyabolton · Pull Request #5 · tsloughter/erl_tidy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Expose backups opt as stdin argument #5

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions src/erl_tidy.erl
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ dir_4(File, Regexp, Env) ->

file__defaults() ->
[{backup_suffix, ?DEFAULT_BACKUP_SUFFIX},
backups,
backups,
{dir, ?DEFAULT_DIR},
{printer, default_printer()},
{quiet, false},
Expand Down Expand Up @@ -1849,19 +1849,19 @@ error_open_output(Name) ->
report_error("cannot open file `~ts' for output.", [filename(Name)]).

verbosity(Opts) ->
case proplists:get_bool(quiet, Opts) of
case proplists:get_bool(quiet, Opts) of
true -> 0;
false ->
case proplists:get_value(verbose, Opts) of
true -> 2;
N when is_integer(N) -> N;
N when is_integer(N) -> N;
_ -> 1
end
end.

report_error(D) ->
report_error(D, []).

report_error({F, L, D}, Vs) ->
report({F, L, {error, D}}, Vs);
report_error(D, Vs) ->
Expand Down
4 changes: 3 additions & 1 deletion src/erl_tidy_prv_fmt.erl
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,7 @@ fmt_opts() ->
{no_imports, undefined, "no_imports", {boolean, false},
"all import statements will be removed "
"and calls to imported functions will be expanded "
"to explicit remote calls"}
"to explicit remote calls"},
{backups, undefined, "backups", {boolean, true},
"keep backups of your original code safely stored" }
].
0