mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Tools - Check example funcs in document_functions.py (#9630)
This commit is contained in:
parent
4fb9da7b08
commit
6bc5193a79
@ -20,7 +20,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* No
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -10,6 +10,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_dagr_fnc_menuInit
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [_player, _source] call ace_field_rations_drinkFromSource
|
||||
* [_player, _source] call ace_field_rations_fnc_drinkFromSource
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@
|
||||
* Animation <STRING>
|
||||
*
|
||||
* Example:
|
||||
* [_player, _source] call ace_field_rations_getDrinkAnimation
|
||||
* [_player, _source] call ace_field_rations_fnc_getDrinkAnimation
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -10,7 +10,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call acex_field_rations_fnc_scanFieldRations
|
||||
* call ace_field_rations_fnc_scanFieldRations
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -10,7 +10,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_frag_fnc_addTack
|
||||
* call ace_frag_fnc_dev_addTrack
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_frag_fnc_debugAmmo
|
||||
* call ace_frag_fnc_dev_debugAmmo
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -10,7 +10,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_frag_fnc_drawTraces
|
||||
* call ace_frag_fnc_dev_drawTraces
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -10,6 +10,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [player, target] call ace_gunbag_fnc_swapGunbag
|
||||
* [player, target] call ace_gunbag_fnc_swapGunbagCallback
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -10,7 +10,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ACE_interact_menu_fnc_setupTextColor
|
||||
* call ace_interact_menu_fnc_setupTextColors
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -9,7 +9,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_interaction_fnc_onRemoteControl
|
||||
* call ace_interaction_fnc_doRemoteControl
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -10,6 +10,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -10,6 +10,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_kestrel4500_fnc_updateImpellerState
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* _this call ace_cookoff_fnc_handleDamageEjectIfDestroyed
|
||||
* _this call ace_vehicle_damage_fnc_handleDamageEjectIfDestroyed
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -12,7 +12,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [fromModule] call ACE_VehicleLock_fnc_hasKeyForVehicle;
|
||||
* [fromModule] call ace_vehiclelock_fnc_moduleInit;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -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 = []
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user