Skip to content

Commit 10568c6

Browse files
committed
Add single-line rule
1 parent 02cb27d commit 10568c6

4 files changed

Lines changed: 11 additions & 24 deletions

File tree

foundry.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ exclude_lints = [
3131

3232
[fmt]
3333
sort_imports = true
34-
wrap_comments = true
34+
wrap_comments = true
35+
single_line_statement_blocks = "single"

test/lib/mocks/MockAccount.sol

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ contract MockAccount is IERC1271 {
4848
override
4949
returns (bytes4 magicValue)
5050
{
51-
if (SignatureCheckerLib.isValidSignatureNow(owner, hash, signature)) {
52-
return MAGICVALUE;
53-
}
51+
if (SignatureCheckerLib.isValidSignatureNow(owner, hash, signature)) return MAGICVALUE;
5452
return bytes4(0);
5553
}
5654
}

test/unit/BuilderCodes/initialize.t.sol

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,7 @@ contract InitializeTest is BuilderCodesTest {
135135

136136
// Verify URI prefix by checking contractURI format
137137
string memory contractURI = freshContract.contractURI();
138-
if (bytes(uriPrefix).length > 0) {
139-
assertEq(contractURI, string.concat(uriPrefix, "contractURI.json"));
140-
} else {
141-
assertEq(contractURI, "");
142-
}
138+
if (bytes(uriPrefix).length > 0) assertEq(contractURI, string.concat(uriPrefix, "contractURI.json"));
139+
else assertEq(contractURI, "");
143140
}
144141
}

test/unit/BuilderCodes/updateBaseURI.t.sol

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,8 @@ contract UpdateBaseURITest is BuilderCodesTest {
5454
builderCodes.updateBaseURI(uriPrefix);
5555

5656
string memory tokenURI = builderCodes.tokenURI(tokenId);
57-
if (bytes(uriPrefix).length > 0) {
58-
assertEq(tokenURI, string.concat(uriPrefix, validCode));
59-
} else {
60-
assertEq(tokenURI, "");
61-
}
57+
if (bytes(uriPrefix).length > 0) assertEq(tokenURI, string.concat(uriPrefix, validCode));
58+
else assertEq(tokenURI, "");
6259
}
6360

6461
/// @notice Test that updateBaseURI successfully updates the code URI
@@ -75,11 +72,8 @@ contract UpdateBaseURITest is BuilderCodesTest {
7572
builderCodes.updateBaseURI(uriPrefix);
7673

7774
string memory codeURI = builderCodes.codeURI(validCode);
78-
if (bytes(uriPrefix).length > 0) {
79-
assertEq(codeURI, string.concat(uriPrefix, validCode));
80-
} else {
81-
assertEq(codeURI, "");
82-
}
75+
if (bytes(uriPrefix).length > 0) assertEq(codeURI, string.concat(uriPrefix, validCode));
76+
else assertEq(codeURI, "");
8377
}
8478

8579
/// @notice Test that updateBaseURI successfully updates the contract URI
@@ -90,11 +84,8 @@ contract UpdateBaseURITest is BuilderCodesTest {
9084
builderCodes.updateBaseURI(uriPrefix);
9185

9286
string memory contractURI = builderCodes.contractURI();
93-
if (bytes(uriPrefix).length > 0) {
94-
assertEq(contractURI, string.concat(uriPrefix, "contractURI.json"));
95-
} else {
96-
assertEq(contractURI, "");
97-
}
87+
if (bytes(uriPrefix).length > 0) assertEq(contractURI, string.concat(uriPrefix, "contractURI.json"));
88+
else assertEq(contractURI, "");
9889
}
9990

10091
/// @notice Test that updateBaseURI emits the ERC4906 BatchMetadataUpdate event

0 commit comments

Comments
 (0)