12 Commits

Author SHA1 Message Date
Celtic Minstrel
c7741907c2 [LuaDoc] Fix several errors in the inline documentation 2024-02-06 19:04:00 -05:00
Steve Cotton
49ebbb9709 Make fix_whitespace complain about mixing tabs and spaces
Ensures that files either use tabs for indentation or spaces for indentation,
but don't switch between the two within the same file.

This doesn't fix the whitespace, it's a simple check to flag it up
on the assumption that it's better to use an editor or code formatter
to clean up the file.

Elsewhere in the CI we use the luacheck tool - while that can detect
mixing tabs and spaces in a single line's indent, it doesn't check for
inconsistent indentation within a file.
2023-02-05 02:22:53 +01:00
Celtic Minstrel
e2875f34b2 Fix a bunch of luadoc errors 2022-06-11 00:15:18 -04:00
Celtic Minstrel
e1300e29b0
Lua API: Add inline documentation for pretty much everything and convert existing docs (#6483)
The new format is EmmyLua-based and can be used with (at least) Visual Studio Code.
2022-02-17 13:43:31 -05:00
Luther
bff219d41f
Expand the reduce function to both fold and reduce (#6337) 2021-12-04 17:46:12 -05:00
Pentarctagon
370d03ccb7 Fix luacheck warnings and add to CI.
Note the `exclude_files` in .luacheckrc should be deleted once the eventual Ubuntu 22.04 base image has an updated luacheck that supports lua 5.4.
2021-11-28 14:26:02 -06:00
Celtic Minstrel
e9465fa03e Lua API: Add alternative version of map function to be used on arrays 2021-09-04 22:20:28 -04:00
Celtic Minstrel
b22c3b595c Lua API: Fix functional.map returning the wrong answer if used on a table that contains numeric keys but is not strictly an array 2021-09-04 22:20:28 -04:00
Celtic Minstrel
440dbbd0ad Lua API: The value function is now optional in functional.choose[_map]
By default, the functions now use the value taken directly from the map or array.
In addition, if a string or other non-functional value is passed, it's used as a key on the value.
2021-09-04 22:20:28 -04:00
Celtic Minstrel
29e11e7914 Lua functional library: make reduce accept an operator name in place of a function, add zip 2019-12-07 13:52:49 -05:00
Vasya
fa71ab4be0 Lua API: simplify functional.reduce (#2788)
simplify code and remove `indentity or 0` VS `indentity` inconsistency.

(cherry-picked from commit 2b8782923a758eee2e167e5c4097f2803e6e2be6)
2018-10-07 03:18:38 +00:00
Celtic Minstrel
f6c04e7dd1 Add functional.lua which implements higher-order functions
This covers all the main higher-order functions included in WFL, except zip.
The two already implemented in ai_helper have been replaced with redirection stubs.
2017-05-10 17:40:20 -04:00