Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix clippy warning, format github action ci #125

Merged
merged 3 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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"
9 changes: 6 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,16 @@ jobs:
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 +108,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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shadow-rs"
version = "0.18.0"
version = "0.19.0"
authors = ["baoyachi <[email protected]>"]
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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(())
}
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,13 +445,13 @@ impl Shadow {

// append gen const
for k in self.map.keys() {
let tmp = format!(r#"{}println!("{}:{{}}", {});{}"#, "\t", k, k, "\n");
let tmp = format!(r#"{}println!("{k}:{k}");{}"#, "\t", "\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@baoyachi I think you want to rebase this PR on top of master.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right.

print_val.push_str(tmp.as_str());
}

// append gen fn
for k in gen_const {
let tmp = format!(r#"{}println!("{}:{{}}\n", {});{}"#, "\t", k, k, "\n");
let tmp = format!(r#"{}println!("{k}:{k}\n");{}"#, "\t", "\n");
print_val.push_str(tmp.as_str());
}

Expand Down