Did you install the sublimeLinter package, which my sublimelinter-contrib-glualint depends on?
[QUOTE=FPtje;48631138]
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 didn't know for _,v in pairs was a thing, and I might start training myself to do that (Is it even better processing wise?) I think a toggling checking the k,v variables would be good.
[QUOTE=blindsighterr;48632980]I didn't know for _,v in pairs was a thing, and I might start training myself to do that (Is it even better processing wise?) I think a toggling checking the k,v variables would be good.[/QUOTE]
In python it saves memory; in Lua it's just cleaner.
It's a shame that Lua doesn't have a "values" iterator.
[lua]
for ply in values(ply.GetAll()) do
ply:Kill()
end
[/lua]
Of course it's really easy to make yourself, but it would have been a lot better if it was in Lua by default, like pairs, next and ipairs are.
edit:
Version 1.2.3 of glualint disables for loop var checking by default.
[url]https://github.com/FPtje/GLuaFixer/releases[/url]
edit:
The recode went faster than I though.
Version 1.3.0 of glualint fixes the RAM eating.
[url]https://github.com/FPtje/GLuaFixer/releases[/url]
Oh my god pretty print adds missing end statements, I love you and this package. Thank you!
What does this error mean?
[IMG]http://i.imgur.com/X46FCGY.png[/IMG]
[IMG]http://i.imgur.com/MANf5ha.png[/IMG]
isAllowed is initially defined, sometimes redefined, and used in the script.
EDIT:-snip, thanks for the funnies :D-
[QUOTE=blindsighterr;48691434]What does this error mean?
[IMG]http://i.imgur.com/X46FCGY.png[/IMG]
[IMG]http://i.imgur.com/MANf5ha.png[/IMG]
isAllowed is initially defined, sometimes redefined, and used in the script.
EDIT: I figured it out.
[CODE]
if foo then
if bar then
end
end
[/CODE]
Should be
[CODE]
if foo and bar then
end
[/CODE]
Thank you based Falco.[/QUOTE]
It actually means that your scope depth (amount of blocks within blocks) is too high.
[lua]
-- scope depth 0
if a then
-- scope depth 1
if b then
-- scope depth 2
if c then
-- scope depth 3
end
end
end
[/lua]
I'm a moron, but what actually is this for?
No idea what a linter provides, function wise.
[QUOTE=Pantho;48704177]I'm a moron, but what actually is this for?
No idea what a linter provides, function wise.[/QUOTE]
If you meant you don't know what a linter does, which you probably do but I'll be helpful anyway:
A linter goes through segments of code and checks for "lint" (portions that could be bugs or common errors) and flags them as it continues to read over your code.
In this case, it checks for things like missing end statements, deprecated functions, awkward negation statements, unused variables, etc. and highlights them for you. Very helpful!
If you do know:
It's super helpful for me in particular because I'm not the greatest with code organization and usually make small errors like missing end statements or have weird negation (like I might use ! somewhere and then use 'not' somewhere else), and it fucking insults me when I have lots of conditions to check and makes me search for a better way to combine conditions and optimize my giant 'if' blocks.
[QUOTE=Z0mb1n3;48704433]If you meant you don't know what a linter does, which you probably do but I'll be helpful anyway:
A linter goes through segments of code and checks for "lint" (portions that could be bugs or common errors) and flags them as it continues to read over your code.
In this case, it checks for things like missing end statements, deprecated functions, awkward negation statements, unused variables, etc. and highlights them for you. Very helpful!
If you do know:
It's super helpful for me in particular because I'm not the greatest with code organization and usually make small errors like missing end statements or have weird negation (like I might use ! somewhere and then use 'not' somewhere else), and it fucking insults me when I have lots of conditions to check and makes me search for a better way to combine conditions and optimize my giant 'if' blocks.[/QUOTE]
That, was an extremely helpful reply thanks.
And yea, pretty much had no idea what a linter did, makes sense now. This could be handy for myself, I'm a terrible coder and have the same organization issues as you when it comes to silly small errors. Could be very helpful for a friend of mine who nests if statements way to much as well.
@zerf for dumb rating: It is NEVER dumb to ask what something is/means etc. If you don't know what something is, you ask or you don't learn. I've friends who constantly ask what things or words mean, they might not be the brightest bunch of folk but they certainly get respect for asking instead of being one of the ignorant fuckwits who pretend to know and keep silent.
[QUOTE=Pantho;48705363]@zerf for dumb rating: It is NEVER dumb to ask what something is/means etc. If you don't know what something is, you ask or you don't learn. I've friends who constantly ask what things or words mean, they might not be the brightest bunch of folk but they certainly get respect for asking instead of being one of the ignorant fuckwits who pretend to know and keep silent.[/QUOTE]
I occasionally rate people dumb who ask for the definition of a tech term because it clutters the forum and wastes time. It is much simpler to use google ("define <term>", "what is a <term") as opposed to waiting for a reply in the forum.
[QUOTE=zerf;48715644]I occasionally rate people dumb who ask for the definition of a tech term because it clutters the forum and wastes time. It is much simpler to use google ("define <term>", "what is a <term") as opposed to waiting for a reply in the forum.[/QUOTE]
That depends, sometimes if I can't get my mind around something asking someone who can explain is much more useful than reading someone's definition for 8 years ago.
I don't understand how to add glualint.exe to my PATH.
What's meant by PATH?
Sorry for the dumb question, but I just don't understand this :x
[QUOTE=FPtje;48809483][url]https://en.wikipedia.org/wiki/PATH_(variable)[/url][/QUOTE]
I'm seeing this the firs ttime. The path to sublime is C:\Program Files (x86)\Sublime Text 3.
So why can't I just drop glualint.exe in this folder?
[QUOTE=P4sca1;48809670]I'm seeing this the firs ttime. The path to sublime is C:\Program Files (x86)\Sublime Text 3.
So why can't I just drop glualint.exe in this folder?[/QUOTE]
Open a command prompt
enter "glualint --version"
Does it say "unknown command"?
If yes, add the location of glualint to path to not make it an unknown command.
Adding glualint to PATH is a step required for both atom AND sublime. In itself it has nothing to do with those editors besides the fact that they require it to work.
Listen, it's not going to work if you don't add the location of glualint to the path. All of your questions can be answered using Google. Please use that.
Also, 1.4.5 is out with quite a few fixes.
[url]https://github.com/FPtje/GLuaFixer/releases[/url]
[QUOTE=FPtje;48811668]Open a command prompt
enter "glualint --version"
Does it say "unknown command"?
If yes, add the location of glualint to path to not make it an unknown command.
Adding glualint to PATH is a step required for both atom AND sublime. In itself it has nothing to do with those editors besides the fact that they require it to work.
Listen, it's not going to work if you don't add the location of glualint to the path. All of your questions can be answered using Google. Please use that.
Also, 1.4.5 is out with quite a few fixes.
[url]https://github.com/FPtje/GLuaFixer/releases[/url][/QUOTE]
I added it to my PATH, restartet my computer and it still does no work.
flualint --version is printing the current version in my cmd, so that works.
I followed all the steps, what have I missed?
[QUOTE=P4sca1;48815360]I added it to my PATH, restartet my computer and it still does no work.
flualint --version is printing the current version in my cmd, so that works.
I followed all the steps, what have I missed?[/QUOTE]
With glualint in PATH, the most difficult bit should be out of the way. In both sublime and atom you need to install [B]two[/B] packages. Sublime: SublimeLinter AND sublimelinter-contrib-glualint. Atom: [url=https://atom.io/packages/linter]linter[/url] and linter-glualint.
Also, make sure the syntax of your files is set to (GMod) Lua. Both atom nor sublime will refuse to lint anything that's not a Lua file.
Also, I updated the FAQ:
[highlight]FAQ[/highlight]
[B]Q: [/B] IT DOESN'T WORK
[B]A: [/B] YOU FAILED TO ADD THE EXECUTABLE TO THE PATH. TRY AGAIN.
[B]A: [/B] If you're REALLY sure that glualint is in path, make sure you have the right packages installed (SublimeLinter and SublimeLinter-contrib-glualint for sublime, linter and linter-glualint for atom)
[B]A: [/B] If it STILL doesn't work, at least in sublime you can debug the linter. [I]Ctrl + shift + P -> SublimeLinter debug -> SublimeLinter: Enable Debug Mode[/I]. Then open the console (view -> Show Console) and look for any errors.
[QUOTE=FPtje;48815510]With glualint in PATH, the most difficult bit should be out of the way. In both sublime and atom you need to install [B]two[/B] packages. Sublime: SublimeLinter AND sublimelinter-contrib-glualint. Atom: [url=https://atom.io/packages/linter]linter[/url] and linter-glualint.
Also, make sure the syntax of your files is set to (GMod) Lua. Both atom nor sublime will refuse to lint anything that's not a Lua file.
Also, I updated the FAQ:
[highlight]FAQ[/highlight]
[B]Q: [/B] IT DOESN'T WORK
[B]A: [/B] YOU FAILED TO ADD THE EXECUTABLE TO THE PATH. TRY AGAIN.
[B]A: [/B] If you're REALLY sure that glualint is in path, make sure you have the right packages installed (SublimeLinter and SublimeLinter-contrib-glualint for sublime, linter and linter-glualint for atom)
[B]A: [/B] If it STILL doesn't work, at least in sublime you can debug the linter. [I]Ctrl + shift + P -> SublimeLinter debug -> SublimeLinter: Enable Debug Mode[/I]. Then open the console (view -> Show Console) and look for any errors.[/QUOTE]
The problem was, that Sublime wasn't opening Lua Files with GLua as the Syntax.
View -> Syntax -> Open all with current extension as... -> GLua
Now everything is working fine. Thanks for your support! :)
Sorry to bump, but the trailing whitespace errors can be a bit annoying. Would it be possible to make it into an option?
[IMG]http://i.imgur.com/XyYSSlB.png[/IMG]
Yes, download [url=https://github.com/FPtje/GLuaFixer/releases]glualint.json[/url] from the releases page, place it in some folder above your project (or in your home folder) and change the lint_whitespaceStyle option to false.
[QUOTE=Viltsuuu;49196592]Sorry to bump, but the trailing whitespace errors can be a bit annoying. Would it be possible to make it into an option?
[IMG]http://i.imgur.com/XyYSSlB.png[/IMG][/QUOTE]
Did you read the instructions?
[url]https://github.com/FPtje/GLuaFixer[/url]
[img]http://puu.sh/lAEGQ/0098ae1fc6.png[/img]
[QUOTE=FPtje;49197517]Yes, download [url=https://github.com/FPtje/GLuaFixer/releases]glualint.json[/url] from the releases page, place it in some folder above your project (or in your home folder) and change the lint_whitespaceStyle option to false.[/QUOTE]
I missed the setting in the JSON somehow :v:
Thank you:smile:
EDIT: Setting the whitespace style to false did nothing about the thing with trailing whitespaces
[IMG]http://i.imgur.com/eb9DlvZ.png[/IMG]
Oh, that one isn't covered by any options. Will be fixed in next version.
Edit: fixed.
[url]https://github.com/FPtje/GLuaFixer/releases[/url]
Also, RIP OSX builds. The virtual machine won't log in anymore.
You sir are welcome to a free blowjob
[QUOTE=FPtje;49199256]Oh, that one isn't covered by any options. Will be fixed in next version.
Edit: fixed.
[url]https://github.com/FPtje/GLuaFixer/releases[/url]
Also, RIP OSX builds. The virtual machine won't log in anymore.[/QUOTE]
Thanks!:)
Maybe a bit unrelated, but is there anyway to add text to the top of every file in a folder?
On a side note, I've noticed that it sucks up quite a bit of memory when my sublime is left on for a while.
EDIT: Shit, forgot it wasn't updated on my main pc, updating now.
[QUOTE=kpjVideo;49494105]Maybe a bit unrelated, but is there anyway to add text to the top of every file in a folder?[/QUOTE]
if this is some
--[[
HI THIS SCRIPT WAS MADE BY POODUDE42 PLS DONT STEAL
--]]
then please don't do this.
if it's real code that you don't want to manually type, then here:
batch script (all hail ballmer):
[code]
@echo off
for /r %%F in (*.YOUREXTENSION) do (
echo "YOURTEXTHERE" >> "%%F_"
type "%%F" >> "%%F_"
del "%%F"
ren "%%F_" "%%~nxF"
)
pause
[/code]
replace YOUREXTENSION with whatever extension (lua, txt) and YOURTEXTHERE with the text you want to prepend.
Sorry, you need to Log In to post a reply to this thread.