Skip to content
This repository was archived by the owner on Aug 6, 2023. It is now read-only.

sqflint works with all files, linter error with 1 specific file #50

Open
TheLukio opened this issue Nov 27, 2018 · 3 comments
Open

sqflint works with all files, linter error with 1 specific file #50

TheLukio opened this issue Nov 27, 2018 · 3 comments

Comments

@TheLukio
Copy link

TheLukio commented Nov 27, 2018

Hey there. First of all thanks for providing this useful tool! Unfortunately recently I'm having a really weird issue. After updating Python to 3.7 and installing the newest version of sqflint with "pip install sqflint", I get a an error message whenever opening one specific SQF file. It works fine with all SQF files, new or old ones. Is something wrong with this file - is it somehow corrupted?

I've checked my path variables and everything looks as it should be and it works fine when creating a new SQF file (as a test).

[Linter] Error running SQFlint Error: Traceback (most recent call last): File "d:\program files\python\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "d:\program files\python\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "D:\Program Files\Python\Scripts\sqflint.exe\__main__.py", line 9, in <module> File "D:\Program Files\Python\Scripts\sqflint.py", line 113, in main sys.exit(entry_point(sys.argv[1:])) File "D:\Program Files\Python\Scripts\sqflint.py", line 91, in entry_point analyze(code, writer, exceptions_list) File "D:\Program Files\Python\Scripts\sqflint.py", line 26, in analyze exceptions = sqf.analyzer.analyze(result).exceptions File "d:\program files\python\lib\site-packages\sqf\analyzer.py", line 545, in analyze analyzer.execute_code(file, extra_scope={'_this': arg}) File "d:\program files\python\lib\site-packages\sqf\analyzer.py", line 203, in execute_code self.execute_unexecuted_code(key) File "d:\program files\python\lib\site-packages\sqf\analyzer.py", line 183, in execute_unexecuted_code namespace_name=container.namespace_name, delete_mode=True) File "d:\program files\python\lib\site-packages\sqf\analyzer.py", line 197, in execute_code outcome = super().execute_code(code, extra_scope, namespace_name) File "d:\program files\python\lib\site-packages\sqf\base_interpreter.py", line 177, in execute_code token = self.execute_token(statement) File "d:\program files\python\lib\site-packages\sqf\analyzer.py", line 150, in execute_token result = self.execute_single(statement=token) File "d:\program files\python\lib\site-packages\sqf\analyzer.py", line 373, in execute_single t = self.execute_token(token) File "d:\program files\python\lib\site-packages\sqf\analyzer.py", line 150, in execute_token result = self.execute_single(statement=token) File "d:\program files\python\lib\site-packages\sqf\analyzer.py", line 373, in execute_single t = self.execute_token(token) File "d:\program files\python\lib\site-packages\sqf\analyzer.py", line 150, in execute_token result = self.execute_single(statement=token) File "d:\program files\python\lib\site-packages\sqf\analyzer.py", line 412, in execute_single outcome = return_type() TypeError: __init__() missing 1 required positional argument: 'condition' at ChildProcess.<anonymous> (C:\Users\lukio\.atom\packages\linter-sqf\node_modules\sb-exec\lib\index.js:56) at emitTwo (events.js:126) at ChildProcess.emit (events.js:214) at maybeClose (internal/child_process.js:925) at Socket.stream.socket.on (internal/child_process.js:346) at emitOne (events.js:116) at Socket.emit (events.js:211) at Pipe._handle.close [as _onclose] (net.js:554)

@TheLukio TheLukio changed the title sqflint works with new file, error with old file sqflint works with all files, linter error with 1 specific file Nov 27, 2018
@TheLukio
Copy link
Author

Small addendum:

The one main difference I can see when comparing to other SQF script is that this file uses several instances of "_caller" and "_target" within an array that is used as a variable for a call to the funciton BIS_fnc_holdActionAdd. I remember that the SQFLint had some issues with magic variables, could this be such an issue?

@LordGolias
Copy link
Owner

Could you paste the SQF file that fails so that we can try to reproduce the error? It seems that is not a Python 3.7, but rather an actual bug in SQLLinter.

@TrainDoctor
Copy link

I am encountering an issue with pretty a similar series of errors.
https://gist.github.com/thecogdoctor/85d2c553f3c831d0d5d24feb3027917b
I am using the sqf_linter.py script from the ACE3 tools folder.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants