Module tidy::alphabetical
source ยท Expand description
Checks that a list of items is in alphabetical order
Use the following marker in the code:
// tidy-alphabetical-start
fn aaa() {}
fn eee() {}
fn z() {}
// tidy-alphabetical-end
The following lines are ignored:
- Empty lines
- Lines that are indented with more or less spaces than the first line
- Lines starting with
//
,#
(except those starting with#!
),)
,]
,}
if the comment has the same indentation as the first line - Lines starting with a closing delimiter (
)
,[
,}
) are ignored.
If a line ends with an opening delimiter, we effectively join the following line to it before
checking it. E.g. foo(\nbar)
is treated like foo(bar)
.
Constantsยง
- END_
MARKER ๐ - STAR
T_ ๐MARKER
Functionsยง
- check_
lines ๐ - check_
section ๐ - indentation ๐
- is_
close_ ๐bracket