Closed wagenet closed 2 years ago
Hello - thanks for giving Sord a go.
Do you have a minimal example which reproduces this issue please?
There is a test (https://github.com/AaronC81/sord/blob/master/spec/generator_spec.rb#L888) which covers the case of constants without documentation, and it seems to be passing OK on my machine and GitHub Actions:
class A
EXAMPLE_UNTYPED_CONSTANT = 'Foo'
# @return [String]
EXAMPLE_TYPED_CONSTANT = 'Bar'
end
Thanks!
I'm not sure why the example you have passes. My code is basically just this:
module Direwolf
module Guid
FOO = 1
end
end
Ahh, I think I got it - the exception only happens if logging to the console is enabled, which isn't the case for tests. I've fixed the problem (a constant's name being passed to logging functions, rather than the constant's YARD object), and also made log messages be unconditionally generated, even if they aren't going to be printed, so issues like this will be caught by tests.
Please could you check if #135 fixes your issue? Thanks!
Ah, it's logging related. If you add Sord::Logging.silent = false
to that spec then it fails.
Hah, I just saw your comment. Looks like you figured this out before me!
@AaronC81 #135 fixes it, thanks!
Superb - merged :)
Describe the bug
In master, constants without a YARD @return cause errors.
To Reproduce
Make a constant without a YARD @return.
Expected behavior
It treats it as untyped.
Actual behavior
Additional information
Internally, It looks like it's expecting a special item with a
path
but we just have a string.