-
Notifications
You must be signed in to change notification settings - Fork 739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQF Lint Cleanup Pass #5157
SQF Lint Cleanup Pass #5157
Conversation
@@ -115,7 +115,7 @@ addMissionEventHandler ["Draw3D", { // Blue is predicted before throw, red is re | |||
drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [0,0,1,1], _newTrajAGL, 1, 1, 0, "", 2]; | |||
} forEach GVAR(predictedPath); | |||
{ | |||
_newTrajAGL = _x; | |||
private _newTrajAGL = _x; | |||
drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [1,0,0,1], _newTrajAGL, 1, 1, 0, "", 2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could probably just use _x
here without _newTrajAGL
Oh, commy also opened the PRs for getDoorTurret and publicVariable. :D |
missed this 🤦♀️ |
Glad to know this was so helpful for ACE! Please share relevant issues to the SQF parser github page please so I can improve it. |
tools/sqf_linter.py
Outdated
|
||
for root, dirnames, filenames in os.walk('../addons' + '/' + args.module): | ||
for filename in fnmatch.filter(filenames, '*.sqf'): | ||
sqf_list.append(os.path.join(root, filename)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 space instead of 4 space indentation.
tools/sqf_linter.py
Outdated
for filename in sqf_list: | ||
warnings, errors = analyze(filename) | ||
all_warnings = all_warnings + warnings | ||
all_errors = all_errors + errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+=
tools/sqf_linter.py
Outdated
print("{}:".format(filename)) | ||
for e in exceptions: | ||
if (e.message.startswith("error")): | ||
errors = errors + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+=
tools/sqf_linter.py
Outdated
if (e.message.startswith("error")): | ||
errors = errors + 1 | ||
else: | ||
warnings = warnings + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+=
tools/sqf_linter.py
Outdated
|
||
for filename in sqf_list: | ||
warnings, errors = analyze(filename) | ||
all_warnings = all_warnings + warnings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+=
tools/sqf_linter.py
Outdated
except SQFParserError as e: | ||
print("{}:".format(filename)) | ||
writer.write(' [%d,%d]:%s\n' % (e.position[0], e.position[1] - 1, e.message)) | ||
return 0, -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason this returns a -1
for number of errors? I feel like it should be 0, but perhaps I'm missing something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1 used to mean error, but I changed it, thanks for catching
SQF Lint now has directory analyze option https://github.com/LordGolias/sqf/blob/92130853eadeec524ca641b2c4bde34f5fc18f52/sqflint.py with help of @PabstMirror 's script. It doesn't count the amount of warnings and errors as of now though. |
Did a quick pass with the SQF Lint tool. (https://github.com/LordGolias/sqf)
Most are just private cleanups which aren't a big deal, but it did find some actual errors.
_weapon
always existed from upper scope)