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
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ For Windows there is single-file 64-bit binary distribution, bundling Lua 5.3.4,
43
43
44
44
## Basic usage
45
45
46
-
After Luacheck is installed, run `luacheck` program from the command line. Pass a list of files, [rockspecs](https://github.com/keplerproject/luarocks/wiki/Rockspec-format) or directories (requires LuaFileSystem) to be checked:
46
+
After Luacheck is installed, run `luacheck` program from the command line. Pass a list of files, [rockspecs](https://github.com/luarocks/luarocks/wiki/Rockspec-format) or directories (requires LuaFileSystem) to be checked:
Copy file name to clipboardExpand all lines: docsrc/cli.rst
+9-6Lines changed: 9 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
Command line interface
2
2
======================
3
3
4
-
``luacheck`` program accepts files, directories and `rockspecs <http://www.luarocks.org/en/Rockspec_format>`_ as arguments. They can be filtered using ``--include-files`` and ``--exclude-files`` options, see below.
4
+
``luacheck`` program accepts files, directories and `rockspecs <https://github.com/luarocks/luarocks/wiki/Rockspec-format>`_ as arguments. They can be filtered using ``--include-files`` and ``--exclude-files`` options, see below.
5
5
6
6
* Given a file, ``luacheck`` will check it.
7
7
* Given ``-``, ``luacheck`` will check stdin.
@@ -103,14 +103,16 @@ Option Meaning
103
103
``-m | --module`` Limit visibility of implicitly defined globals to their files.
104
104
105
105
See :ref:`modules`
106
-
``--max-line-length <length`` Set maximum allowed line length (default: 120).
106
+
``--max-line-length <length>`` Set maximum allowed line length (default: 120).
107
107
``--no-max-line-length`` Do not limit line length.
108
-
``--max-code-line-length <length`` Set maximum allowed length for lines ending with code (default: 120).
108
+
``--max-code-line-length <length>`` Set maximum allowed length for lines ending with code (default: 120).
109
109
``--no-max-code-line-length`` Do not limit code line length.
110
-
``--max-string-line-length <length`` Set maximum allowed length for lines within a string (default: 120).
110
+
``--max-string-line-length <length>`` Set maximum allowed length for lines within a string (default: 120).
111
111
``--no-max-string-line-length`` Do not limit string line length.
112
-
``--max-comment-line-length <length`` Set maximum allowed length for comment lines (default: 120).
112
+
``--max-comment-line-length <length>`` Set maximum allowed length for comment lines (default: 120).
113
113
``--no-max-comment-line-length`` Do not limit comment line length.
114
+
``--max-cyclomatic-complexity <limit>`` Set maximum cyclomatic complexity for functions.
115
+
``--no-max-cyclomatic-complexity`` Do not limit function cyclomatic complexity (default).
CLI option ``--stds`` allows combining built-in sets described above using ``+``. For example, ``--std max`` is equivalent to ``--std=lua51c+lua52c+lua53c+luajit``. Leading plus sign adds new sets to default one instead of replacing it. For instance, ``--std +busted`` is suitable for checking test files that use `Busted <http://olivinelabs.com/busted/>`_ testing framework. Custom sets of globals can be defined by mutating global variable ``stds`` in config. See :ref:`custom_stds`
185
+
CLI option ``--stds`` allows combining built-in sets described above using ``+``. For example, ``--std max`` is equivalent to ``--std=lua51c+lua52c+lua53c+luajit``. Leading plus sign adds new sets to current one instead of replacing it. For instance, ``--std +busted`` is suitable for checking test files that use `Busted <http://olivinelabs.com/busted/>`_ testing framework. Custom sets of globals can be defined by mutating global variable ``stds`` in config. See :ref:`custom_stds`
Copy file name to clipboardExpand all lines: docsrc/config.rst
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,13 @@
1
1
Configuration file
2
2
==================
3
3
4
-
``luacheck`` tries to load configuration from ``.luacheckrc`` file in the current directory. If not found, it will look for it in the parent directory and so on, going up until it reaches file system root. Path to config can be set using ``--config`` option, in which case it will be used during recursive loading. Config loading can be disabled using ``--no-config`` flag.
4
+
``luacheck`` tries to load configuration from ``.luacheckrc`` file in the current directory. If not found, it will look for it in the parent directory and so on, going up until it reaches file system root. Path to config can be set using ``--config`` option, in which case it will be used during recursive loading. Paths within config are interpreted relatively to the directory from which it was loaded.
5
+
6
+
Config loading can be disabled using ``--no-config`` flag.
5
7
6
8
If neither of ``--config``, ``--no-config``, and ``--no-default-config`` options are used, ``luacheck`` will attempt to load configuration from value of ``--default-config`` option,
7
9
or ``%LOCALAPPDATA%\Luacheck\.luacheckrc`` on Windows, ``~/Library/Application Support/Luacheck/.luacheckrc`` on OS X/macOS, and ``$XDG_CONFIG_HOME/luacheck/.luacheckrc``
8
-
or ``~/.config/luacheck/.luacheckrc`` on other systems by default.
10
+
or ``~/.config/luacheck/.luacheckrc`` on other systems by default. Paths within default config are interpreted relatively to the current directory.
9
11
10
12
Config is simply a Lua script executed by ``luacheck``. It may set various options by assigning to globals or by returning a table with option names as keys.
Copy file name to clipboardExpand all lines: docsrc/module.rst
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,9 @@ A file report is an array of issues (warnings or errors). If a fatal error occur
24
24
25
25
An issue is a table with field ``code`` indicating its type (see :doc:`warnings`), and fields ``line``, ``column`` and ``end_column`` pointing to the source of the warning. ``name`` field may contain name of related variable. Issues of some types can also have additional fields:
0 commit comments