-
Notifications
You must be signed in to change notification settings - Fork 79
Storm help command to show library and type information (SYN-6001) #3335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3335 +/- ##
==========================================
- Coverage 97.28% 97.16% -0.13%
==========================================
Files 228 228
Lines 46014 46323 +309
==========================================
+ Hits 44767 45008 +241
- Misses 1247 1315 +68
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
assert len(rtype) > 1 | ||
tdata = ', '.join(rtype) | ||
lines.append('Returns:') | ||
lines.append(f' The type may be one of the following: {tdata}.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is schema valid but we don't have anything which uses it implemented, so it is not covered in tests.
isgtor = False | ||
isctor = False | ||
|
||
if rname == 'ctor' or 'ctor' in rname: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could probably just do the XXX in rname
check for these since it will catch the rname == XXX
case also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So these values are not schema bound, I'm not certain if its correct to allow a substring match - something like setting the type
value to ctorxxxx
would appear correct here but its allowing a typo to do the right thing?
synapse/lib/storm.py
Outdated
if item is not None and \ | ||
not isinstance(item, str) and \ | ||
not isinstance(item, s_stormtypes.Lib) and \ | ||
not callable(item): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're missing the None case in this sequence of ifs.
if item is not None and \ | |
not isinstance(item, str) and \ | |
not isinstance(item, s_stormtypes.Lib) and \ | |
not callable(item): | |
if item is None or \ | |
(not isinstance(item, str) and \ | |
not isinstance(item, s_stormtypes.Lib) and \ | |
not callable(item)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.opts.item
being None
indicates either 1) The user did not provide input ( the valid help
case to list commands ) or 2) The user provided an input value which resolved to None ( help $lib.null
).
Co-authored-by: blackout <blackout@vertex.link>
…nt resolution. support and directly as well. register telepath proxy method types and give them docstrings.
synapse/tests/test_lib_storm.py
Outdated
self.stormIsInPrint('Get the value of the primary property of the Node.', msgs) | ||
msgs = await alist(core.storm('[test:str=uniq] | help $node.value()')) | ||
|
||
msgs = await core.stormlist('[test:str=uniq] | help $node.value()') | ||
self.stormNotInPrint('get the value of the primary property of the Node.', msgs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you didn't change this but I notice a similar line with a capital G a few lines above and I'm wondering if this assertion is passing because of a mismatch in case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test shows the difference between the help value being a bound method $node.value
and the resolved value $node.value()
which is the string uniq
which is then matched against the list of commands and types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the typo though!
No description provided.