Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(themelint): add diff for git gutter #5037

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).unwrap_or_else(|_| panic!("Failed to parse: {}", file));

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