Search before asking
Apache SkyWalking Component
License Tools (apache/skywalking-eyes)
What happened
# EXC0013 revive: Annoying issue about not having a comment. The rare codebase has such comments
- package comment should be of the form "(.+)...
When I fixed License header using license-eyes -c .licenserc.yaml header fix, but I got some lint issues as below when I checked code style using golangci-lint.
Running [/home/runner/golangci-lint-1.41.1-linux-amd64/golangci-lint run --out-format=github-actions] in [] ...
Warning: package-comments: package comment should be of the form "Package devops ..." (revive)
Warning: package-comments: package comment should be of the form "Package common ..." (revive)
Warning: package-comments: package comment should be of the form "Package template ..." (revive)
Warning: package-comments: package comment should be of the form "Package template ..." (revive)
Warning: package-comments: package comment should be of the form "Package v1alpha1 ..." (revive)
BTW, the result snippet license-eyes fixed is as follows:
// Copyright 2022 KubeSphere Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package mypkg
What you expected to happen
The result snippet license-eyes fixed should be as follows:
// Copyright 2022 KubeSphere Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package mypkg is great
package mypkg
or
// Copyright 2022 KubeSphere Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Package mypkg is great
package mypkg
How to reproduce
-
Create main.go
go mod init test
go mod tidy
// Package test is awesome
package test
import "fmt"
func main() {
fmt.Println(Hello World)
}
-
Header fix
go install github.com/apache/skywalking-eyes/cmd/license-eye@latest
license-eyes header fix
-
Got the unexpected result
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
// Package test is awesome
package test
import "fmt"
func main() {
fmt.Println(Hello World)
}
-
Lint code
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.44.0
golangci-lint run -E revive --exclude-use-default=false ./...
-
See error
Anything else
No response
Are you willing to submit PR?
Code of Conduct
Search before asking
Apache SkyWalking Component
License Tools (apache/skywalking-eyes)
What happened
When I fixed License header using
license-eyes -c .licenserc.yaml header fix, but I got some lint issues as below when I checked code style usinggolangci-lint.BTW, the result snippet
license-eyesfixed is as follows:What you expected to happen
The result snippet
license-eyesfixed should be as follows:or
How to reproduce
Create main.go
go mod init test go mod tidyHeader fix
Got the unexpected result
Lint code
See error
Anything else
No response
Are you willing to submit PR?
Code of Conduct