You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So we're running into some issues with linting due to the nature of generated resolver files being a mixture of generated and non-generated code.
The generated resolver files are denoted as being generated with this comment:
We also run into challenges when forcibly linting the generated code (by removing the autogen comment), mostly due to the autogenerated code running breaking lint rules, e.g. generated resolver methods exceed common line-length limits (100, 120) since the entire method signature is put onto a single line, and any manual edits to split the signature onto multiple lines get stomped on when the resolvers are regenerated.
We're a fan of the prescriptive structure that the generated resolvers provide but don't want to just turn off linting for the non-generated implementations. Any ideas around how to make the generated resolvers play more nicely with linting?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So we're running into some issues with linting due to the nature of generated resolver files being a mixture of generated and non-generated code.
The generated resolver files are denoted as being generated with this comment:
gqlgen/plugin/resolvergen/resolver.go
Line 176 in ff19a5a
which excludes the files from linters, e.g. golangci-lint excludes generated files from linting
but this has a real downside of no longer linting the resolver implementations.
We also run into challenges when forcibly linting the generated code (by removing the autogen comment), mostly due to the autogenerated code running breaking lint rules, e.g. generated resolver methods exceed common line-length limits (100, 120) since the entire method signature is put onto a single line, and any manual edits to split the signature onto multiple lines get stomped on when the resolvers are regenerated.
We're a fan of the prescriptive structure that the generated resolvers provide but don't want to just turn off linting for the non-generated implementations. Any ideas around how to make the generated resolvers play more nicely with linting?
Beta Was this translation helpful? Give feedback.
All reactions