mpeterv / luacheck

A tool for linting and static analysis of Lua code.
MIT License
1.92k stars 322 forks source link

max line length count is in bytes, should be in characters #115

Closed agladysh closed 7 years ago

agladysh commented 7 years ago
$ cat english.lua 
-- luacheck: max line length 80
print('0123456789A0123456789B0123456789C0123456789D0123456789E0123456789F01234')

$ cat russian.lua 
-- luacheck: max line length 80
print('0123456789А0123456789Б0123456789В0123456789Г0123456789Д0123456789Е01234')

$ luacheck english.lua russian.lua 
Checking english.lua                              OK
Checking russian.lua                              1 warning

    russian.lua:2:1: line is too long (86 > 80)

Total: 1 warning / 0 errors in 2 files

$ luacheck --version
Luacheck: 0.20.0
Lua: Lua 5.1
LuaFileSystem: LuaFileSystem 1.6.3
LuaLanes: 3.10.1
agladysh commented 7 years ago

NB: http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ if all what you want to do is count characters.

mpeterv commented 7 years ago

Part of #45, I hope to get around to implementing it finally.