Skip to content
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

input attribute of stardoc rule is not optional, despite what the documentation says #99

Open
shs96c opened this issue Apr 21, 2021 · 0 comments

Comments

@shs96c
Copy link

shs96c commented Apr 21, 2021

The documentation for stardoc says that the input attribute is optional. However, leaving out this attribute leads to the following error:

ERROR: /foo/rules_kotlin/kotlin/BUILD:38:8: in stardoc rule //kotlin:stardoc: 
Traceback (most recent call last):
	File "/private/var/tmp/_bazel_shs/71d26a4c57cf01b6c7f0c561a4a031b5/external/io_bazel_stardoc/stardoc/stardoc.bzl", line 29, column 25, in _stardoc_impl
		input_files = depset(direct = [ctx.file.input], transitive = [
Error in depset: cannot add an item of type 'File' to a depset of 'NoneType'

Either the field is mandatory, or a check must be done to correctly identify whether input has been set.

shs96c added a commit to shs96c/rules_kotlin that referenced this issue Apr 21, 2021
Stardoc doesn't allow a macro to wrap a rule and also have the rule's
documentation be generated.

Ideally, we'd simply exclude the lint wrappers and omit the `input`
attribute from the `stardoc` target. However, thanks to [an issue with
stardoc](bazelbuild/stardoc#99) this is not
an option. As an alternative, we provide a verion of `rules.bzl` that
deliberately excludes the lint wrappers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants