Ranguli/Nasal Linter

From FlightGear wiki
Jump to navigation Jump to search

List of things that a Nasal linter should address:

- Global variables that could be locally scoped insteadh

return statement outside of a code block

- Empty code blocks inside of if, elsif else, while, for statements, as well as empty functions.

- Certain statements that don't actually do anything:

x;
x == x;
 

- Variables that are re-declared in the same scope

- Variables that are unused

- Variables that are used but not declared.

- Disallow automatic semi-colon insertion:

x = func(y) {
    y = y + 1;
    return # It's legal but bug-prone to leave a semi-colon off of the last line in a code block
}

- Too many function arguments