Adds style checking to CI, remove debug code
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2022-06-16 19:05:54 +02:00
parent bd646df225
commit 59cc150643
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
4 changed files with 9 additions and 7 deletions

View File

@ -35,3 +35,10 @@ steps:
- cargo llvm-cov nextest --color=always
depends_on:
- test-debug-linux
- name: check-style
image: deukhoofd/linux64builder
failure: ignore
commands:
- cargo fmt --all -- --check
depends_on:
- test-debug-linux

View File

@ -1,5 +1,5 @@
pub mod battle_stat_calculator;
pub mod damage_library;
pub mod dynamic_library;
pub mod script_resolver;
pub mod misc_library;
pub mod script_resolver;

View File

@ -7,5 +7,5 @@ pub mod damage_source;
pub mod executing_move;
pub mod learned_move;
pub mod pokemon;
pub mod pokemon_party;
pub mod pokemon_builder;
pub mod pokemon_party;

View File

@ -36,17 +36,12 @@ pub fn load_moves(path: &String, type_library: &TypeLibrary) -> MoveLibrary {
let mut file = File::open(path.to_string() + "Moves.json").unwrap();
let mut data = String::new();
file.read_to_string(&mut data).unwrap();
println!("1");
let json: Value = serde_json::from_str(&data).unwrap();
println!("a");
let data = json.as_object().unwrap().get("data").unwrap().as_array().unwrap();
println!("this");
let mut move_library = MoveLibrary::new(data.len());
println!("Heeere");
for move_data in data {
let move_data = move_data.as_object().unwrap();
let move_name = StringKey::new(move_data["name"].as_str().unwrap().clone());
println!("Loaded move {:?}", move_name);
let move_type = StringKey::new(move_data["type"].as_str().unwrap());
let move_type_id = type_library.get_type_id(&move_type);
let move_category = serde_json::from_value(move_data["category"].clone()).unwrap();