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

Pass lint #127

Closed
HelloGrayson opened this issue May 20, 2016 · 5 comments
Closed

Pass lint #127

HelloGrayson opened this issue May 20, 2016 · 5 comments
Labels

Comments

@HelloGrayson
Copy link
Contributor

Wondering how possible it is for generated code to pass lint.

The following thrift file produced generated code that had a slew of warnings:

service Echo {
    Pong echo(1: Ping ping) (
        ttlms = '100'
    )
}

struct Ping {
    1: required string beep
}

struct Pong {
    1: required string boop
}
crossdock/thrift/echo/service/echo/echo.go|33 col 6 warning| exported type EchoArgs should have comment or be unexported
crossdock/thrift/echo/service/echo/echo.go|33 col 6 warning| type name will be used as echo.EchoArgs by other packages, and that stutters; consider calling this Args
crossdock/thrift/echo/service/echo/echo.go|37 col 1 warning| exported method EchoArgs.ToWire should have comment or be unexported
crossdock/thrift/echo/service/echo/echo.go|47 col 6 warning| don't use underscores in Go names; func _Ping_Read should be _PingRead
crossdock/thrift/echo/service/echo/echo.go|53 col 1 warning| exported method EchoArgs.FromWire should have comment or be unexported
crossdock/thrift/echo/service/echo/echo.go|79 col 6 warning| exported type EchoResult should have comment or be unexported
crossdock/thrift/echo/service/echo/echo.go|79 col 6 warning| type name will be used as echo.EchoResult by other packages, and that stutters; consider calling this Result
crossdock/thrift/echo/service/echo/echo.go|83 col 1 warning| exported method EchoResult.ToWire should have comment or be unexported
crossdock/thrift/echo/service/echo/echo.go|93 col 6 warning| don't use underscores in Go names; func _Pong_Read should be _PongRead
crossdock/thrift/echo/service/echo/echo.go|99 col 1 warning| exported method EchoResult.FromWire should have comment or be unexported
crossdock/thrift/echo/service/echo/echo.go|125 col 5 warning| exported var EchoHelper should have comment or be unexported

Thoughts?

@blampe
Copy link

blampe commented May 20, 2016

It's easy enough to add generated code to lint-ignore lists, so this is more like a nice-to-have.

@prashantv
Copy link
Contributor

Agree that this is a nice-to-have. It's blocked on #100

@HelloGrayson
Copy link
Contributor Author

Agreed.

In the same way that the generated code gets ran through tests, we should also run that code through the other go tools, eg lint, vet, race checker, etc...

@abhinav abhinav added this to the 1.0.0 milestone Sep 9, 2016
@abhinav
Copy link
Contributor

abhinav commented Sep 9, 2016

I think at least part of this is a 1.0 requirement. Being able to parse the docstrings in Thrift files and including them as comments in the generated code will help pass at least some linter errors.

@abhinav
Copy link
Contributor

abhinav commented Aug 28, 2018

Code generated by ThriftRW now has comments. Most of it should pass lint. The
rest, especially the _-named types, are "wontfix" because we intentionally
chose names that wouldn't conflict with user-specified idiomatic type names.

@abhinav abhinav closed this as completed Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants