summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-05-21 16:31:36 +0100
committerLars Wirzenius <liw@liw.fi>2020-05-24 19:03:40 +0300
commite889ebdef94434109e63847e39d0c979569c44c0 (patch)
treea597852b99eba92d40e996646ce47e251a4f5917 /src/error.rs
parent5683a8e252f47b45db9cc5d94c5284ff0f4b6fd5 (diff)
downloadsubplot-e889ebdef94434109e63847e39d0c979569c44c0.tar.gz
feat: Add linting for add-newline attribute
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index 60c850e..0057f37 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -126,6 +126,20 @@ pub enum SubplotError {
#[error("Duplicate embedded file name: {0}")]
DuplicateEmbeddedFilename(String),
+ /// Embedded file has more than one `add-newline` attribute
+ ///
+ /// The `add-newline` attribute can only be specified once for any given
+ /// embedded file
+ #[error("Embedded file {0} has more than one `add-newline` attribute")]
+ RepeatedAddNewlineAttribute(String),
+
+ /// Unrecognised `add-newline` attribute value on an embedded file
+ ///
+ /// The `add-newline` attribute can only take the values `auto`, `yes`,
+ /// and `no`.
+ #[error("Embedded file {0} has unrecognised `add-newline={}` - valid values are auto/yes/no")]
+ UnrecognisedAddNewline(String, String),
+
/// Couldn't determine base directory from input file name.
///
/// Subplot needs to to determine the base directory for files