Rune Linter
Rune comes bundled with a linter, which will find possible errors or improve aspects of your code, and can even fix certain things automatically. Here is how to use it:
Running the Linter
This will detect any errors, but will not fix them. Useful if you want to just see the errors/suggestions or ignore certain ones.
This will fix any of the detected suggestions or errors that it can automatically, some cannot be fixed automatically but will still be logged. For example, no entry point cannot be auto-fixed as the linter cant know what function is the entry point.
Lint Rules
Here is a list of all rules the linter checks for:
-
Extra long line: Checks if a single line is over 60 characters, this can be auto-fixed
-
No entry point: Checks if the program does not have an entry point, meaning it will not run anything as theres no starting function, cannot be auto-fixed
-
Unused variable: Checks if a variable is defined but never used, can be auto-fixed most of the time, will log if it cannot be
-
Infinite loop: Checks if a loop will go on forever, cannot be auto-fixed
-
Excessive use of free: Checks if the code uses the free() function too often instead of reusing variables or leaving variables in memory, cannot be auto-fixed
-
Variable naming: Checks if variables are snake case, can be auto-fixed
-
Function naming: Checks if functions are snake case, can be auto-fixed
-
Undefined variables: Checks if a variable is used but not defined, cannot be auto-fixed
-
Too short variable name: Checks for one character variable name, cannot be auto-fixed
-
Undefined type: Checks for non-explicit types, defined with (_), can be auto-fixed