nu-lint 1.2.0

Linter for Nu shell scripts that helpfully suggests improvements
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::RULE;
use crate::log::init_test_log;

#[test]
fn test_detect_append_loop_over_literal_list() {
    init_test_log();

    let bad_code = r"
mut data = []
for x in [1 2 3] {
    $data = ($data | append $x)
}
";

    RULE.assert_detects(bad_code);
}