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-endThe 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 ๐
- START_MARKER ๐
Functionsยง
- check_lines ๐
- check_section ๐
- indentation ๐
- is_close_bracket ๐