diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 0000000..72db4f0 --- /dev/null +++ b/clippy.toml @@ -0,0 +1,2 @@ +allow-unwrap-in-tests = true +allow-expect-in-tests = true \ No newline at end of file diff --git a/config_scheme.json b/config_scheme.json index 63281d9..dfe26af 100644 --- a/config_scheme.json +++ b/config_scheme.json @@ -287,6 +287,19 @@ } }, "additionalProperties": false + }, + { + "description": "PDF text compare", + "type": "object", + "required": [ + "PDFText" + ], + "properties": { + "PDFText": { + "$ref": "#/definitions/HTMLCompareConfig" + } + }, + "additionalProperties": false } ], "required": [ diff --git a/src/csv/mod.rs b/src/csv/mod.rs index 964046a..f0fa904 100644 --- a/src/csv/mod.rs +++ b/src/csv/mod.rs @@ -532,8 +532,6 @@ fn guess_format_from_reader(mut input: &mut R) -> Result Result<(), csv::Error> { } #[cfg(test)] -#[allow(clippy::unwrap_used)] -#[allow(clippy::expect_used)] mod tests { use super::*; use crate::csv::{Column, Delimiters, Error}; diff --git a/src/hash.rs b/src/hash.rs index 3f7bf4a..9edec3c 100644 --- a/src/hash.rs +++ b/src/hash.rs @@ -18,11 +18,11 @@ pub enum HashFunction { /// Errors during hash checking pub enum Error { #[error("Failed to compile regex {0}")] - RegexCompilationError(#[from] regex::Error), + RegexCompilationFailed(#[from] regex::Error), #[error("Problem creating hash report {0}")] - ReportingError(#[from] report::Error), + ReportingFailure(#[from] report::Error), #[error("File access failed {0}")] - FileAccessError(#[from] FatIOError), + FileAccessProblem(#[from] FatIOError), } impl HashFunction { diff --git a/src/html.rs b/src/html.rs index b1b0765..9303a25 100644 --- a/src/html.rs +++ b/src/html.rs @@ -44,11 +44,11 @@ impl Default for HTMLCompareConfig { /// Errors during html / plain text checking pub enum Error { #[error("Failed to compile regex {0}")] - RegexCompilationError(#[from] regex::Error), + RegexCompilationFailure(#[from] regex::Error), #[error("Problem creating hash report {0}")] - ReportingError(#[from] report::Error), + ReportingProblem(#[from] report::Error), #[error("File access failed {0}")] - FileAccessError(#[from] FatIOError), + FileAccessFailure(#[from] FatIOError), } pub fn compare_files>( diff --git a/src/lib.rs b/src/lib.rs index 0d0f672..09b5bdd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -263,8 +263,6 @@ pub fn get_schema() -> Result { } #[cfg(test)] -#[allow(clippy::unwrap_used)] -#[allow(clippy::expect_used)] mod tests { use super::*; use crate::image::ImageCompareConfig; diff --git a/src/pdf.rs b/src/pdf.rs index abddcde..6029804 100644 --- a/src/pdf.rs +++ b/src/pdf.rs @@ -11,11 +11,11 @@ use vg_errortools::FatIOError; /// Errors during html / plain text checking pub enum Error { #[error("Failed to compile regex {0}")] - RegexCompilationError(#[from] regex::Error), + RegexCompilationFailure(#[from] regex::Error), #[error("Problem creating hash report {0}")] - ReportingError(#[from] report::Error), + ReportingFailure(#[from] report::Error), #[error("File access failed {0}")] - FileAccessError(#[from] FatIOError), + FileAccessProblem(#[from] FatIOError), #[error("PDF text extraction error {0}")] PdfTextExtractionFailed(#[from] pdf_extract::OutputError), }