Add pre-commit-config, run pre-commit on all files

This commit is contained in:
reo 2025-09-23 21:11:09 +03:00
parent 50d07ffea5
commit 59963cdec1
8 changed files with 18 additions and 7 deletions

11
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,11 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
files: "\\.rs$"
- id: end-of-file-fixer
files: "\\.rs$"
- id: mixed-line-ending
args: [--fix=lf]
files: "\\.rs$"

View file

@ -1,4 +1,4 @@
pub mod engine; pub mod engine;
pub mod scene; pub mod scene;
pub mod debug_ui; pub mod debug_ui;
pub use debug_ui::*; pub use debug_ui::*;

View file

@ -79,7 +79,7 @@ impl EngineTrait for Engine {
self.scene_manager.current_mut() self.scene_manager.current_mut()
} }
fn get_debug_ui_buffer(&self) -> Rc<RefCell<DebugUIBuffer>> { fn get_debug_ui_buffer(&self) -> Rc<RefCell<DebugUIBuffer>> {
self.debug_ui_buffer.clone() self.debug_ui_buffer.clone()
} }

View file

@ -1,4 +1,4 @@
pub mod engine; pub mod engine;
pub mod system; pub mod system;
pub use crate::engine::Engine; pub use crate::engine::Engine;

View file

@ -66,7 +66,7 @@ impl<E: EngineTrait<PlatformCtx = PlatformContext>> Platform<E> for GliumPlatfor
.systems .systems
.values_mut() .values_mut()
.for_each(|system| system.handle_event(&mut self.window, event.clone())); .for_each(|system| system.handle_event(&mut self.window, event.clone()));
let mut ctx2 = ctx.clone(); let mut ctx2 = ctx.clone();
ctx2.current_event = event.clone(); ctx2.current_event = event.clone();
self.engine.handle_event(ctx2); self.engine.handle_event(ctx2);

View file

@ -1,4 +1,4 @@
mod basic; mod basic;
pub mod debug_ui; pub mod debug_ui;
pub use basic::BasicMeshRenderingSystem; pub use basic::BasicMeshRenderingSystem;

View file

@ -7,4 +7,4 @@ pub struct PlatformContext {
pub asset_manager: ModelManagerRef, pub asset_manager: ModelManagerRef,
pub frame_width: f32, pub frame_width: f32,
pub frame_height: f32, pub frame_height: f32,
} }

View file

@ -4,7 +4,7 @@ pub enum PlatformEvent {
/// The platform has requested to close the app. /// The platform has requested to close the app.
CloseRequested, CloseRequested,
/// Platform event loop is about to block and wait for new /// Platform event loop is about to block and wait for new
/// new events. /// new events.
AboutToWait AboutToWait