• glualint - Linter for Garry's mod Lua
    87 replies, posted
[QUOTE=Pheron;48562700]If that doesn't work, you might want to try adding a backward slash, changing it to "C:\servers\glualint\". I've personally had issues like that before with the Java JDK and adding the backward slash seemed to fix it.[/QUOTE] It does work now. I just needed to restart my pc
The linter seems to hate decimals like this: .1337
[QUOTE=Tenrys;48566849]The linter seems to hate decimals like this: .1337[/QUOTE] Yes, fixed in latest (1.1.3). If you wait about a day I'll upload 1.1.4 with some more fixes. [url]https://github.com/FPtje/GLuaFixer/issues[/url] edit: [url=https://github.com/FPtje/GLuaFixer/releases]1.1.4 is out[/url]
Got this error on launching glualint.exe [IMG]http://i.imgur.com/rn8C9n2.png[/IMG] "The version of this file is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need an x86 (32bit) or x64 (64bit) version of the program, and then contact the software publisher." Windows 7 32bit [x86] PATH: [IMG]http://i.imgur.com/HH0LPsU.png[/IMG]
I compiled glualint on a 64 bits Windows. Why are you running a 32 bits Windows anyway?
[QUOTE=FPtje;48573944]I compiled glualint on a 64 bits Windows. Why are you running a 32 bits Windows anyway?[/QUOTE] I'm too lazy to reinstall windows :/
Are you using 3gb ram? this is using 5.8gb in my pc right now (Tf2 it's on menu state) [t]https://dl.dropboxusercontent.com/s/gczl821vwvl8mxm/2015-09-01_13-33-44.jpg?dl=0[/t]
[QUOTE=gonzalolog;48593369]Are you using 3gb ram? this is using 5.8gb in my pc right now (Tf2 it's on menu state) [t]https://dl.dropboxusercontent.com/s/gczl821vwvl8mxm/2015-09-01_13-33-44.jpg?dl=0[/t][/QUOTE] Sorry to derail but here's more evidence to why one needs 64bit: [IMG]http://thed3vine.net/s/def3b6.png[/IMG] In the main menu. That's ridiculous.
[QUOTE=gonzalolog;48593369]Are you using 3gb ram? this is using 5.8gb in my pc right now (Tf2 it's on menu state) [t]https://dl.dropboxusercontent.com/s/gczl821vwvl8mxm/2015-09-01_13-33-44.jpg?dl=0[/t][/QUOTE] I don't know whether my program is using 3GB on your pc. Please, you tell me.
[QUOTE=gonzalolog;48593369]Are you using 3gb ram? this is using 5.8gb in my pc right now (Tf2 it's on menu state) [t]https://dl.dropboxusercontent.com/s/gczl821vwvl8mxm/2015-09-01_13-33-44.jpg?dl=0[/t][/QUOTE] Windows 10 uses a fuck ton of memory compared to older OS's, I had to downgrade due to it. [B]Edit:[/B] Memory leaks. Reinstalled drivers and attempted other methods to fix, it did not fix.
If it's my program, it'll be when you have a very specific file open. If anything is slow in my program, it's [I]probably[/I] the parser, which is amazing in many ways, but seriously not great in the performance department. The worst I've gotten so far is glualint taking about 0.8 seconds to lint a 1000 line file. If you find a file that makes glualint.exe spike to 3GB RAM, please send it to me so I can figure out what's wrong.
I would love to use this (even though I've grown custom to notepad++) But the largest reason I haven't because a lot of the code I have in my current addons are copy/pasted from things I've made 5 years ago, and over time I have changed a lot of my habits. So I'd be forced to correct all my inconsistencies :v:
[url=https://github.com/FPtje/linter-glualint][B]Now released for Atom! :D[/B][/url]
Atom is a pretty nice program, and I've been a bit on the fence about it since it doesn't open near as fast compared to notepad++. I think i'll get it now that I see this.
Alright, so I just installed atom and this thing... and it doesn't work. I know it's been added to %PATH% because typing in glualint in CMD doesn't come out as an invalid command. I also notice that the code isn't being highlighted, so am I missing something? [editline]5th September 2015[/editline] So apparently only linting on save works. [IMG]http://puu.sh/k0KkL/8f7c42a3bd.png[/IMG] Oh boy... [editline]5th September 2015[/editline] Found a bug [IMG]http://puu.sh/k0KRx/897c17d5fc.png[/IMG] [editline]5th September 2015[/editline] Hidden line is "while #matches > 0 do" [editline]5th September 2015[/editline] [lua] local matches = {string.gmatch(message, "({{IMG:([^:]*):([^:]*):IMG}})")()} --WHY DOES string.gmatch RETURN A FUNCTION INSTEAD OF A TABLE? WHY DO I HAVE TO CALL THAT FUNCTION TO MAKE A TABLE MYSELF?! while #matches > 0 do message = string.Replace(message, matches[1], "{{IMGDATA:"..util.Base64Encode(file.Read(matches[2],"DATA"))..":"..util.Base64Encode(file.Read(matches[3],"DATA"))..":IMGDATA}}") matches = {string.gmatch(message, "({{IMG:([^:]*):([^:]*):IMG}})")()} end [/lua] [editline]5th September 2015[/editline] STOP YELLING AT ME! I DO USE THOSE VARIABLES! ;_; [IMG]http://puu.sh/k0LkA/4f46640f77.png[/IMG]
Is there any way to disable syntax checking in favor of using gluac to do it without having to recompile?
[QUOTE=AK to Spray;48620198]Is there any way to disable syntax checking in favor of using gluac to do it without having to recompile?[/QUOTE] Yes. With the [url=https://github.com/FPtje/GLuaFixer#configuring-glualint]lint_syntaxErrors option[/url] [editline]5th September 2015[/editline] [QUOTE=LegoGuy;48619914]BUGS N SHIT[/QUOTE] Looks like you're running 1.2.0. I've fixed some things in 1.2.1 and can't reproduce any of your bugs in that version. Except the one about running the linter in atom. It seems like the linter doesn't run when you open atom and look at the open files. Closing the open files and re-opening them seems to make it work. I don't know why that is.
I'm making a big table to hold a bunch info so because I haven't finished it yet it has multiple syntax errors spanning over a few hundred lines. Seems to be taking up all my memory because of that :P [img]http://i.imgur.com/GiL5nII.png[/img] Ending glualint.exe will bring System down to normal usage.
Please give me the lua file with which you have that issue. [QUOTE=YourStalker;48623626]I'm making a big table to hold a bunch info so because I haven't finished it yet it has multiple syntax errors spanning over a few hundred lines. Seems to be taking up all my memory because of that :P [img]http://i.imgur.com/GiL5nII.png[/img] Ending glualint.exe will bring System down to normal usage.[/QUOTE] Alright, you've given me the code in some PM. I couldn't reproduce it with that code, but it went haywire when I removed all '}'s at the end of every line of your table. The cause of the problem is exactly as I expected: It's the parser itself. Specifically, it's the parser library. The library has an awesome built in functionality that can [I]fix[/I] syntax errors. It does that by running a complicated algorithm that searches for ways to change the Lua script in such way that valid Lua comes out. When you ask that library to parse something, it will [B]always[/B] succeed, with some insertions and deletions if necessary. When you make too many syntax errors (or just the exact right ones), you upset that algorithm. You can change a script in an infinite amount of ways. You can probably guess that the algorithm is going down a path of inserting and removing things that [I]never[/I] actually brings up valid Lua. I highly doubt this is something I can fix directly, since I have no say whatsoever in how that algorithm works. The best luck I would have would be changing the order in which things are parsed, which is a hopeless endeavour to ever get right. What I perhaps [I]can[/I] do, is to stop the program when the library has found ten errors, stating that that is too many to continue with.
Oh god damnit it can't even figure out what the first error should be. edit: ugh, I just tried changing the order of the parser. It doesn't work. I was mistaken in my previous post in which I said the parser is going down an [I]infinite[/I] path. It isn't. Look at this code: [lua] dong = { ["1"] = {desc = "" ["2"] = {desc = "" ["3"] = {desc = "" ["4"] = {desc = "" ["5"] = {desc = "" ["6"] = {desc = "" ["7"] = {desc = "" ["8"] = {desc = "" ["9"] = {desc = "" ["10"] = {desc = "" ["11"] = {desc = "" ["12"] = {desc = "" ["13"] = {desc = "" ["14"] = {desc = "" } [/lua] Every line is missing a '}' and a ','. The good news is that this is exactly what the parser [url=http://i.imgur.com/tYSIU6v.png]finds and fixes those exact errors[/url] (don't mind the "get here" and "not here" debug messages). The bad news is that it finds it after [U]one full minute and four seconds[/U], using all of the 3GB of RAM I assigned to my virtual machine. When I halve the bad lines (i.e. remove values 8 up to 14 from the table), glualint finds it after only 12 seconds. The problem is that it performs a breadth search and not a depth search. Because you have many syntax errors, the valid Lua file is many fixes deep down in the tree. This tree grows exponentially and searching it breadth-first takes an exponential amount of time relative to the amount of syntax errors you make. In other words [B]The more syntax errors you make, the more time it will take and the more it will eat your RAM.[/B] The worst part? - I cannot disable it. It's part of the library and there's literally no way of controlling it. [url=http://stackoverflow.com/questions/20846429/performance-of-uu-parsinglib-compared-to-try-in-parsec]Here's the man, Doaitse Swierstra himself explaining it[/url] - I cannot move the order of parsing things around. breadth-first is breadth first and it doesn't give a shit about order because it tries everything anyway. - I canot easily make it stop early. I'd have to fuck with threads and that would fuck with parsing long, but correct Lua files. I'm going to have to let you down on this issue, for I have no control over it. My next big change in this linter is moving this the fuck to a different parser library. That parser library will probably be Parsec.
Is the linter checking part just for atom, or is it for sublime as well? If so, how would I use it?
I don't know if anyone has pointed this out yet. [IMG]http://i.imgur.com/ZPPxSRY.png[/IMG] I use k,v a lot in my scripts and glualint is bugging me about it. I rarely use k, but v is necessary. I know it isn't wrong, but perhaps add an exception to for loops with two stated values in the beginning?
yes i also get that and alot of trailing whitepaste
[QUOTE=Author.;48627996]Is the linter checking part just for atom, or is it for sublime as well? If so, how would I use it?[/QUOTE] Please read the text below the boldface "installation instructions for sublime" in the OP. [editline]7th September 2015[/editline] [QUOTE=blindsighterr;48629945]I don't know if anyone has pointed this out yet. [IMG]http://i.imgur.com/ZPPxSRY.png[/IMG] I use k,v a lot in my scripts and glualint is bugging me about it. I rarely use k, but v is necessary. I know it isn't wrong, but perhaps add an exception to for loops with two stated values in the beginning?[/QUOTE] I'm on the fence about this. Glualint isn't wrong. You declared a variable that you don't use. It's cleaner to use an iterator that only iterates over the values or just "for_, v in pairs" On the other hand, k and v are so ingrained that they specifically deserve an exception. What do you guys think?
[QUOTE=FPtje;48631138]Please read the text below the boldface "installation instructions for sublime" in the OP.[/QUOTE] Please read my question. I asked about the linter, not how to install it. Nowhere in your thread does it say how to use the linter in sublime, just the pretty printing, which works just fine.
[QUOTE=Author.;48631499]Please read my question. I asked about the linter, not how to install it. Nowhere in your thread does it say how to use the linter in sublime, just the pretty printing, which works just fine.[/QUOTE] The linter was originally made for Sublime. It should work with the given instructions.
[QUOTE=FPtje;48631138]Please read the text below the boldface "installation instructions for sublime" in the OP. [editline]7th September 2015[/editline] I'm on the fence about this. Glualint isn't wrong. You declared a variable that you don't use. It's cleaner to use an iterator that only iterates over the values or just "for_, v in pairs" On the other hand, k and v are so ingrained that they specifically deserve an exception. What do you guys think?[/QUOTE] I was actually just about to ask if there was an option to acknowledge/ignore the warnings because of that. Adding k,v and the loops inside (k2,v2/k3 and so on) as an exception would be amazing. If your still on the fence about it just add an option in the settings?
[QUOTE=FPtje;48631551]The linter was originally made for Sublime. It should work with the given instructions.[/QUOTE] So there's nothing I have to do to enable the linter? It's enable by default? If so, I don't have it, but pretty printing works just fine.
[QUOTE=Author.;48632035]So there's nothing I have to do to enable the linter? It's enable by default? If so, I don't have it, but pretty printing works just fine.[/QUOTE] It's only enabled in Lua files. Make sure syntax highlighting is enabled.
[QUOTE=FPtje;48632052]It's only enabled in Lua files. Make sure syntax highlighting is enabled.[/QUOTE] [img]http://i.imgur.com/cgPBSn4.png[/img]
Sorry, you need to Log In to post a reply to this thread.