Proposed changes to state
passed to plugin journal_entry()
.
#1210
Athanasius
started this conversation in
Plugin Development
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Heads up to Plugin Developers - Please take a look at this PR #1206 as we really want to make the core monitor code (which provides the
state
that's passed to pluginjournal_entry()
) more robust against typos and brainfarts.This PR is looking at using a custom dict type to set specific types on the members to catch at least where we brainfart a wrong-type value. That checking would be when using
mypy
, not runtime.Another issue is that using a simple dictionary for that state means nothing will catch if we typo e.g.
ShipIdent
asShipIDent
. There's another not-PR, but WIP, which will actually change all ofstate
to an actual object with properties instead of dictionary member names, but with some backwards compatibility.Mostly right now I'd like to know if any plugin developer knows their code does checks like
if state['something'] is not None
or the like which will trip up if we change our "not yet set"/default value to''
for strings,0
for integers,{}
for dictionaries and the like.Beta Was this translation helpful? Give feedback.
All reactions