Page 2 of 2

Re: Find globals with LuaJIT (Linux, probably Mac too)

Posted: Tue Jun 11, 2019 9:21 pm
by raidho36
Karai17 wrote: Tue Jun 11, 2019 4:07 pm the underscore method is idiomatic Lua
It is, but it's not optional which makes it not fine.

Re: Find globals with LuaJIT (Linux, probably Mac too)

Posted: Wed Jun 12, 2019 2:16 am
by Karai17
It is absolutely optional, you can ignore the linter. The linter's job is to help you write idiomatic code. If you don't want to, then don't use a linter or just ignore the rules you don't care to follow. At no point does luacheck change your code, it only informs you of issues it finds.

Re: Find globals with LuaJIT (Linux, probably Mac too)

Posted: Wed Jun 12, 2019 11:14 am
by raidho36
Karai17 wrote: Wed Jun 12, 2019 2:16 am It is absolutely optional, you can ignore the linter. The linter's job is to help you write idiomatic code. If you don't want to, then don't use a linter or just ignore the rules you don't care to follow. At no point does luacheck change your code, it only informs you of issues it finds.
Not handling unused variables in an exact and very specific, arbitrarily decided way the linter prescribes it, is not a thing to be reported as an issue. It's as if a C++ linter enforced that each bracket must be on a newline and threw warnings otherwise. It is idiomatic but it's in no way a "correct and only fashion" to write code. It's just bad design, and the reasons why it's made like that are less of a reasons and more of an excuses; one should be fixing problems instead of finding justifications for their existence - my 2 cents.