-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch reimplements commit 'Run luacheck on CI, fix warnings' (b660d8e) added for http v2 and later reverted in scope of issue with discard v2. File http/mime_types.lua contains duplicate items in a table, I don't know what items can be removed so I just ignored a file in a luacheck configuration file. Follows up #95 Part of #134
- Loading branch information
Showing
7 changed files
with
91 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Static analysis | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
static-analysis: | ||
if: | | ||
github.event_name == 'push' || | ||
github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: Setup Tarantool | ||
uses: tarantool/setup-tarantool@v1 | ||
with: | ||
tarantool-version: '2.8' | ||
|
||
- name: Setup luacheck | ||
run: tarantoolctl rocks install luacheck 0.25.0 | ||
|
||
- run: cmake -S . -B build | ||
|
||
- name: Run luacheck | ||
run: make -C build luacheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
std = "luajit" | ||
globals = {"box", "_TARANTOOL", "tonumber64", "utf8"} | ||
ignore = { | ||
-- Accessing an undefined field of a global variable <debug>. | ||
"143/debug", | ||
-- Accessing an undefined field of a global variable <os>. | ||
"143/os", | ||
-- Accessing an undefined field of a global variable <string>. | ||
"143/string", | ||
-- Accessing an undefined field of a global variable <table>. | ||
"143/table", | ||
-- Unused argument <self>. | ||
"212/self", | ||
-- Redefining a local variable. | ||
"411", | ||
-- Redefining an argument. | ||
"412", | ||
-- Shadowing a local variable. | ||
"421", | ||
-- Shadowing an upvalue. | ||
"431", | ||
-- Shadowing an upvalue argument. | ||
"432", | ||
} | ||
|
||
include_files = { | ||
"**/*.lua", | ||
} | ||
|
||
exclude_files = { | ||
"build/**/*.lua", | ||
".rocks/**/*.lua", | ||
".git/**/*.lua", | ||
"http/mime_types.lua", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
find_program(LUACHECK luacheck | ||
HINTS .rocks/ | ||
PATH_SUFFIXES bin | ||
DOC "Lua static analyzer" | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(LuaCheck | ||
REQUIRED_VARS LUACHECK | ||
) | ||
|
||
mark_as_advanced(LUACHECK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters