Skip to content

Commit

Permalink
Merge pull request #125 from baoyachi/fix_clippy_warning
Browse files Browse the repository at this point in the history
fix clippy warning, format github action ci
  • Loading branch information
baoyachi committed Dec 14, 2022
2 parents 2411391 + 6b996be commit 0ec3eaf
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 33 deletions.
28 changes: 14 additions & 14 deletions .github/dependabot.yml
@@ -1,16 +1,16 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "\U0001F4E6 dependencies"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "\U0001F4E6 dependencies"
- package-ecosystem: cargo
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "\U0001F4E6 dependencies"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "\U0001F4E6 dependencies"
34 changes: 19 additions & 15 deletions .github/workflows/check.yml
Expand Up @@ -47,33 +47,37 @@ jobs:
- name: Run examples with release
run: cargo run --example builtin_fn

# example_shadow cargo fmt
- name: Check examples format
run: cargo fmt --all -- --check
working-directory: ./example_shadow

# example_shadow cargo clippy
- name: Check examples with clippy
run: cargo clippy --all -- -D warnings
# example_shadow check
- name: Check example_shadow
run: |
cargo fmt --all -- --check
cargo clippy --all -- -D warnings
cargo run
working-directory: ./example_shadow

# example_shadow cargo run
- name: Run example_shadow
run: cargo run
working-directory: ./example_shadow
# example_shadow_hook check
- name: Check example_shadow_hook
run: |
cargo fmt --all -- --check
cargo clippy --all -- -D warnings
cargo run
working-directory: ./example_shadow_hook

# build on nightly
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: clippy
- name: Build on nightly
run: cargo build --release
run: |
cargo build --release
cargo +nightly clippy --all --all-features -- -D warnings
test:
strategy:
matrix:
rust: [stable, beta, nightly]
rust: [ stable, beta, nightly ]
runs-on: ubuntu-latest
steps:
- name: Setup Rust
Expand Down Expand Up @@ -105,7 +109,7 @@ jobs:
publish-crate:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [test]
needs: [ test ]
steps:
- name: Set up Rust
uses: hecrj/setup-rust-action@v1
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "shadow-rs"
version = "0.18.0"
version = "0.19.0"
authors = ["baoyachi <liaoymxsdl@gmail.com>"]
edition = "2021"
description = "A build-time information stored in your rust project"
Expand Down
2 changes: 1 addition & 1 deletion example_shadow/src/main.rs
Expand Up @@ -6,7 +6,7 @@ shadow!(build);

fn main() {
let local_time = shadow_rs::DateTime::now().human_format();
println!("{}", local_time);
println!("{local_time}");

Command::new("example_shadow")
.version(build::CLAP_LONG_VERSION)
Expand Down
4 changes: 2 additions & 2 deletions example_shadow_hook/build.rs
Expand Up @@ -14,7 +14,7 @@ fn hook(file: &File) -> SdResult<()> {

fn append_write_const(mut file: &File) -> SdResult<()> {
let hook_const: &str = r#"pub const HOOK_CONST: &str = "hello hook const";"#;
writeln!(file, "{}", hook_const)?;
writeln!(file, "{hook_const}")?;
Ok(())
}

Expand All @@ -23,6 +23,6 @@ fn append_write_fn(mut file: &File) -> SdResult<()> {
pub fn hook_fn() -> &'static str{
"hello hook bar fn"
}"#;
writeln!(file, "{}", hook_fn)?;
writeln!(file, "{hook_fn}")?;
Ok(())
}

0 comments on commit 0ec3eaf

Please sign in to comment.