Skip to content

Conversation

@BrettMayson
Copy link
Owner

Uses the 0.5 version of the arma-wiki, which can handle a few more complex types

  • Numbers can have ranges defined (right now no support for infinity)
  • A lot of Array of ... handling
  • Improved handling of or

There's just one problem, it checks even when the code is not going to be run due to an if statement. I haven't dug through the inspector too much, not sure if you know of a quick fix for this @PabstMirror, or if a smarter "type system" is going to need to be worked on.

private _oldLoc = [];
{
    _x params ["_locNew", "_colorNew"];
    if (_oldLoc isNotEqualTo []) then {
        drawLine3D [_oldLoc, _locNew, _colorNew];
    };
    _oldLoc = _locNew;
} forEach _segments;
warning[L-S12]: Invalid argument type for `[U:drawLine3D]`
  ┌─ fnc_test.sqf:5:9
  │
5 │         drawLine3D [_oldLoc, _locNew, _colorNew];
  │         ^^^^^^^^^^ type not expected
  │
  = note: found    Array[(Array[]), (Any), (Any)]
          expected Array[(Array<PosAGL>)]

On a related note to a type system, does the inspector support something along the lines of this?

private _data = if (alive _this) { 1 } else { "They're dead" };
systemChat _data;

Ideally HEMTT should warn that this can result in a Number being passed where a String is expected, but should also handle

private _data = if (alive _this) { 1 } else { "They're dead" };
if (typeName _data == "STRING") then { systemChat _data; };

I'm assuming it currently doesn't, and this would require a type system rework

@codecov
Copy link

codecov bot commented Jan 1, 2026

Codecov Report

❌ Patch coverage is 77.98165% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.0%. Comparing base (05c1ccd) to head (fbc8324).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
libs/sqf/src/analyze/inspector/game_value.rs 78.7% 20 Missing ⚠️
...bs/sqf/src/analyze/inspector/external_functions.rs 0.0% 2 Missing ⚠️
bin/src/modules/git.rs 66.6% 1 Missing ⚠️
...s/sqf/src/analyze/lints/s07_select_parse_number.rs 50.0% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
libs/sqf/src/analyze/inspector/commands.rs 84.7% <100.0%> (ø)
libs/sqf/src/analyze/inspector/mod.rs 97.1% <100.0%> (+<0.1%) ⬆️
bin/src/modules/git.rs 11.7% <66.6%> (+0.9%) ⬆️
...s/sqf/src/analyze/lints/s07_select_parse_number.rs 68.6% <50.0%> (ø)
...bs/sqf/src/analyze/inspector/external_functions.rs 74.2% <0.0%> (ø)
libs/sqf/src/analyze/inspector/game_value.rs 79.3% <78.7%> (+2.1%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants