Skip to content

Commit

Permalink
Fix global gitignore is not respected, move licenses to release phase (
Browse files Browse the repository at this point in the history
  • Loading branch information
kezhenxu94 authored Feb 9, 2025
1 parent 7965255 commit 8b1d66c
Show file tree
Hide file tree
Showing 101 changed files with 162 additions and 7,117 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ coverage.txt

target/
*.jar

dist/licenses
dist/LICENSE
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ run:

linters-settings:
govet:
check-shadowing: true
enable:
- shadow
revive:
min-confidence: 0
gocyclo:
Expand Down
34 changes: 18 additions & 16 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ header: # `header` section is configurations for source codes license header.
license:
spdx-id: Apache-2.0 # the spdx id of the license, it's convenient when your license is standard SPDX license.
copyright-owner: Apache Software Foundation # the copyright owner to replace the [owner] in the `spdx-id` template.
content: | # `license` will be used as the content when `fix` command needs to insert a license header.
content:
| # `license` will be used as the content when `fix` command needs to insert a license header.
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
Expand Down Expand Up @@ -57,23 +58,24 @@ header: # `header` section is configurations for source codes license header.
under the License.
paths: # `paths` are the path list that will be checked (and fixed) by license-eye, default is ['**'].
- '**'
- "**"

paths-ignore: # `paths-ignore` are the path list that will be ignored by license-eye.
- 'dist'
- 'licenses'
- '**/*.md'
- '**/testdata/**'
- '**/go.mod'
- '**/go.sum'
- 'LICENSE'
- 'NOTICE'
- '**/assets/header-templates/**'
- '**/assets/lcs-templates/**'
- '**/assets/languages.yaml'
- '**/assets/default-license.tpl'
- '**/assets/assets.gen.go'
- 'docs/**.svg'
- "dist"
- "licenses"
- "**/*.md"
- "**/testdata/**"
- "**/go.mod"
- "**/go.sum"
- "LICENSE"
- "NOTICE"
- "**/assets/header-templates/**"
- "**/assets/lcs-templates/**"
- "**/assets/languages.yaml"
- "**/assets/default-license.tpl"
- "**/assets/assets.gen.go"
- "docs/**.svg"
- "pkg/gitignore/dir.go"

comment: on-failure # on what condition license-eye will comment on the pull request, `on-failure`, `always`, `never`.

Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,4 @@ The text of each license is the standard Apache 2.0 license.

pkg/deps/testdata/maven/mvnw files from https://github.com/apache/maven-wrapper Apache 2.0
pkg/deps/testdata/maven/.mvn/wrapper/maven-wrapper.properties from https://github.com/apache/maven-wrapper Apache 2.0
pkg/gitignore/dir.go from https://github.com/go-git/go-git/blob/db681b472344540816df80736860c6af23e8cf94/plumbing/format/gitignore/dir.go Apache 2.0
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ fix-lint: $(GO_LINT)
.PHONY: license
license: clean
$(GO) run cmd/$(PROJECT)/main.go header check
$(GO) run cmd/$(PROJECT)/main.go dependency check

.PHONY: test
test: clean
Expand Down Expand Up @@ -115,7 +116,12 @@ release-src: clean
mv $(RELEASE_SRC)/$(RELEASE_SRC).tgz $(RELEASE_SRC).tgz
-rm -rf "$(RELEASE_SRC)"

release-bin: build
.PHONY: release-license-bin
release-license-bin: clean
$(GO) run cmd/$(PROJECT)/main.go dependency resolve --summary dist/LICENSE.tpl --output dist/licenses/ || \
(echo "Error: Failed to resolve license dependencies automatically. Please check licenses manually." && exit 1)

release-bin: release-license-bin build
-mkdir $(RELEASE_BIN)
-cp -R bin $(RELEASE_BIN)
-cp -R dist/* $(RELEASE_BIN)
Expand Down
260 changes: 0 additions & 260 deletions dist/LICENSE

This file was deleted.

Loading

0 comments on commit 8b1d66c

Please sign in to comment.