Set up workspace, add formatting CI.

This commit is contained in:
2026-02-21 19:16:50 -05:00
parent d5671a5590
commit 8fd0bb48de
4 changed files with 28 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
name: Build name: Check
on: on:
push: push:
@@ -61,7 +61,25 @@ jobs:
- name: Lint libclide - name: Lint libclide
run: | run: |
cargo clippy --manifest-path libclide/Cargo.toml -- -D warnings cargo clippy -p libclide -- -D warnings
- name: Lint clide - name: Lint clide
run: | run: |
cargo clippy -- -D warnings cargo clippy -- -D warnings
Format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Qt
uses: ./.github/actions/setup-qt
with:
qt-version: ${{ env.QT_VERSION }}
- name: Format libclide
run: |
cargo fmt -p libclide --verbose -- --check
- name: Format clide
run: |
cargo fmt --verbose -- --check

View File

@@ -23,3 +23,9 @@ libclide = { path = "./libclide" }
[build-dependencies] [build-dependencies]
# The link_qt_object_files feature is required for statically linking Qt 6. # The link_qt_object_files feature is required for statically linking Qt 6.
cxx-qt-build = { version = "0.8.0", features = ["link_qt_object_files"] } cxx-qt-build = { version = "0.8.0", features = ["link_qt_object_files"] }
[workspace]
members = [
".",
"libclide",
]

View File

@@ -2,8 +2,8 @@
// //
// SPDX-License-Identifier: GNU General Public License v3.0 or later // SPDX-License-Identifier: GNU General Public License v3.0 or later
use std::path::{Path, PathBuf};
use anyhow::{Context, Result}; use anyhow::{Context, Result};
use std::path::{Path, PathBuf};
#[derive(Debug)] #[derive(Debug)]
pub struct EntryMeta { pub struct EntryMeta {

View File

@@ -116,7 +116,7 @@ impl Component for Editor {
if let Some(key_event) = event.as_key_event() { if let Some(key_event) = event.as_key_event() {
// Handle events here that should not be passed on to the vim emulation handler. // Handle events here that should not be passed on to the vim emulation handler.
if let Action::Handled = self.handle_key_events(key_event)? { if let Action::Handled = self.handle_key_events(key_event)? {
return Ok(Action::Handled) return Ok(Action::Handled);
} }
} }
self.event_handler.on_event(event, &mut self.state); self.event_handler.on_event(event, &mut self.state);