SquidDev / illuaminate

Very WIP static analysis for Lua
https://squiddev.cc/illuaminate/
BSD 3-Clause "New" or "Revised" License
49 stars 2 forks source link

"Nitpick" linters #1

Open SquidDev opened 4 years ago

SquidDev commented 4 years ago

It'd be really nice to have a series of linters which nitpick about minor formatting. For instance, ensuring spaces are in the correct places, enforcing a variable name convention, etc... Ideally many of these could have automatic fixers too, allowing for a form of automatic error correction.

One thing bearing in mind is how to handle alignment within tables and assignments. For instance, ideally we'd require a single spaces around tokens, but allow for cases such as follows, where people are trying to align expressions up:

vx = vx + 1
x  = x  + 1
SquidDev commented 4 years ago

We check trailing whitespace on commas on 1a7300d7d05d0ef6f732f99006e04f833211abb0, but doing it generally is going to be harder. The token linter pass really needs a way to get the previous and next node, or at least their whitespace.