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

Shell func go_srcs_in_module to list go src+test files (#14827) #14840

Merged
merged 4 commits into from
Nov 23, 2022

Conversation

Bhargav-InfraCloud
Copy link
Contributor

Motivation

Issue 14671

Changes

  1. TestGoFiles & XTestGoFiles added in shell func go_srcs_in_module.
  2. Test file comments fixes as per goword.

Summary

The shell func go_srcs_in_module which originally was listing only go src files is made to list go test files too. This is used by verify-license-header which checks for copyright headers in go files. Making the func to list test files will help in identifying the go test files that miss copyright headers.

Go template terminology:
1. GoFiles - for go source files
2. TestGoFiles - for go test files which share the same package names
3. XTestGoFiles - for go test files that belong to _test packages

TestGoFiles & XTestGoFiles are added as part of this change.

As go_srcs_in_module is used by other verifications too, the comments in different tests are fixed to make it verify-goword compliant.

Related Issues

Closes #14827

The shell function go_srcs_in_module will list go test files
along with go src files in the specified module. This helps
in identifying the copyright header misses in test files.

Fixes etcd-io#14827

Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
Comments fixed as per goword in go test files that shell
function go_srcs_in_module lists as per changes on etcd-io#14827

Helps in etcd-io#14827

Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
The shell func go_srcs_in_module will now list
1. go src files
2. go test files belong to same packages
3. go test files that belong to _test packages

Fixes etcd-io#14827

Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
Comments fixed as per goword in go _test package files that
shell function go_srcs_in_module lists as per changes on etcd-io#14827

Helps in etcd-io#14827

Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
@Bhargav-InfraCloud
Copy link
Contributor Author

@serathius @ahrtr please review. Thanks!

@serathius
Copy link
Member

Really great work!

Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thank you @Bhargav-InfraCloud

@ahrtr ahrtr merged commit b6a3594 into etcd-io:main Nov 23, 2022
@Bhargav-InfraCloud Bhargav-InfraCloud deleted the copyright-check-in-test-files branch November 24, 2022 01:40
@Bhargav-InfraCloud
Copy link
Contributor Author

Thanks! @ahrtr @serathius :bowtie:

@serathius
Copy link
Member

Really great first contribution.

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

Successfully merging this pull request may close these issues.

Add copyright header for health_test.go
3 participants