Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Luacheck
Started by tap32 Dec 17 2018 02:42 AM

- - - - -
No replies to this topic
linter luacheck
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

tap32

[GLOBAL: userInfoPane.html]
tap32
  • Contributor

  • 232 posts
  • Corona SDK

In case anyone else is interested in using the luacheck linter, here's my .luacheckrc file which I add to my projects. It defines the Corona SDK globals so that luacheck doesn't complain about them. One immediate benefit from using luacheck (I use the SublimeLinter and SublimeLinter-luacheck plugins in Sublime Text) is that it highlights accidental globals and unused definitions. 

 

local coronaAPI = {
  'audio',
  'display',
  'easing',
  'graphics',
  'lfs',
  'media',
  'native',
  'network',
  'Runtime',
  'system',
  'timer',
  'transition',
  'print',
  'require',
  'package'
 }
 
max_line_length = false
 
stds.corona = {
   read_globals = coronaAPI   -- these globals can only be accessed.
}
 
std = "lua51+corona"

  • Michael Flad likes this


[topic_controls]
[/topic_controls]