Skip to content

Commit

Permalink
Merge pull request #48 from epage/config
Browse files Browse the repository at this point in the history
Config file support
  • Loading branch information
epage authored Aug 8, 2019
2 parents 750005e + 6fc6196 commit ce4a741
Show file tree
Hide file tree
Showing 8 changed files with 560 additions and 143 deletions.
48 changes: 38 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ ignore = "0.4"
phf = { version = "0.7", features = ["unicase"] }
regex = "1.0"
lazy_static = "1.2.0"
serde = "1.0"
serde_derive = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
toml = "0.4"
itertools = "0.8"
unicase = "1.1"
bstr = "0.2"
log = "0.4"
env_logger = "0.6"
unicode-segmentation = "1.3.0"
derive_more = "0.15.0"

[dev-dependencies]
assert_fs = "0.10"
Expand Down
13 changes: 13 additions & 0 deletions src/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::report;
use crate::tokens;
use crate::Dictionary;

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CheckSettings {
check_filenames: bool,
check_files: bool,
Expand Down Expand Up @@ -58,6 +59,7 @@ impl Default for CheckSettings {
}
}

#[derive(Clone)]
pub struct Checks<'d, 'p> {
dictionary: &'d Dictionary,
parser: &'p tokens::Parser,
Expand Down Expand Up @@ -170,3 +172,14 @@ impl<'d, 'p> Checks<'d, 'p> {
Ok(typos_found)
}
}

impl std::fmt::Debug for Checks<'_, '_> {
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
fmt.debug_struct("Checks")
.field("parser", self.parser)
.field("check_filenames", &self.check_filenames)
.field("check_files", &self.check_files)
.field("binary", &self.binary)
.finish()
}
}
Loading

0 comments on commit ce4a741

Please sign in to comment.