Skip to content

Commit

Permalink
Add go-header linter to check the license header
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Jan 8, 2021
1 parent 15e15e5 commit ccffbca
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ linters-settings:
funlen:
lines: 80
statements: 60
goheader:
template-path: ".license-template"
values:
const:
year: 2021
regexp:
year-range: (\d\d\d\d|{{year}})

linters:
enable-all: true
Expand Down
17 changes: 17 additions & 0 deletions .license-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
*
* k6 - a next-generation load testing tool
* Copyright (C) {{year-range}} Load Impact
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*

3 comments on commit ccffbca

@szkiba
Copy link
Contributor

@szkiba szkiba commented on ccffbca Jan 11, 2021

Choose a reason for hiding this comment

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

Are sure is it a correct configuration? I'm unable to pass lint on #1792 , could you help me? The problem probably related this license header configuration, but I can't figure out how...

@mstoykov
Copy link
Contributor Author

Choose a reason for hiding this comment

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

hi @szkiba, I am sure this is correct as I did a lot of testing, but apparently, the golangci-lint version in GitHub actions has some problems or something with all the other arguments break it ... so I've disabled this linter until we have time to look into it properly.

I'm sorry for the inconvenience :(

@szkiba
Copy link
Contributor

@szkiba szkiba commented on ccffbca Jan 12, 2021

Choose a reason for hiding this comment

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

hi @mstoykov , thank you. Now lint check is ok. BTW if you have a few minutes and take a look on my PR, I'd be happy to know your opinion: is this kind of feature fit into k6 or not, is there any chance for merge? (I don't want to urge, just interested)

Please sign in to comment.