Skip to content

Commit

Permalink
fix(themelint): add diff for git gutter ref helix-editor#4972
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderBrevig committed Dec 7, 2022
1 parent 96ff64a commit d2146df
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion xtask/src/themelint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ fn get_rules() -> Vec<Require> {
// Check for visible cursor
Require::Existence(Rule::has_bg("ui.cursor.primary")),
Require::Existence(Rule::has_either("ui.cursor.match")),
// Check for git gutter
Require::Existence(Rule::has_fg("diff.plus")),
Require::Existence(Rule::has_fg("diff.minus")),
Require::Existence(Rule::has_fg("diff.delta")),
Require::Difference("diff.plus", "diff.minus"),
Require::Difference("diff.plus", "diff.delta"),
]
}

Expand Down Expand Up @@ -157,7 +163,8 @@ pub fn lint(file: String) -> Result<(), DynError> {
}
let path = path::themes().join(file.clone() + ".toml");
let theme = std::fs::read(&path).unwrap();
let theme: Theme = toml::from_slice(&theme).expect("Failed to parse theme");
let theme: Theme =
toml::from_slice(&theme).expect(format!("Failed to parse: {}", file).as_str());

let mut messages: Vec<String> = vec![];
get_rules().iter().for_each(|lint| match lint {
Expand Down

0 comments on commit d2146df

Please sign in to comment.