Skip to content

Commit

Permalink
refactor( Push out options
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Aug 8, 2019
1 parent 87015d3 commit f9a1600
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,21 +262,16 @@ fn run() -> Result<i32, failure::Error> {
let mut builder = get_logging(options.verbose.log_level());
builder.init();

let check_filenames = options.check_filenames().unwrap_or(true);
let check_files = options.check_files().unwrap_or(true);
let ignore_hex = options.ignore_hex().unwrap_or(true);
let binary = options.binary().unwrap_or(false);

let dictionary = typos::BuiltIn::new();

let parser = typos::tokens::ParserBuilder::new()
.ignore_hex(ignore_hex)
.ignore_hex(options.ignore_hex().unwrap_or(true))
.build();

let checks = typos::checks::CheckSettings::new()
.check_filenames(check_filenames)
.check_files(check_files)
.binary(binary)
.check_filenames(options.check_filenames().unwrap_or(true))
.check_files(options.check_files().unwrap_or(true))
.binary(options.binary().unwrap_or(false))
.build(&dictionary, &parser);

let mut config = config::Config::default();
Expand Down

0 comments on commit f9a1600

Please sign in to comment.