formatting!

This commit is contained in:
nora 2022-03-10 19:18:26 +01:00
parent 770762b920
commit cae9683bd4
33 changed files with 147 additions and 87 deletions

View file

@ -1,7 +1,9 @@
use crate::{project_root, yarn_install};
use anyhow::ensure;
use std::process::Command;
use anyhow::ensure;
use crate::{project_root, yarn_install};
pub fn main() -> anyhow::Result<()> {
println!("$ cargo fmt --check");
let status = Command::new("cargo")

View file

@ -4,8 +4,6 @@ mod parser;
mod random;
mod write;
use anyhow::{bail, Context};
use heck::ToUpperCamelCase;
use std::{
fs,
fs::File,
@ -15,6 +13,9 @@ use std::{
process::Command,
str::FromStr,
};
use anyhow::{bail, Context};
use heck::ToUpperCamelCase;
use strong_xml::XmlRead;
#[derive(Debug, XmlRead)]

View file

@ -1,8 +1,9 @@
use super::{Amqp, Assert, Class, Domain, Method};
use crate::codegen::Codegen;
use heck::{ToSnakeCase, ToUpperCamelCase};
use itertools::Itertools;
use super::{Amqp, Assert, Class, Domain, Method};
use crate::codegen::Codegen;
fn method_function_name(class_name: &str) -> impl Fn(&Method) -> String + '_ {
move |method| {
let method_name = method.name.to_snake_case();

View file

@ -1,6 +1,7 @@
use crate::codegen::{Amqp, Codegen};
use heck::ToUpperCamelCase;
use crate::codegen::{Amqp, Codegen};
impl Codegen {
pub fn codegen_random(&mut self, amqp: &Amqp) {
writeln!(

View file

@ -1,6 +1,7 @@
use crate::codegen::{Amqp, Codegen};
use heck::ToUpperCamelCase;
use crate::codegen::{Amqp, Codegen};
impl Codegen {
pub fn codegen_write(&mut self, amqp: &Amqp) {
writeln!(

View file

@ -1,7 +1,9 @@
use crate::{project_root, yarn_install};
use anyhow::ensure;
use std::process::Command;
use anyhow::ensure;
use crate::{project_root, yarn_install};
pub fn main() -> anyhow::Result<()> {
println!("$ cargo fmt");
let status = Command::new("cargo")

View file

@ -1,9 +1,10 @@
use anyhow::{ensure, Context, Result};
use std::{
path::{Path, PathBuf},
process::Command,
};
use anyhow::{ensure, Context, Result};
mod check_fmt;
mod codegen;
mod fmt;

View file

@ -1,7 +1,9 @@
use crate::{project_root, yarn_install};
use anyhow::{ensure, Context, Result};
use std::{path::Path, process::Command, thread::sleep, time::Duration};
use anyhow::{ensure, Context, Result};
use crate::{project_root, yarn_install};
pub fn main() -> Result<()> {
let project_root = project_root();
let test_js_root = project_root.join("test-js");