Home

Awesome

Luacheck for Nova

This is an extension for the Nova code editor which integrates the Luacheck analyzer and linter for Lua code and shows its warnings and errors directly in Nova.

A screenshot of Luacheck for Nova in action

Installation

First, install Luacheck, if you haven't already. It's recommended that you install a version which corresponds to the version of Lua used in your project (it may be possible to specify a particular instance/version of Luacheck to use on a per-project basis in the future but that is not currently supported). Luacheck can be installed with MacPorts or with Luarocks directly. This extension will try to find Luacheck in the normal search paths configured for your user, so make sure the path to Luacheck is in your $PATH such that opening up a new shell and typing luacheck gets you something other than a "command not found" error.

Next, install this extension. Inside Nova, select "Extension Library…" from the "Extensions" menu and search for "Luacheck." Click the "Install" button when this extension appears.

Configuration

You can create a .luacheckrc configuration file for your projects. The file itself should be written in Lua and can be located in you project's root folder (which is the default location this extension will use), or you can create it in the Lua file's folder itself and enable the option Run Luacheck from the source file's folder in your project's settings in Nova. Of particular interest is the std value which can be set to specify one or more standards which, for example, can stop globals defined by certain frameworks from being flagged by Luacheck. For example, for the LÖVE game framework, use std="luajit+love" to stop Luacheck from throwing warnings about accessing the love global from your code. See the "Configuration file" and "Command line options" sections of Luacheck's documentation for more information.

You can turn off logging of debug messages to the extension console in the extension's preferences in Nova.

Troubleshooting

If you are getting an error on the first line of your document which says "Luacheck utility not found; see Luacheck Nova extension documentation," then you need to install Luacheck on your system. If you open a terminal window, enter luacheck, and get something along the lines of a "command not found" error message, then either Luacheck is not installed or it's not located in your $PATH. See the "Installation" section above.

If you're not seeing any errors or warnings in the editor even when you're sure you should see some, check the following.

TODO & missing features

License & legal matters

This project is open source under the 2-clause BSD license. See the LICENSE file for the full text of the license.

The Lua logo was created by Alexandre Nakonechnyj. Copyright © 1998 Lua.org.