LordGolias/linter-sqf

Variable _fnc_scriptName is not declared in scope

Closed this issue · 3 comments

Reproduce

  1. Go in a function that is using the CfgFunctions framework
  2. Use variable fnc_scriptName
  3. Will say that it is not declared in scope even though it is declared in that scope when using CfgFunctions framework

I know this can be a tricky subject since some people may not be using the CfgFunctions framework.

Hi @SimZor, I am not familiar with CfgFunctions framework. Is it used by including a file #include, which defines some functions, (e.g. fnc_scriptName)?

No, it is not. It compiles a function and then adds the "magic variable" _fnc_scriptName and _fnc_scriptNameParent to it.

See https://community.bistudio.com/wiki/Functions_Library_(Arma_3)#Adding_a_Function for information.

I will close it here because this is not about the linter for atom, but the analyzer written in Python.

We currently do not access conf files, so there is no way to check whether that function exists. The convention we are using is that if the variable starts with upper case (e.g. BIS_, ACE_), then is a global and is defined elsewhere (and is thus not flagged)