Skip to content

Commit

Permalink
feat(config): set_default_std for ldoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Aire-One committed Jul 8, 2022
1 parent ca4ff79 commit 488e870
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docsrc/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Option Meaning
* ``busted`` - globals added by Busted 2.0, by default added for files ending with ``_spec.lua`` within ``spec``, ``test``, and ``tests`` subdirectories;
* ``rockspec`` - globals allowed in rockspecs, by default added for files ending with ``.rockspec``;
* ``luacheckrc`` - globals allowed in Luacheck configs, by default added for files ending with ``.luacheckrc``;
* ``ldoc`` - globals allowed in LDoc config;
* ``ldoc`` - globals allowed in LDoc config, by default added for files named ``config.ld``;
* ``none`` - no standard globals.

See :ref:`stds`
Expand Down
1 change: 1 addition & 0 deletions docsrc/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,5 +191,6 @@ Default per-path std overrides
files["**/tests/**/*_spec.lua"].std = "+busted"
files["**/*.rockspec"].std = "+rockspec"
files["**/*.luacheckrc"].std = "+luacheckrc"
files["**/config.ld"].std = "+ldoc"
Each of these can be overriden by setting a different ``std`` value for the corresponding key in ``files``.
1 change: 1 addition & 0 deletions src/luacheck/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ local function add_default_path_options(opts)
set_default_std(files, "**/tests/**/*_spec.lua", "+busted")
set_default_std(files, "**/*.rockspec", "+rockspec")
set_default_std(files, "**/*.luacheckrc", "+luacheckrc")
set_default_std(files, "**/config.ld", "+ldoc")
end

local fallback_config = {options = {}, anchor_dir = ""}
Expand Down

0 comments on commit 488e870

Please sign in to comment.