Skip to content

Commit d52743a

Browse files
committed
add config for forge fmt
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
1 parent c638323 commit d52743a

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

contracts/core/04-channel/IBCChannelPacketSendRecv.sol

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,8 @@ contract IBCChannelPacketSendRecv is
106106
*/
107107
function recvPacket(MsgPacketRecv calldata msg_) public override {
108108
Channel.Data storage channel = channels[msg_.packet.destinationPort][msg_.packet.destinationChannel];
109-
if (channel.state == Channel.State.STATE_OPEN) {} else if (
110-
channel.state == Channel.State.STATE_FLUSHING || channel.state == Channel.State.STATE_FLUSHCOMPLETE
111-
) {
109+
if (channel.state == Channel.State.STATE_OPEN) {}
110+
else if (channel.state == Channel.State.STATE_FLUSHING || channel.state == Channel.State.STATE_FLUSHCOMPLETE) {
112111
RecvStartSequence storage rseq =
113112
recvStartSequences[msg_.packet.destinationPort][msg_.packet.destinationChannel];
114113
// prevSequence=0 means the channel is not in the process of being upgraded or counterparty has not been upgraded yet

contracts/core/24-host/IBCHostLib.sol

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,16 @@ library IBCHostLib {
2020
unchecked {
2121
for (uint256 i = 0; i < portIdLength; i++) {
2222
uint256 c = uint256(uint8(portId[i]));
23+
// return false if the character is not in one of the following categories:
24+
// a-z
25+
// 0-9
26+
// A-Z
27+
// ".", "_", "+", "-"
28+
// "#", "[", "]", "<", ">"
2329
if (
24-
// a-z
25-
!(c >= 0x61 && c <= 0x7A)
26-
// 0-9
27-
&& !(c >= 0x30 && c <= 0x39)
28-
// A-Z
29-
&& !(c >= 0x41 && c <= 0x5A)
30-
// ".", "_", "+", "-"
31-
&& !(c == 0x2E || c == 0x5F || c == 0x2B || c == 0x2D)
32-
// "#", "[", "]", "<", ">"
33-
&& !(c == 0x23 || c == 0x5B || c == 0x5D || c == 0x3C || c == 0x3E)
30+
!(c >= 0x61 && c <= 0x7A) && !(c >= 0x30 && c <= 0x39) && !(c >= 0x41 && c <= 0x5A)
31+
&& !(c == 0x2E || c == 0x5F || c == 0x2B || c == 0x2D)
32+
&& !(c == 0x23 || c == 0x5B || c == 0x5D || c == 0x3C || c == 0x3E)
3433
) {
3534
return false;
3635
}

foundry.toml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,23 @@ optimizer_runs = 9_999_999
99
via-ir = false
1010

1111
[fmt]
12+
line_length = 120
13+
tab_width = 4
14+
bracket_spacing = false
15+
int_types = "long"
16+
multiline_func_header = "attributes_first"
17+
quote_style = "double"
18+
number_underscore = "preserve"
19+
hex_underscore = "remove"
20+
single_line_statement_blocks = "preserve"
21+
override_spacing = false
22+
wrap_comments = false
1223
ignore = [
13-
'./contracts/proto/**/*.sol',
14-
'./tests/**/*.sol'
24+
"./contracts/proto/**/*.sol",
25+
"./tests/**/*.sol",
1526
]
27+
contract_new_lines = false
28+
sort_imports = false
1629

1730
[profile.no_optimization]
1831
optimizer = false

0 commit comments

Comments
 (0)