forked from CorsixTH/CorsixTH
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.luacheckrc
138 lines (122 loc) · 7.13 KB
/
.luacheckrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
--[[ Copyright (c) 2016 Albert "AlbertH" Hofkamp
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. --]]
self = false
globals = { -- Globals
"_A", "_S",
"corsixth",
"action_queue_leave_bench", "class", "compare_tables",
"destrict", "flag_clear", "flag_isset", "flag_set", "flag_toggle",
"lfs", "list_to_set", "loadfile_envcall", "loadstring_envcall",
"permanent", "print_table", "rangeMapLookup", "rnc",
"strict_declare_global", "table_length", "unpermanent", "values",
"serialize", "array_join", "shallow_clone", "staff_initials_cache",
"hasBit", "bitOr", "inspect",
-- Game classes
"AIHospital", "AnimationManager", "AnimationEffect", "App", "Audio",
"CallsDispatcher", "Cheats", "ChildClass", "Command", "Door", "DrawFlags",
"DummyRootNode", "Earthquake", "EndConditions", "Entity", "EntityMap",
"Epidemic", "FileSystem", "FileTreeNode", "FilteredFileTreeNode", "GameUI",
"Graphics", "GrimReaper", "Hospital", "Humanoid", "HumanoidRawWalk",
"Inspector", "LoadGame", "LoadGameFile", "Litter", "Machine",
"Map", "MoviePlayer", "NoRealClass", "Object", "ParentClass",
"Patient", "Plant", "PlayerHospital", "Queue", "ResearchDepartment", "Room",
"SaveGame", "SaveGameFile", "Staff", "StaffProfile", "StaffRoom",
"Strings", "SwingDoor", "TheApp", "TreeControl", "Vip", "Window",
"World", "Date", "Doctor", "Handyman", "Nurse", "Receptionist",
-- UI
"UI", "UIAdviser", "UIAnnualReport", "UIAudio", "UIBankManager",
"UIBottomPanel", "UIBuildRoom", "UICallsDispatcher", "UICasebook",
"UICheats", "UIChooseFont", "UIConfirmDialog", "UICustomCampaign",
"UICustomGame", "UICustomise", "UIDirectoryBrowser", "UIDropdown",
"UIEditRoom", "UIFax", "UIFileBrowser", "UIFolder", "UIFullscreen",
"UIFurnishCorridor", "UIGraphs", "UIHireStaff", "UIHotkeyAssign",
"UIHotkeyAssignKeyPane", "UIInformation", "UIJukebox", "UILoadGame",
"UILoadMap", "UILuaConsole", "UIMachine", "UIMakeDebugPatient",
"UIMainMenu", "UIMapEditor", "UIMenuBar", "UIMenuList",
"UIMessage", "UINewGame", "UIOptions", "UIPatient",
"UIPlaceObjects", "UIPlaceStaff", "UIPolicy", "UIProgressReport",
"UIQueue", "UIQueuePopup", "UIResizable", "UIResearch",
"UIResolution", "UISaveGame", "UISaveMap", "UIScrollSpeed",
"UIShiftScrollSpeed", "UIStaff", "UIStaffManagement", "UIStaffRise",
"UITipOfTheDay", "UITownMap", "UIUpdate", "UIWatch", "UIZoomSpeed",
-- Actions
"AnswerCallAction", "CallCheckPointAction", "CheckWatchAction",
"DieAction", "FallingAction", "GetUpAction", "HumanoidAction",
"IdleAction", "IdleSpawnAction", "KnockDoorAction", "MeanderAction",
"MultiUseObjectAction", "OnGroundAction", "PeeAction",
"PickupAction", "QueueAction", "SeekReceptionAction",
"SeekRoomAction", "SeekStaffRoomAction", "SeekToiletsAction",
"ShakeFistAction", "SpawnAction", "StaffReceptionAction",
"SweepFloorAction", "TapFootAction", "UseObjectAction",
"UseScreenAction", "UseStaffRoomAction", "VaccinateAction",
"VipGoToNextRoomAction", "VomitAction", "WalkAction", "YawnAction",
-- Math extensions
"math.n_random", "math.round", "math.randomdump", "math.t_random",
-- Unit Tests
"assertion_matches"
}
-- Set standard globals
files["CorsixTH/Luatest"] = {std = "+busted"}
codes = true -- Show warning codes
max_line_length = false -- No maximum line length
unused_args = false -- Permit unused arguments
-- Exclude files and directories
exclude_files = {"CorsixTH/Bitmap", "CorsixTH/Lua/api_version.lua", "LDocGen"}
--! Helper function to add an ignore for a filename to 'files'.
--!param filename (str) Name of the file to add an ignore.
--!param value Ignore value to add.
local function add_ignore(filename, value)
ignores = files[filename]
if not ignores then
files[filename].ignore = {value}
else
ignores[#ignores + 1] = value
files[filename].ignore = ignores
end
end
-- For languages, ignore
-- W111: setting non-standard global variable XYZ
-- W112: mutating non-standard global variable XYZ
-- W113: accessing undefined variable XYZ
-- W314: value assigned to field XYZ is unused
for _, lng in ipairs({"brazilian_portuguese", "czech", "danish", "developer",
"dutch", "english", "finnish", "french", "german", "greek", "hungarian",
"iberic_portuguese", "italian", "korean", "norwegian", "original_strings",
"polish", "russian", "simplified_chinese", "spanish", "swedish", "ukrainian",
"traditional_chinese"}) do
local filename = "CorsixTH/Lua/languages/" .. lng .. ".lua"
add_ignore(filename, "111")
add_ignore(filename, "112")
add_ignore(filename, "113")
add_ignore(filename, "314")
end
-- Ignore unused functions of save game compatibility
add_ignore("CorsixTH/Lua/app.lua", "app_confirm_quit_stub")
add_ignore("CorsixTH/Lua/dialogs/bottom_panel.lua", "stub")
add_ignore("CorsixTH/Lua/dialogs/fullscreen/research_policy.lua", "adjust")
add_ignore("CorsixTH/Lua/dialogs/fullscreen/research_policy.lua", "less_stub")
add_ignore("CorsixTH/Lua/dialogs/fullscreen/research_policy.lua", "more_stub")
add_ignore("CorsixTH/Lua/dialogs/resizables/options.lua", "language_button")
add_ignore("CorsixTH/Lua/dialogs/resizables/options.lua", "width_textbox_reset")
add_ignore("CorsixTH/Lua/dialogs/resizables/options.lua", "height_textbox_reset")
add_ignore("CorsixTH/Lua/entities/machine.lua", "callbackNewRoom")
add_ignore("CorsixTH/Lua/entities/machine.lua", "repair_loop_callback")
add_ignore("CorsixTH/Lua/entities/humanoids/patient.lua", "callbackNewRoom")
add_ignore("CorsixTH/Lua/entities/humanoids/staff.lua", "callbackNewRoom")
add_ignore("CorsixTH/Lua/humanoid_actions/vip_go_to_next_room.lua", "action_vip_go_to_next_room_end")
add_ignore("CorsixTH/Lua/rooms/operating_theatre.lua", "after_use")
add_ignore("CorsixTH/Lua/rooms/operating_theatre.lua", "wait_for_ready")