Skip to content

Commit

Permalink
chore: fix clippy (#5931)
Browse files Browse the repository at this point in the history
* chore: fix clippy

* chore: fix clippy
  • Loading branch information
onbjerg committed Sep 27, 2023
1 parent 5bb886f commit 163cccd
Show file tree
Hide file tree
Showing 19 changed files with 110 additions and 110 deletions.
8 changes: 4 additions & 4 deletions crates/anvil/tests/it/traces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async fn test_parity_suicide_trace() {
let prj = TempProject::dapptools().unwrap();
prj.add_source(
"Contract",
r#"
r"
pragma solidity 0.8.13;
contract Contract {
address payable private owner;
Expand All @@ -62,7 +62,7 @@ contract Contract {
selfdestruct(owner);
}
}
"#,
",
)
.unwrap();

Expand Down Expand Up @@ -98,7 +98,7 @@ async fn test_transfer_debug_trace_call() {
let prj = TempProject::dapptools().unwrap();
prj.add_source(
"Contract",
r#"
r"
pragma solidity 0.8.13;
contract Contract {
address payable private owner;
Expand All @@ -109,7 +109,7 @@ contract Contract {
selfdestruct(owner);
}
}
"#,
",
)
.unwrap();

Expand Down
8 changes: 4 additions & 4 deletions crates/config/src/inline/conf_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ mod tests {
contract: Default::default(),
function: Default::default(),
line: Default::default(),
docs: r#"
docs: r"
forge-config: ciii.invariant.depth = 1
forge-config: default.invariant.depth = 1
"#
"
.into(),
};

Expand All @@ -190,10 +190,10 @@ mod tests {
contract: Default::default(),
function: Default::default(),
line: Default::default(),
docs: r#"
docs: r"
forge-config: ci.invariant.depth = 1
forge-config: default.invariant.depth = 1
"#
"
.into(),
};

Expand Down
4 changes: 2 additions & 2 deletions crates/config/src/inline/natspec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ mod tests {
}

fn natspec() -> NatSpec {
let conf = r#"
let conf = r"
forge-config: default.fuzz.runs = 600
forge-config: ci.fuzz.runs = 500
========= SOME NOISY TEXT =============
Expand All @@ -219,7 +219,7 @@ mod tests {
醤㭊r􎜕󷾸𶚏 ܖ̹灱녗V*竅􋹲⒪苏贗񾦼=숽ؓ򗋲бݧ󫥛𛲍ʹ園Ьi
=======================================
forge-config: default.invariant.runs = 1
"#;
";

NatSpec {
contract: "dir/TestContract.t.sol:FuzzContract".to_string(),
Expand Down
80 changes: 40 additions & 40 deletions crates/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2565,20 +2565,20 @@ mod tests {
assert_eq!(config.install_lib_dir(), PathBuf::from("lib"));
jail.create_file(
"foundry.toml",
r#"
r"
[profile.default]
libs = ['node_modules', 'lib']
"#,
",
)?;
let config = Config::load();
assert_eq!(config.install_lib_dir(), PathBuf::from("lib"));

jail.create_file(
"foundry.toml",
r#"
r"
[profile.default]
libs = ['custom', 'node_modules', 'lib']
"#,
",
)?;
let config = Config::load();
assert_eq!(config.install_lib_dir(), PathBuf::from("custom"));
Expand Down Expand Up @@ -2636,12 +2636,12 @@ mod tests {

jail.create_file(
"foundry.toml",
r#"
r"
[profile.default]
libs = ['lib']
[profile.local]
libs = ['modules']
"#,
",
)?;
jail.set_env("FOUNDRY_PROFILE", "local");
let config = Config::load();
Expand Down Expand Up @@ -2745,10 +2745,10 @@ mod tests {

jail.create_file(
"remappings.txt",
r#"
r"
file-ds-test/=lib/ds-test/
file-other/=lib/other/
"#,
",
)?;

let config = Config::load();
Expand Down Expand Up @@ -2796,10 +2796,10 @@ mod tests {

jail.create_file(
"remappings.txt",
r#"
r"
ds-test/=lib/ds-test/
other/=lib/other/
"#,
",
)?;

let config = Config::load();
Expand Down Expand Up @@ -3348,10 +3348,10 @@ mod tests {
figment::Jail::expect_with(|jail| {
jail.create_file(
"foundry.toml",
r#"
r"
[profile.default]
remappings = ['nested/=lib/nested/']
"#,
",
)?;

let config = Config::load_with_root(jail.directory());
Expand Down Expand Up @@ -3588,7 +3588,7 @@ mod tests {
}
);

jail.set_env("FOUNDRY_SRC", r#"other-src"#);
jail.set_env("FOUNDRY_SRC", r"other-src");
let config = Config::load();
assert_eq!(
config,
Expand Down Expand Up @@ -3638,7 +3638,7 @@ mod tests {
remappings: default.remappings.clone(),
}
);
jail.set_env("FOUNDRY_PROFILE", r#"other"#);
jail.set_env("FOUNDRY_PROFILE", r"other");
let base = Config::figment().extract::<BasicConfig>().unwrap();
assert_eq!(
base,
Expand All @@ -3660,10 +3660,10 @@ mod tests {
figment::Jail::expect_with(|jail| {
jail.create_file(
"foundry.toml",
r#"
r"
[fuzz]
dictionary_weight = 101
"#,
",
)?;
let _config = Config::load();
Ok(())
Expand All @@ -3675,7 +3675,7 @@ mod tests {
figment::Jail::expect_with(|jail| {
jail.create_file(
"foundry.toml",
r#"
r"
[fuzz]
runs = 1
include_storage = false
Expand All @@ -3689,7 +3689,7 @@ mod tests {
[profile.ci.invariant]
runs = 400
"#,
",
)?;

let invariant_default = InvariantConfig::default();
Expand Down Expand Up @@ -3735,7 +3735,7 @@ mod tests {
figment::Jail::expect_with(|jail| {
jail.create_file(
"foundry.toml",
r#"
r"
[fuzz]
runs = 100
Expand All @@ -3747,7 +3747,7 @@ mod tests {
[profile.ci.invariant]
runs = 500
"#,
",
)?;

let config = Config::load();
Expand Down Expand Up @@ -3838,7 +3838,7 @@ mod tests {
figment::Jail::expect_with(|jail| {
jail.create_file(
"foundry.toml",
r#"
r"
[profile.default]
libraries= [
'./src/SizeAuctionDiscount.sol:Chainlink:0xffedba5e171c4f15abaaabc86e8bd01f9b54dae5',
Expand All @@ -3847,7 +3847,7 @@ mod tests {
'./src/test/ChainlinkTWAP.t.sol:ChainlinkTWAP:0xffedba5e171c4f15abaaabc86e8bd01f9b54dae5',
'./src/SizeAuctionDiscount.sol:Math:0x902f6cf364b8d9470d5793a9b2b2e86bddd21e0c',
]
"#,
",
)?;
let config = Config::load();

Expand Down Expand Up @@ -3955,7 +3955,7 @@ mod tests {
figment::Jail::expect_with(|jail| {
jail.create_file(
"foundry.toml",
r#"
r"
[profile.default]
optimizer = true
Expand All @@ -3964,7 +3964,7 @@ mod tests {
[profile.default.optimizer_details.yulDetails]
stackAllocation = true
"#,
",
)?;
let mut loaded = Config::load();
clear_warning(&mut loaded);
Expand Down Expand Up @@ -3996,15 +3996,15 @@ mod tests {
figment::Jail::expect_with(|jail| {
jail.create_file(
"foundry.toml",
r#"
r"
[profile.default]
[profile.default.model_checker]
contracts = { 'a.sol' = [ 'A1', 'A2' ], 'b.sol' = [ 'B1', 'B2' ] }
engine = 'chc'
targets = [ 'assert', 'outOfBounds' ]
timeout = 10000
"#,
",
)?;
let mut loaded = Config::load();
clear_warning(&mut loaded);
Expand Down Expand Up @@ -4046,15 +4046,15 @@ mod tests {
figment::Jail::expect_with(|jail| {
jail.create_file(
"foundry.toml",
r#"
r"
[profile.default]
[profile.default.model_checker]
contracts = { 'a.sol' = [ 'A1', 'A2' ], 'b.sol' = [ 'B1', 'B2' ] }
engine = 'chc'
targets = [ 'assert', 'outOfBounds' ]
timeout = 10000
"#,
",
)?;
let loaded = Config::load().sanitized();

Expand Down Expand Up @@ -4101,12 +4101,12 @@ mod tests {
figment::Jail::expect_with(|jail| {
jail.create_file(
"foundry.toml",
r#"
r"
[fmt]
line_length = 100
tab_width = 2
bracket_spacing = true
"#,
",
)?;
let loaded = Config::load().sanitized();
assert_eq!(
Expand All @@ -4128,11 +4128,11 @@ mod tests {
figment::Jail::expect_with(|jail| {
jail.create_file(
"foundry.toml",
r#"
r"
[invariant]
runs = 512
depth = 10
"#,
",
)?;

let loaded = Config::load().sanitized();
Expand All @@ -4150,13 +4150,13 @@ mod tests {
figment::Jail::expect_with(|jail| {
jail.create_file(
"foundry.toml",
r#"
r"
[fuzz]
runs = 100
[invariant]
depth = 1
"#,
",
)?;

jail.set_env("FOUNDRY_FMT_LINE_LENGTH", "95");
Expand All @@ -4174,14 +4174,14 @@ mod tests {

#[test]
fn test_parse_with_profile() {
let foundry_str = r#"
let foundry_str = r"
[profile.default]
src = 'src'
out = 'out'
libs = ['lib']
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
"#;
";
assert_eq!(
parse_with_profile::<BasicConfig>(foundry_str).unwrap().unwrap(),
(
Expand All @@ -4202,11 +4202,11 @@ mod tests {
figment::Jail::expect_with(|jail| {
jail.create_file(
"foundry.toml",
r#"
r"
[default]
src = 'my-src'
out = 'my-out'
"#,
",
)?;
let loaded = Config::load().sanitized();
assert_eq!(loaded.src.file_name().unwrap(), "my-src");
Expand Down Expand Up @@ -4378,10 +4378,10 @@ mod tests {
figment::Jail::expect_with(|jail| {
jail.create_file(
"foundry.toml",
r#"
r"
[default]
[profile.default.optimizer_details]
"#,
",
)?;

let config = Config::load();
Expand Down
Loading

0 comments on commit 163cccd

Please sign in to comment.