-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathwrap-comments.fmt.sol
128 lines (115 loc) · 2.3 KB
/
wrap-comments.fmt.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// config: line_length = 40
// config: wrap_comments = true
pragma solidity ^0.8.13;
/// @title A Hello world example
contract HelloWorld {
/// Some example struct
struct Person {
uint256 age;
address wallet;
}
/**
* Here's a more double asterix
* comment
*/
Person public theDude;
/// Constructs the dude
/// @param age The dude's age
constructor(uint256 age) {
theDude = Person({
age: age,
wallet: msg.sender
});
}
/**
* @dev does nothing
*/
function example() public {
/**
* Does this add a whitespace
* error?
*
* Let's find out.
*/
}
/**
* @dev Calculates a rectangle's
* surface and perimeter.
* @param w Width of the rectangle.
* @param h Height of the rectangle.
* @return s The calculated surface.
* @return p The calculated
* perimeter.
*/
function rectangle(
uint256 w,
uint256 h
)
public
pure
returns (uint256 s, uint256 p)
{
s = w * h;
p = 2 * (w + h);
}
/// A long doc line comment that
/// will be wrapped
function docLineOverflow()
external
{}
function docLinePostfixOverflow()
external
{}
/// A long doc line comment that
/// will be wrapped
/**
* @notice Here is my comment
* - item 1
* - item 2
* Some equations:
* y = mx + b
*/
function anotherExample()
external
{}
/**
* contract A {
* function foo() public {
* // does nothing.
* }
* }
*/
function multilineIndent()
external
{}
/**
* contract A {
* function foo() public {
* // does nothing.
* }
* }
*/
function multilineMalformedIndent()
external
{}
/**
* contract A {
* function
* withALongNameThatWillCauseCommentWrap()
* public {
* // does nothing.
* }
* }
*/
function malformedIndentOverflow()
external
{}
}
/**
* contract A {
* function foo() public {
* // does nothing.
* }
* }
*/
function freeFloatingMultilineIndent() {}