diff --git a/.github/workflows/build.yaml b/.github/workflows/check.yaml similarity index 71% rename from .github/workflows/build.yaml rename to .github/workflows/check.yaml index 29ad7fa..958fd3c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/check.yaml @@ -1,4 +1,4 @@ -name: Build +name: Check on: push: @@ -61,7 +61,25 @@ jobs: - name: Lint libclide run: | - cargo clippy --manifest-path libclide/Cargo.toml -- -D warnings + cargo clippy -p libclide -- -D warnings - name: Lint clide run: | 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 diff --git a/Cargo.toml b/Cargo.toml index eb1c68d..4f199da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,3 +23,9 @@ libclide = { path = "./libclide" } [build-dependencies] # 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"] } + +[workspace] +members = [ + ".", + "libclide", +] \ No newline at end of file diff --git a/libclide/src/fs/entry_meta.rs b/libclide/src/fs/entry_meta.rs index 8785710..4d896d4 100644 --- a/libclide/src/fs/entry_meta.rs +++ b/libclide/src/fs/entry_meta.rs @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GNU General Public License v3.0 or later -use std::path::{Path, PathBuf}; use anyhow::{Context, Result}; +use std::path::{Path, PathBuf}; #[derive(Debug)] pub struct EntryMeta { diff --git a/src/tui/editor.rs b/src/tui/editor.rs index 294e8bd..99c07b6 100644 --- a/src/tui/editor.rs +++ b/src/tui/editor.rs @@ -116,7 +116,7 @@ impl Component for Editor { if let Some(key_event) = event.as_key_event() { // Handle events here that should not be passed on to the vim emulation handler. 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);