fix(lint): build errors with Report::msg, not the eyre! macro the workspace bans

The ban (`just lint`, and now the hygiene job) came from the macOS and KDE repositories and was
never applied to the Windows code, so the unified tree had sixteen uses of the macro: seven in
the Windows daemon, six in komorebi-core (written during the unification), one in the KDE
backend and two in the recorder. Each becomes eyre::Report::msg, with format! where the message
has arguments.
This commit is contained in:
LGUG2Z committed 2026-11-05 16:13:37 -08:00
1 parent 416cda802d
commit 658827fcd5
10 files changed
+27 -19

No files matched your search

+3 -3
View File
@@ -201,12 +201,12 @@ pub trait WorkspacePlatform: Sized + Clone + std::fmt::Debug + PartialEq + 'stat
/// Puts the monocle window on the work area it is given.
fn place_monocle(_window: &mut Self::Window, _rect: &Rect) -> eyre::Result<()> {
Err(eyre::eyre!("this platform has no shared update"))
Err(eyre::Report::msg("this platform has no shared update"))
}
/// Lays the maximized window out: the platform's own maximize.
fn maximize_in_layout(_window: &mut Self::Window) -> eyre::Result<()> {
Err(eyre::eyre!("this platform has no shared update"))
Err(eyre::Report::msg("this platform has no shared update"))
}
/// Whether the scrolling layout should learn the widths the windows really have before it is
@@ -258,7 +258,7 @@ pub trait WorkspacePlatform: Sized + Clone + std::fmt::Debug + PartialEq + 'stat
_hidden: bool,
_placement: &Placement<'_>,
) -> eyre::Result<()> {
Err(eyre::eyre!("this platform has no shared update"))
Err(eyre::Report::msg("this platform has no shared update"))
}
/// Called after every placement pass; `Pass::Again` runs one more (the Windows scrolling layout
+3 -3
View File
@@ -152,7 +152,7 @@ fn fails(operation: &str) -> bool {
fn op(line: String, key: String) -> eyre::Result<()> {
push(line);
if fails(&key) {
Err(eyre::eyre!("{key} failed"))
Err(eyre::Report::msg(format!("{key} failed")))
} else {
Ok(())
}
@@ -304,7 +304,7 @@ impl WorkspacePlatform for StubPlatform {
fn begin_update(_: &mut Workspace<Self>) -> eyre::Result<Flow> {
push("begin_update".to_string());
if fails("begin_update") {
return Err(eyre::eyre!("begin_update failed"));
return Err(eyre::Report::msg("begin_update failed"));
}
if settings(|s| s.skip_update) {
return Ok(Flow::Skip);
@@ -414,7 +414,7 @@ impl WorkspacePlatform for StubPlatform {
"end_update pass={pass} around={around_window} viewport={viewport_width}"
));
if fails("end_update") {
return Err(eyre::eyre!("end_update failed"));
return Err(eyre::Report::msg("end_update failed"));
}
Ok(settings(|s| s.passes.pop()).unwrap_or(Pass::Done))
}
+1 -1
View File
@@ -850,7 +850,7 @@ impl komorebi_backend::Backend for KWinBackend {
fn monitors(&self) -> komorebi_backend::Result<Vec<komorebi_backend::MonitorInfo>> {
let monitors = self.shared.table.lock().monitors();
if monitors.is_empty() {
return Err(platform(eyre::eyre!("KWin reported no outputs")));
return Err(platform(eyre::Report::msg("KWin reported no outputs")));
}
Ok(monitors.into_iter().map(Into::into).collect())
}
@@ -552,7 +552,9 @@ fn run_owner_loop(cmd_rx: crossbeam_channel::Receiver<GhostCmd>) {
}) => {
let result = match host.as_mut() {
Some(host) => host.register(&snapshot, start_rect, clip),
None => Err(eyre::eyre!("the ghost host window could not be created")),
None => Err(eyre::Report::msg(
"the ghost host window could not be created",
)),
};
let _ = reply.send(result);
}
@@ -687,7 +689,7 @@ impl GhostWindow {
clip,
reply: reply_tx,
})
.map_err(|e| eyre::eyre!("ghost owner channel send failed: {e}"))?;
.map_err(|e| eyre::Report::msg(format!("ghost owner channel send failed: {e}")))?;
let Registered {
hthumb,
origin,
@@ -789,7 +791,7 @@ impl GhostWindow {
.send(GhostCmd::Destroy {
hthumb: self.hthumb,
})
.map_err(|e| eyre::eyre!("ghost owner channel send failed: {e}"))
.map_err(|e| eyre::Report::msg(format!("ghost owner channel send failed: {e}")))
}
}
@@ -414,9 +414,12 @@ impl GhostDispatcher {
/// Wait for the resize started by `start_resize` to be done
fn finish_resize(&self) -> eyre::Result<()> {
match self.resize.lock().take() {
Some(resize) => resize
.join()
.unwrap_or_else(|_| Err(eyre::eyre!("the resize of hwnd {} panicked", self.hwnd))),
Some(resize) => resize.join().unwrap_or_else(|_| {
Err(eyre::Report::msg(format!(
"the resize of hwnd {} panicked",
self.hwnd
)))
}),
None => Ok(()),
}
}
@@ -325,7 +325,9 @@ fn render(hwnd: isize) -> eyre::Result<Rendered> {
if printed.as_bool() {
Ok(rendered)
} else {
Err(eyre::eyre!("hwnd {hwnd} would not render itself"))
Err(eyre::Report::msg(format!(
"hwnd {hwnd} would not render itself"
)))
}
})();
+1 -1
View File
@@ -946,7 +946,7 @@ impl WindowManager {
let _snapping = Snapping::new(true);
self.focused_monitor_mut()
.ok_or_else(|| eyre::eyre!("there is no monitor"))
.ok_or_else(|| eyre::Report::msg("there is no monitor"))
.and_then(|monitor| monitor.update_focused_workspace(monitor_offset))
}
@@ -155,8 +155,8 @@ where
};
if !errors.is_empty() {
return Err(color_eyre::eyre::eyre!(
"could not successfully enumerate all displays"
return Err(color_eyre::eyre::Report::msg(
"could not successfully enumerate all displays",
));
}
@@ -127,7 +127,8 @@ fn reconfigure() -> eyre::Result<()> {
///
/// Returns an error when the file cannot be read or written, or KWin cannot be asked.
pub fn ensure() -> eyre::Result<()> {
let path = rules_path().ok_or_else(|| eyre::eyre!("there is no configuration directory"))?;
let path =
rules_path().ok_or_else(|| eyre::Report::msg("there is no configuration directory"))?;
let text = match std::fs::read_to_string(&path) {
Ok(text) => text,
Err(error) if error.kind() == std::io::ErrorKind::NotFound => String::new(),
+1 -1
View File
@@ -671,7 +671,7 @@ impl ViewerApp {
Ok(outcome) => outcome,
Err(crossbeam_channel::TryRecvError::Empty) => continue,
Err(crossbeam_channel::TryRecvError::Disconnected) => {
Err(eyre::eyre!("the thread reading the session stopped"))
Err(eyre::Report::msg("the thread reading the session stopped"))
}
};
self.tabs[index] = match outcome.and_then(|loaded| self.build_open(loaded)) {