0.1.0-0-pre.11-fix.1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# file: Cargo.toml
|
# file: Cargo.toml
|
||||||
# version: 21
|
# version: 22
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
resolver = "3"
|
resolver = "3"
|
||||||
@@ -17,7 +17,7 @@ members = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.1.0-0-pre.11"
|
version = "0.1.0-0-pre.11.fix.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://git.sasedev.com/Sasedev/games"
|
repository = "https://git.sasedev.com/Sasedev/games"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// file: crates/games/game-snake-poc/src/lib.rs
|
// file: crates/games/game-snake-poc/src/lib.rs
|
||||||
// version: 1
|
// version: 2
|
||||||
|
|
||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
#![deny(unreachable_pub)]
|
#![deny(unreachable_pub)]
|
||||||
@@ -9,5 +9,7 @@
|
|||||||
|
|
||||||
mod state;
|
mod state;
|
||||||
|
|
||||||
|
/// Re-export of one Snake grid cell.
|
||||||
|
pub use self::state::SnakeCell;
|
||||||
/// Re-export of the Snake POC state.
|
/// Re-export of the Snake POC state.
|
||||||
pub use self::state::SnakeState;
|
pub use self::state::SnakeState;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// file: crates/games/game-snake-poc/src/state.rs
|
// file: crates/games/game-snake-poc/src/state.rs
|
||||||
// version: 4
|
// version: 5
|
||||||
|
|
||||||
const GRID_HEIGHT: i16 = 20;
|
const GRID_HEIGHT: i16 = 20;
|
||||||
const GRID_WIDTH: i16 = 12;
|
const GRID_WIDTH: i16 = 12;
|
||||||
@@ -169,7 +169,7 @@ impl SnakeState {
|
|||||||
impl engine_v1_common::EngineGame for SnakeState {
|
impl engine_v1_common::EngineGame for SnakeState {
|
||||||
fn update(&mut self, frame: engine_v1_common::EngineFrame, input: engine_v1_common::InputState) {
|
fn update(&mut self, frame: engine_v1_common::EngineFrame, input: engine_v1_common::InputState) {
|
||||||
self.apply_direction_input(input);
|
self.apply_direction_input(input);
|
||||||
if frame.index() % MOVE_EVERY_FRAMES == 0 {
|
if frame.index().is_multiple_of(MOVE_EVERY_FRAMES) {
|
||||||
self.move_once();
|
self.move_once();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
75
deltas/0.1.0/0-pre.11.fix.1.md
Normal file
75
deltas/0.1.0/0-pre.11.fix.1.md
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
<!-- file: deltas/0.1.0/0-pre.11.fix.1.md -->
|
||||||
|
<!-- version: 1 -->
|
||||||
|
|
||||||
|
# Delta 0.1.0-0-pre.11.fix.1
|
||||||
|
|
||||||
|
## Base
|
||||||
|
|
||||||
|
Base déclarée : `0.1.0-0-pre.11`, non validée.
|
||||||
|
|
||||||
|
## Échecs observés
|
||||||
|
|
||||||
|
La validation de `0-pre.11` a révélé deux défauts locaux.
|
||||||
|
|
||||||
|
### Clippy
|
||||||
|
|
||||||
|
Rust/Clippy 1.94 signale :
|
||||||
|
|
||||||
|
```text
|
||||||
|
manual implementation of `.is_multiple_of()`
|
||||||
|
```
|
||||||
|
|
||||||
|
Le code :
|
||||||
|
|
||||||
|
```text
|
||||||
|
frame.index() % MOVE_EVERY_FRAMES == 0
|
||||||
|
```
|
||||||
|
|
||||||
|
est remplacé par :
|
||||||
|
|
||||||
|
```text
|
||||||
|
frame.index().is_multiple_of(MOVE_EVERY_FRAMES)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Façade du crate Snake
|
||||||
|
|
||||||
|
`SnakeCell` est public dans `state.rs`, mais n'était pas réexporté par `lib.rs`.
|
||||||
|
|
||||||
|
Les tests accèdent légitimement à `crate::SnakeCell`; le type doit donc être exposé par la façade du crate conformément aux règles du workspace.
|
||||||
|
|
||||||
|
`lib.rs` réexporte désormais :
|
||||||
|
|
||||||
|
```text
|
||||||
|
SnakeCell
|
||||||
|
SnakeState
|
||||||
|
```
|
||||||
|
|
||||||
|
## Validation à exécuter
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cargo fmt --all
|
||||||
|
cargo fmt --all -- --check
|
||||||
|
|
||||||
|
python3 scripts/audit_rust_workspace_rules.py
|
||||||
|
python3 scripts/audit_markdown_tables.py README.md RULES.md ROADMAP.md CHANGELOG.md docs prompts crates Android deltas history
|
||||||
|
|
||||||
|
cargo check --workspace
|
||||||
|
cargo clippy --workspace --all-targets --all-features -- -D warnings
|
||||||
|
|
||||||
|
cargo test -p engine-v1-sdl --all-targets --all-features
|
||||||
|
cargo test -p game-snake-poc --all-targets --all-features
|
||||||
|
```
|
||||||
|
|
||||||
|
Puis :
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cargo run -p game-snake-poc-desktop
|
||||||
|
```
|
||||||
|
|
||||||
|
Si le smoke Desktop est propre, poursuivre les validations Android prévues par `0-pre.11`.
|
||||||
|
|
||||||
|
## Transition
|
||||||
|
|
||||||
|
Si toutes les gates `0-pre.11` sont propres, `0.1.0-0-pre.11.fix.1` valide la fin de la phase `0-pre.*`.
|
||||||
|
|
||||||
|
En cas d'échec imputable au projet, produire `0.1.0-0-pre.11.fix.2`.
|
||||||
Reference in New Issue
Block a user