moul-scripts icon indicating copy to clipboard operation
moul-scripts copied to clipboard

Change the plasma module so that it's statically analysable

Open ghost opened this issue 5 years ago • 5 comments

Which provides code linting etc.

I added plasma/__init__.py which exposes all the contents of the files in plasma/ that were imported separately before. All imports have been changed to from plasma import *. For now I changed Plasma.py to PlasmaStubs.py to not conflict with the engine's Plasma module. Hoikas proposed changing the engine's module instead, to _Plasma (I didn't do that because I don't have engine development set up).

I also changed the Plasma stubs to raise NotImplementedError(), further improving code linting.

ghost avatar Mar 16 '20 15:03 ghost

Amended.

ghost avatar Mar 16 '20 15:03 ghost

I missed converting the import Plasma... cases (e.g. import PlasmaControlKeys), which were not analysing correctly as a result. Amended now.

ghost avatar Mar 16 '20 16:03 ghost

Removed line ending changes, moved change to #123

ghost avatar Mar 16 '20 17:03 ghost

Todo before this is merged: check for any naughty assumptions in plPythonPack and verify that packed python works after repacking with this.

Hoikas avatar Mar 17 '20 00:03 Hoikas

This will probably be deferred until we're on Python 3, as we may want to use stub files for the plasma module.

ghost avatar May 04 '20 08:05 ghost