print_in_module
Finds a module writes to the program's output.
Category restriction, allow by default.
Off by default; the example is shown with the rule enabled.
#import "Basic";
parse :: (text: string) -> int {
print("parsing %\n", text);
return text.count;
}warning[print_in_module]: a module should not write to the program's output
--> example.jai:4:5
|
4 | print("parsing %\n", text);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: return the text or an error, or log it, and let the program decide what to print#import "Basic";
parse :: (text: string) -> int {
return text.count;
}A file belongs to a module when it or a directory above it holds a module.jai, with no tests or test folder in between (those hold programs that use the module).