Skip to content
activity

GitHub Action

Luacheck Linter

v0.2.2 Latest version

Luacheck Linter

activity

Luacheck Linter

Run Luacheck Lint

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Luacheck Linter

uses: judaew/[email protected]

Learn more about this action in judaew/luacheck-action

Choose a version

GitHub Action for Luacheck

Usage

All options recommend set in .luacheckrc at the root of the repository. See more in the Configuration file.

Example of the action:

on: [push, pull_request]

jobs:
  luacheck:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Luacheck Linter
      uses: judaew/[email protected]
      with:
        # [required]
        # Paths to lua files. If you want to lint multiple ansible files, use the
        # following syntax
        #
        # targets: |
        #   main_1.lua
        #   main_2.lua
        targets: "."
        # [optional]
        # Arguments to be passed to the Luacheck
        #
        # Options:
        # -g, --no-global               Filter out warnings related to global variables.
        # -u, --no-unused               Filter out warnings related to unused variables and
        #                               values.
        # -r, --no-redefined            Filter out warnings related to redefined variables.
        # -a, --no-unused-args          Filter out warnings related to unused arguments and
        #                               loop variables.
        # -s, --no-unused-secondaries   Filter out warnings related to unused variables set
        #                               together with used ones.
        # --no-self                     Filter out warnings related to implicit self argument.
        # --std <std>                   Set standard globals. <std> can be one of: max,
        #                               min, lua51, lua51c, lua52, lua52c, lua53, lua53c,
        #                               luajit, ngx_lua, love, buste, rockspec, luacheckrc,
        #                               none
        # --globals [<global>]          Add custom global variables or fields on top of
        #                               standard ones.
        # --read-globals [<global>]     Add read-only global variables or fields.
        # --new-globals [<global>]      Set custom global variables or fields. Removes
        #                               custom globals added previously.
        # --new-read-globals [<global>] Set read-only global variables or fields. Removes
        #                               read-only globals added previously.
        # --not-globals [<name>]        Remove custom and standard global variables or
        #                               fields.
        # -c, --compat                  Equivalent to --std max.
        # -d, --allow-defined           Allow defining globals implicitly by setting them.
        # -t, --allow-defined-top       Allow defining globals implicitly by setting them
        #                               in the top level scope.
        # -m, --module                  Limit visibility of implicitly defined globals to
        #                               their files.
        # --max-line-length <length>    Set maximum allowed line length (default: 120).
        # --no-max-line-length          Do not limit line length.
        # --max-code-line-length <length>
        #                               Set maximum allowed length for lines ending with
        #                               code (default: 120).
        # --no-max-code-line-length     Do not limit code line length.
        # --max-string-line-length <length>
        #                               Set maximum allowed length for lines within a
        #                               string (default: 120).
        # --no-max-string-line-length   Do not limit string line length.
        # --max-comment-line-length <length>
        #                               Set maximum allowed length for comment lines
        #                               (default: 120).
        # --no-max-comment-line-length  Do not limit comment line length.
        # --max-cyclomatic-complexity <limit>
        #                               Set maximum cyclomatic complexity for functions.
        # --no-max-cyclomatic-complexity
        #                               Do not limit function cyclomatic complexity
        #                               (default).
        # -i <patt> [<patt>]            Filter out warnings matching patterns.
        # --enable, -e <patt> [<patt>]  Do not filter out warnings matching patterns.
        # --only, -o <patt> [<patt>]    Filter out warnings not matching patterns.
        # --config <config>             Path to custom configuration file (default:
        #                               .luacheckrc).
        # --no-config                   Do not look up custom configuration file.
        # --filename <filename>         Use another filename in output, for selecting
        #                               configuration overrides and for file filtering.
        # --exclude-files <glob> [<glob>]
        #                               Do not check files matching these globbing patterns.
        #                               Recursive globs such as **/*.lua are supported.
        # --include-files <glob> [<glob>]
        #                               Do not check files not matching these globbing
        #                               patterns.
        # -j, --jobs                    Check <jobs> files in parallel. Default number of
        #                               jobs is set to number of available processing units.
        # -q, --quiet                   Suppress report output for files without warnings.
        # -qq                           Suppress output of warnings.
        # -qqq                          Only output summary.
        # --codes                       Show warning codes.
        # --ranges                      Show ranges of columns related to warnings.
        #
        # See more https://manpages.debian.org/testing/lua-check/luacheck.1.en.html
        args: ""