Closed Tiny-Box closed 1 year ago
This requires comment support in the underlying thriftrw library, which ThriftCheck uses to parse Thrift IDL files. I started on an implementation (https://github.com/thriftrw/thriftrw-go/pull/556) but wasn't able to finish it.
I've had a look and at this stage field has been implemented inside the field to get the comment, using the Doc field on it (I haven't seen the underlying implementation yet), this is currently ready to do some checking.
As for checking comments in many other places, may need to follow up with thrift-go to implement this
I know we can use //
, /* xx */
, /* xx */
in thrift file, etc., but only /* xx */
can be extracted as a description
Yes, if you're only interested in documentation block comments (/** ... */
), you should have everything you need to develop a linter in the current code base.
Thrift is a popular format for many IDLs, and it's possible to add comments to the IDL, such as adding comments to the fields of a struct, which can be used to generate documentation with explanations (such as the simplest
thrift --gen html
command). Therefore, a Linter that checks for the existence of comments can be very helpful in maintaining code standards. So, it might be worth considering adding some of these checks.If possible, I would be willing to submit some PRs to do this.