You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement behavior for `lute lint` to use default lint rules if none are
specified. After discussing with @~Vighnesh-V, we've decided to keep the
example rules in `examples` as-is, but keep the actual lint rules used
inside `lute/cli/commands/lint/rules`, which will also hold any lint
rules added in the future.
Also deleted the `linter.luau` example in case people go thinking that's
the linter instead.
Lint the specified Luau file using the specified lint rule(s).
16
+
Lint the specified Luau file using the specified lint rule(s) or using the default rules.
16
17
17
18
OPTIONS:
18
19
-h, --help Show this help message
19
-
-r, --rules [RULE] Path to a single lint rule or a folder containing lint rules. If a folder is provided, any subfolders containing init.luau files will be treated as modules exporting lint rules, while all other .luau files will be treated as individual lint rules.
20
+
-r, --rules [RULE] Path to a single lint rule or a folder containing lint rules. If a folder
21
+
is provided, any subfolders containing init.luau files will be treated as
22
+
modules exporting lint rules, while all other .luau files will be treated
23
+
as individual lint rules. If unspecified, the default lint rules are used.
20
24
21
25
PATHS:
22
26
Path(s) to the Luau file(s) or folders containing Luau files to be linted. Only files with .luau or .lua extensions will be linted.
returnloaded::types.LintRule-- We have to cast because we can only assert that loaded.lint is the top function type, rather than a more specific function type like (ast: syntax.AstStatBlock, sourcepath: path.path) -> { LintViolation }
48
+
returnloaded-- Typecast isn't needed because loaded is refined to any bc of type error in assertIsLintRule
To add a new default lint rule to `lute lint`, create a module or luau file defining the rule in this folder. Then, add the name of the rule to the DEFAULT_RULES constant in `lint/init.luau`, and add a test for the rule in `tests/cli/lint.test.luau`. The expected type of a lint rule is specified in `lint/types.luau`.
0 commit comments