From 6865671e12e4ec555c4af6c031eaf8709eb40f6c Mon Sep 17 00:00:00 2001 From: Brandon Barker Date: Thu, 30 Nov 2023 10:17:37 -0500 Subject: [PATCH] minor code improvement; badges; CI and dependabot --- .github/dependabot.yml | 11 ++ .github/workflows/rust.yml | 26 +++++ .history | 225 +++++++++++++++++++++++++++++++++++++ Cargo.lock | 2 +- Readme.md | 2 + src/lib.rs | 3 +- 6 files changed, 266 insertions(+), 3 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/rust.yml create mode 100644 .history diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e8d486a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "cargo" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..2c1f335 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,26 @@ +name: Rust + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Format + run: cargo fmt --check + - name: Build + run: cargo build --verbose + - name: Clippy + run: cargo clippy + - name: Run tests + run: cargo test --verbose diff --git a/.history b/.history new file mode 100644 index 0000000..0204fec --- /dev/null +++ b/.history @@ -0,0 +1,225 @@ +cargo build +cargo fmt +cargo fmt +cargo build +cargo build +cargo build +cargo clippy +cargo clippy +cargo fmt +git status +less .history +rm .history +git status +git add . +git status +git reset src/saveload_system.rs +git status +git commit -m "drafted deserialization" +git push +git status +cargo build +cargo fmt +cargo fmt +cargo clippy +cargo test +cargo test +cargo expand +cargo install cargo-expand +cargo expand +cargo expand --test +cargo expand --test test_serialization( +cargo expand --test test_serialization +cargo expand --help +cargo expand --tests +cargo expand --lib --tests +cargo expand --lib --tests > expand1.rs +cargo expand --lib --tests > expand1.rs +cargo expand --lib --tests > expand1.rs +cargo expand --lib --tests > expand1.rs +cargo build +cargo test +cargo test +cargo test +cargo test +cargo expand --lib --tests > expand1.rs +cargo expand --lib --tests > expand1.rs +cargo test +cargo build +cargo clippy +cargo clippy +cargo clippy +cargo clippy +cargo clippy +cargo test +cd .. +git clone https://github.com/rust-pretty-assertions/rust-pretty-assertions.git +cd rust-pretty-assertions/ +git checkout -b term-check +cargo test +ls +cd pretty_assertions_bench/ +ls +cat README.md +cd .. +ls +cd scripts/ +ls +cd .. +rg "mod test" +less pretty_assertions/src/printer.rs +cargo test +less ../bevy_serde_macros/src/lib.rs +$env.TERM +echo $TERM +export TERM=dumb +cargo test +export TERM=alacritty +cd - +cd ~/workspace/bevy_serde_macros/ +cargo fmt +cargo test +git diff +cargo test +cargo test +git diff +git status +git add . +git status +git commit -m "some issues with using world_scope" +git push +cargo test +cargo test +cargo test +cargo test +cargo test +RUST_BACKTRACE=1 cargo test +cargo test +git stash +git fetch +ssh-add +git fetch +git checkout main +git pull +git branch +git branch -D serialize_as_hashmap +git checkout -b fix_deserialization +cargo test +cargo test +git status +git add src/lib.rs +git status +git commit -m "seem to have fixed deserialization - removed world_scope usage and used custom get_or_insert" +git branch +git push -u origin fix_deserialization +cargo test +cargo test +cargo build +cargo test +cargo test +cargo clippy +git status +git add . +git status +cargo clippy +git statis +git status +git add . +git status +git commit -m "cleaning up comments and deps" +git push +git branch +cargo login +git status +git add . +git status +git commit -m "add metadata" +git branch +git checkout main && git pull +git status +git checkout fix_deserialization +git branch +git log +git checkout main +git cherry-pick 280635144caca27bde380d4d4daa78fd95ba18c3 +git push +cargo publish --dry-run +cargo publish +git add . +git status +git commit -m "reduce keywords for crates.io" +git push +cargo publish +git rm src/saveload_system.rs +git status +git commit -m "remove unused source file" +git push +cargo test +cargo test +cargo clippy +cargo test +git add . +git status +git commit -m "add imports to serialize macro; add docs to readme; bump version" +git branch +git push +cargo publish +git diff +cargo test +cargo clippy +git add . +git status +git commit -m "require HashMap to be specified at use site, due to bevy supporting multiple namespaces for imports; bump version" +git push +cargo publish +cargo clippy +cargo clippy +git add . +git status +git reset +git diff +git add . +git add . +git status +git commit -m "make deserialize public" +git push +cargo publish +cp ../RustyRogue/shell.nix ./ +git status +git diff +git checkt -- shell.nix +git checkout -- shell.nix +cd ../bevy_game_template/ +ls +cp ../RustyRogue/shell.nix ./ +cargo run +rust-analyzer --help +exit +cargo build +exit +hx src/lib.rs +hx src/lib.rs +cargo build +hx src/lib.rs +cargo build +hx src/lib.rs +ls +cd ~/.config/helix/ +sftp 192.168.1.150 +cd - +hx src/lib.rs +hx ~/.config/helix/languages.toml +hx src/lib.rs +cd - +sftp 192.168.1.150 +cd - +hx src/lib.rs +RUST_BACKTRACE=1 hx src/lib.rs +RUST_BACKTRACE=1 hx src/lib.rs +RUST_BACKTRACE=1 hx src/lib.rs +cd ../rust-pretty-assertions/ +ls +hx pretty_assertions/src/lib.rs +cd - +hx src/lib.rs +exit diff --git a/Cargo.lock b/Cargo.lock index 65acf4c..0334870 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -149,7 +149,7 @@ dependencies = [ [[package]] name = "bevy_serde_macros" -version = "0.2.1" +version = "0.2.2" dependencies = [ "bevy_ecs", "bevy_utils", diff --git a/Readme.md b/Readme.md index c7c7c3b..e15c5b6 100644 --- a/Readme.md +++ b/Readme.md @@ -1,5 +1,7 @@ # bevy_serde_macros +[![Crates.io](https://img.shields.io/crates/v/bevy_serde_macros.svg)](https://crates.io/crates/bevy_serde_macros) +[![Docs.rs](https://docs.rs/bevy_serde_macros/badge.svg)](https://docs.rs/bevy_serde_macros) This crate lets you serialize specified components and their associated entities using a "list" of components, as well as the marked entities you wish to serialize. diff --git a/src/lib.rs b/src/lib.rs index ef4d8aa..95ecce6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -225,12 +225,11 @@ mod tests { let mut entity_map = HashMap::new(); let mut component_value_map: HashMap = serde_json::from_slice(&save_data).unwrap(); - let marker = SerializeMe {}; execute_with_type_list!(deserialize_individually!( ecs, &mut entity_map, &mut component_value_map, - marker.clone() + SerializeMe )) }