Tools - Check example funcs in document_functions.py (#9630)

This commit is contained in:
PabstMirror 2023-11-08 12:00:05 -06:00 committed by GitHub
parent 4fb9da7b08
commit 6bc5193a79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 36 additions and 19 deletions

View File

@ -20,7 +20,7 @@
* None
*
* Example:
* No
* None
*
* Public: No
*/

View File

@ -11,7 +11,7 @@
* The return value <BOOL>
*
* Example:
* [bob1, bob2] call ACE_captives_fnc_handlePlayerChange
* [bob1, bob2] call ACE_captives_fnc_handlePlayerChanged
*
* Public: No
*/

View File

@ -10,6 +10,7 @@
* None
*
* Example:
* [] call ace_dagr_fnc_menuInit
*
* Public: No
*/

View File

@ -13,7 +13,7 @@
* None
*
* Example:
* [FUNC(dialingPhone), 0.25, [_unit,4,_arr,_code]] call CALLSTACK(CBA_fnc_addPerFrameHandler);
* [ace_explosives_fnc_dialingPhone, 0.25, [_unit,4,_arr,_code]] call CBA_fnc_addPerFrameHandler;
*
* Public: No
*/

View File

@ -11,7 +11,7 @@
* Can Drink From Source <BOOL>
*
* Example:
* [_player, _source] call ace_field_rations_canDrinkFromSource
* [_player, _source] call ace_field_rations_fnc_canDrinkFromSource
*
* Public: No
*/

View File

@ -11,7 +11,7 @@
* None
*
* Example:
* [_player, _source] call ace_field_rations_drinkFromSource
* [_player, _source] call ace_field_rations_fnc_drinkFromSource
*
* Public: No
*/

View File

@ -11,7 +11,7 @@
* Animation <STRING>
*
* Example:
* [_player, _source] call ace_field_rations_getDrinkAnimation
* [_player, _source] call ace_field_rations_fnc_getDrinkAnimation
*
* Public: No
*/

View File

@ -10,7 +10,7 @@
* None
*
* Example:
* call acex_field_rations_fnc_scanFieldRations
* call ace_field_rations_fnc_scanFieldRations
*
* Public: No
*/

View File

@ -12,7 +12,7 @@
* None
*
* Example:
* [FUNC(fireManagerPFH), 0.25, [_unit]] call CBA_fnc_addPerFrameHandler
* [ace_fire_fnc_fireManagerPFH, 0.25, [_unit]] call CBA_fnc_addPerFrameHandler
*
* Public: No
*/

View File

@ -10,7 +10,7 @@
* None
*
* Example:
* call ace_frag_fnc_addTack
* call ace_frag_fnc_dev_addTrack
*
* Public: No
*/

View File

@ -11,7 +11,7 @@
* None
*
* Example:
* call ace_frag_fnc_debugAmmo
* call ace_frag_fnc_dev_debugAmmo
*
* Public: No
*/

View File

@ -10,7 +10,7 @@
* None
*
* Example:
* call ace_frag_fnc_drawTraces
* call ace_frag_fnc_dev_drawTraces
*
* Public: No
*/

View File

@ -10,6 +10,7 @@
* None
*
* Example:
* None
*
* Public: No
*/

View File

@ -11,7 +11,7 @@
* None
*
* Example:
* [player, target] call ace_gunbag_fnc_swapGunbag
* [player, target] call ace_gunbag_fnc_swapGunbagCallback
*
* Public: No
*/

View File

@ -10,7 +10,7 @@
* None
*
* Example:
* call ACE_interact_menu_fnc_setupTextColor
* call ace_interact_menu_fnc_setupTextColors
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* None
*
* Example:
* call ace_interaction_fnc_onRemoteControl
* call ace_interaction_fnc_doRemoteControl
*
* Public: No
*/

View File

@ -10,6 +10,7 @@
* None
*
* Example:
* None
*
* Public: No
*/

View File

@ -10,6 +10,7 @@
* None
*
* Example:
* call ace_kestrel4500_fnc_updateImpellerState
*
* Public: No
*/

View File

@ -14,7 +14,7 @@
* None
*
* Example:
* [vehicle player, 234, "HitHull"] call ace_vehicle_damage_fnc_knockOut
* [vehicle player, 234, "HitHull"] call ace_vehicle_damage_fnc_addDamage
*
* Public: No
*/

View File

@ -11,7 +11,7 @@
* None
*
* Example:
* _this call ace_cookoff_fnc_handleDamageEjectIfDestroyed
* _this call ace_vehicle_damage_fnc_handleDamageEjectIfDestroyed
*
* Public: No
*/

View File

@ -18,7 +18,7 @@
* Whether or not to continue handling last frame's damage
*
* Example:
* [ace_vehicle_damage_fnc_handleTankDamage, tank1, "Hit_Engine", 12]] call CBA_fnc_execNextFrame
* [ace_vehicle_damage_fnc_handleVehicleDamage, tank1, "Hit_Engine", 12]] call CBA_fnc_execNextFrame
*
* Public: No
*/

View File

@ -12,7 +12,7 @@
* None
*
* Example:
* [fromModule] call ACE_VehicleLock_fnc_hasKeyForVehicle;
* [fromModule] call ace_vehiclelock_fnc_moduleInit;
*
* Public: No
*/

View File

@ -111,7 +111,7 @@ class FunctionFile:
# Process example
if example_raw:
self.example = example_raw.strip()
self.example = self.process_example(example_raw)
return self.errors
@ -221,6 +221,19 @@ class FunctionFile:
return [return_name, return_types]
def process_example(self, raw):
return_value = raw.strip()
if return_value == "None":
return return_value
path_match = re.match(r".*addons.(.*).functions.(.*).sqf", self.path)
expected_func = f"ace_{path_match.group(1)}_{path_match.group(2)}"
if (not expected_func.lower() in return_value.lower()) and ((not return_value.startswith("Handled by")) and (not return_value.startswith("Called By"))):
self.feedback(f"Malformed example {return_value} should contain func {expected_func}", 2)
return return_value
def document(self, component):
str_list = []