Skip to content

Sinaloit/linter-lua-globals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linter-lua-globals

luac — The luac program parses lua files. It can be used for detecting errors in lua code. See http://www.lua.org/manual/4.0/luac.html for more informations about luac.

This package will lint your .lua opened files in Atom using a script to find globals. It will lint on edit and/or save, so you'll see instantly if your code has globals you may not be expecting.

The script provided was created originally by Mikk and has been modified to work as a linter.

linter-lua-globals

Directives in the file:

The following directives in the file turn certain features off in the detection

-- GLOBALS: SomeGlobal, SomeOtherGlobal

  • The script will never complain about these. There may be multiple lines of these anywhere in the file, taking effect globally (for now). There is no way to un-GLOBAL an already declared global.

-- SETGLOBALFILE [ON/OFF]

  • Enable/disable SETGLOBAL checks in the global scope
    • Default: ON

-- SETGLOBALFUNC [ON/OFF]

  • Enable/disable SETGLOBAL checks in functions. This setting affects the whole file.
    • Default: ON

-- GETGLOBALFILE [ON/OFF]

  • Enable/disable GETGLOBAL checks in functions. This setting affects the whole file.
    • Default: OFF

-- GETGLOBALFUNC [ON/OFF]

  • Enable/disable GETGLOBAL checks in functions. This setting affects the whole file.
    • Default: ON

Linting Behaviors

  • GETGLOBAL occurrences will be marked as warnings
  • SETGLOBAL occurrences will be marked as errors

Linter Installation

Before using this package, you must ensure that lua and luac are installed on your system.

Installation

  • $ apm install linter (if you don't have AtomLinter/Linter installed).
  • $ apm install linter-lua-globals

Other available linters

About

AtomLinter that finds globals in lua files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published