Skip to content

Enable minimal static analysis - #10329

Open
Toucan4Life wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
Toucan4Life:enable-static-analysis
Open

Enable minimal static analysis#10329
Toucan4Life wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
Toucan4Life:enable-static-analysis

Conversation

@Toucan4Life

@Toucan4Life Toucan4Life commented Sep 7, 2026

Copy link
Copy Markdown

Description of the problem being solved:

As a newcomer, it was very hard to follow which attribute is available on which type and which function are available. This PR goal is to enable an minimally useful static analysis.

I tried to type some of the module that were dynamically loaded like busted lfs and lzip among others, and tried to fix the most egregious errors that surfaced. To keep the PR small I changed the severity of some classes of errors to warning.

  • Add a LuaJIT-aware EmmyLua project configuration with support for the project's += syntax and LoadModule / PLoadModule loading model.
  • Analyze handwritten application and Busted test code by default, while excluding generated tree data, generated skill/cache data, stat descriptions, and exporter output.

A small number of non-annotation changes are included because static analysis exposed some issues :

  • Scope the dynamically injected updater progress callback locally and handle failed update/download file writes rather than continuing with a nil file handle.
  • Correct the SHA-1 module import shape used by the updater.
  • Fix missing or stale local values in calculation, breakdown, timeless-jewel repair, import, party, trade, and copy-to-clipboard paths.
  • Remove an obsolete aura-modifier consumer whose parser-side producer no longer exists.
  • Make test/build-generation setup explicitly require LuaFileSystem and fail clearly when a required fixture or output file cannot be opened.

Steps taken to verify a working solution:

  • Ran POB.
  • Ran the full default Busted suite: 584 successes, 0 failures, 0 errors.

Thanks to this PR, EmmyLua reports 0 errors, and its diagnostics are less noisy

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.

1 participant