There are still Lua files which mix both spaces and tabs...
[!] Note: Document on Google's docs for Wire's coding style seems to be gone!
So, how about someone fix that?
I'm working on the cleanup, including getting luacheck to pass.
Make sure that cleanup is a process, not a one-time change.
Otherwise you will conflict with new changes that came in since you pulled.
Yes, I understand. I know how to merge against those changes if that happens, but I know it's better to do it sparingly.
what i was saying is that you should make it a script that formats our code properly
regex is such a pain in the butt, but fine.
I can do quick Regex program to do full cleanup, the problem is, merging I guess.
It would also replace all Garry's custom operators with Lua's (including C comments), etc.
Edit: But, does anyone know what happened to that Google document?
why regex? use astyle or something
Consider this:
if (!(one && two) || !(three)) then
return;
end
Yes, this is an example of an if-block found in the source.
But this needs to be stripped to
if not (one and two) or not three then return end
Well, converting gmod lua syntax to standard lua syntax is nothing a code formatter will do. I guess you can do that with a regex. Make sure you don't catch strings :)
Btw did you take a look at astyle yet?
Yes, but astyle doesn't do lua.
The contents of the Google doc is now on the existing code style wiki page.
cool, thanks @AbigailBuccaneer