diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33abf92..1716168 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,8 @@ jobs: - name: Check code formatting run: cargo +nightly fmt -- --check - - name: Check codecov.yml file format - run: curl --data-binary @- https://codecov.io/validate < codecov.yml +# - name: Check codecov.yml file format +# run: curl --data-binary @- https://codecov.io/validate < codecov.yml check: name: Check diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..f2ae368 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,7 @@ +repos: + - repo: https://github.com/doublify/pre-commit-rust + rev: master + hooks: + - id: fmt + - id: cargo-check + - id: clippy \ No newline at end of file diff --git a/README.md b/README.md index d4a3695..e92eb1b 100644 --- a/README.md +++ b/README.md @@ -1 +1,8 @@ -# rust-template \ No newline at end of file +# od-rust-template + + +## pre-commit + +`pre-commit install` + +To run all on all files `pre-commit run --all-files ` \ No newline at end of file diff --git a/application/rest-api-adapter/src/lib.rs b/application/rest-api-adapter/src/lib.rs index 4dd67d9..35e7fec 100644 --- a/application/rest-api-adapter/src/lib.rs +++ b/application/rest-api-adapter/src/lib.rs @@ -1,13 +1,12 @@ #[macro_use] pub extern crate rocket; -use rocket::{Build, get, Rocket}; +use rocket::{get, Build, Rocket}; #[get("/")] pub fn index() -> &'static str { - "Hello, world!" + "Hello, world!" } - pub fn build_api() -> Rocket { - rocket::build().mount("/", routes![index]) -} \ No newline at end of file + rocket::build().mount("/", routes![index]) +} diff --git a/bootstrap/src/main.rs b/bootstrap/src/main.rs index f3d7443..abe30c6 100644 --- a/bootstrap/src/main.rs +++ b/bootstrap/src/main.rs @@ -4,9 +4,6 @@ use rest_api_adapter::build_api; #[rocket::main] async fn main() -> Result<(), rocket::Error> { - build_api() - .launch() - .await?; - Ok(()) + build_api().launch().await?; + Ok(()) } -