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

New rule for generated Go files #3719

Closed
AlekSi opened this Issue Jul 13, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@AlekSi

AlekSi commented Jul 13, 2017

See golang/go#13560 (comment).

Related to #2724.

@lildude

This comment has been minimized.

Show comment
Hide comment
@lildude

lildude Jul 13, 2017

Member

I don't think we need a new rule but rather a tweaking of the current rule as the current implementation at

def generated_go?
return false unless extname == '.go'
return false unless lines.count > 1
return lines[0].include?("Code generated by")
end
should already catch most generated files using the new format, assuming they include by in their generated string.

We'd certainly welcome a PR for the tweaking to catch others and bring things inline with the new spec, but without castigating those not using the new format.

Member

lildude commented Jul 13, 2017

I don't think we need a new rule but rather a tweaking of the current rule as the current implementation at

def generated_go?
return false unless extname == '.go'
return false unless lines.count > 1
return lines[0].include?("Code generated by")
end
should already catch most generated files using the new format, assuming they include by in their generated string.

We'd certainly welcome a PR for the tweaking to catch others and bring things inline with the new spec, but without castigating those not using the new format.

@AlekSi

This comment has been minimized.

Show comment
Hide comment
@AlekSi

AlekSi Jul 13, 2017

I meant that Go now has an "official" rule, not Linguist. 😄
The big difference is that now that line can appear anywhere in the file, not just in the first line.

AlekSi commented Jul 13, 2017

I meant that Go now has an "official" rule, not Linguist. 😄
The big difference is that now that line can appear anywhere in the file, not just in the first line.

@lildude

This comment has been minimized.

Show comment
Hide comment
@lildude

lildude Jul 13, 2017

Member

Ah yes. I missed that. 😊 Thanks for the clarification.

Member

lildude commented Jul 13, 2017

Ah yes. I missed that. 😊 Thanks for the clarification.

@pchaigno

This comment has been minimized.

Show comment
Hide comment
@pchaigno

pchaigno Aug 17, 2018

Collaborator

As @lildude said, we'd welcome a pull request to improve the generated rule for Go where necessary.

Collaborator

pchaigno commented Aug 17, 2018

As @lildude said, we'd welcome a pull request to improve the generated rule for Go where necessary.

@pchaigno pchaigno closed this Aug 17, 2018

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Oct 7, 2018

Was this issue closed intentionally? It seems it's not resolved yet, and it'd useful to have an open issue to track this open task.

dmitshur commented Oct 7, 2018

Was this issue closed intentionally? It seems it's not resolved yet, and it'd useful to have an open issue to track this open task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment