Cilium: CI: Add automated check for copyright headers

Created on 30 Oct 2020  路  3Comments  路  Source: cilium/cilium

Proposal

I occasionally forget to add copyright headers to new files in PRs, and reviewers have had to manually comment on this. Such a check can be automated, saving reviewer time.

golangci-lint includes support for the go-header linter which can probably leveraged to implement this, at least for Go source files.

Comments? Happy to implement this if folk think it would be useful.

kinfeature

All 3 comments

I've added a copyright profile in Goland that automatically adds the header in new files, but your proposal is useful in general.

Screen Shot 2020-10-30 at 11 45 30 AM

Voted for golangci-lint with go-header, one good thing is that we don't need to introduce more tools required as part of development.

PS: I might be biased here.

Quick update on this: adding the check is fairly straightforward, but it turns out that there are a lot of files that either don't have a copyright header, or have a slightly weird one. I have a WIP PR but there are still a lot of files to update. As there are other higher-priority tasks this is only getting idle cycles from me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jianlin-lv picture Jianlin-lv  路  3Comments

arzarif picture arzarif  路  4Comments

aledbf picture aledbf  路  4Comments

joestringer picture joestringer  路  3Comments

tklauser picture tklauser  路  3Comments