Skip to content

Commit 5712040

Browse files
committed
Fix global gitignore is not respected, move licenses to release phase
1 parent 7965255 commit 5712040

File tree

101 files changed

+162
-7117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+162
-7117
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ coverage.txt
2424

2525
target/
2626
*.jar
27+
28+
dist/licenses
29+
dist/LICENSE

.golangci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ run:
2020

2121
linters-settings:
2222
govet:
23-
check-shadowing: true
23+
enable:
24+
- shadow
2425
revive:
2526
min-confidence: 0
2627
gocyclo:

.licenserc.yaml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ header: # `header` section is configurations for source codes license header.
1919
license:
2020
spdx-id: Apache-2.0 # the spdx id of the license, it's convenient when your license is standard SPDX license.
2121
copyright-owner: Apache Software Foundation # the copyright owner to replace the [owner] in the `spdx-id` template.
22-
content: | # `license` will be used as the content when `fix` command needs to insert a license header.
22+
content:
23+
| # `license` will be used as the content when `fix` command needs to insert a license header.
2324
Licensed to the Apache Software Foundation (ASF) under one
2425
or more contributor license agreements. See the NOTICE file
2526
distributed with this work for additional information
@@ -57,23 +58,24 @@ header: # `header` section is configurations for source codes license header.
5758
under the License.
5859
5960
paths: # `paths` are the path list that will be checked (and fixed) by license-eye, default is ['**'].
60-
- '**'
61+
- "**"
6162

6263
paths-ignore: # `paths-ignore` are the path list that will be ignored by license-eye.
63-
- 'dist'
64-
- 'licenses'
65-
- '**/*.md'
66-
- '**/testdata/**'
67-
- '**/go.mod'
68-
- '**/go.sum'
69-
- 'LICENSE'
70-
- 'NOTICE'
71-
- '**/assets/header-templates/**'
72-
- '**/assets/lcs-templates/**'
73-
- '**/assets/languages.yaml'
74-
- '**/assets/default-license.tpl'
75-
- '**/assets/assets.gen.go'
76-
- 'docs/**.svg'
64+
- "dist"
65+
- "licenses"
66+
- "**/*.md"
67+
- "**/testdata/**"
68+
- "**/go.mod"
69+
- "**/go.sum"
70+
- "LICENSE"
71+
- "NOTICE"
72+
- "**/assets/header-templates/**"
73+
- "**/assets/lcs-templates/**"
74+
- "**/assets/languages.yaml"
75+
- "**/assets/default-license.tpl"
76+
- "**/assets/assets.gen.go"
77+
- "docs/**.svg"
78+
- "pkg/gitignore/dir.go"
7779

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

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,4 @@ The text of each license is the standard Apache 2.0 license.
228228

229229
pkg/deps/testdata/maven/mvnw files from https://github.com/apache/maven-wrapper Apache 2.0
230230
pkg/deps/testdata/maven/.mvn/wrapper/maven-wrapper.properties from https://github.com/apache/maven-wrapper Apache 2.0
231+
pkg/gitignore/dir.go from https://github.com/go-git/go-git/blob/db681b472344540816df80736860c6af23e8cf94/plumbing/format/gitignore/dir.go Apache 2.0

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ fix-lint: $(GO_LINT)
5656
.PHONY: license
5757
license: clean
5858
$(GO) run cmd/$(PROJECT)/main.go header check
59+
$(GO) run cmd/$(PROJECT)/main.go dependency check
5960

6061
.PHONY: test
6162
test: clean
@@ -115,7 +116,12 @@ release-src: clean
115116
mv $(RELEASE_SRC)/$(RELEASE_SRC).tgz $(RELEASE_SRC).tgz
116117
-rm -rf "$(RELEASE_SRC)"
117118

118-
release-bin: build
119+
.PHONY: release-license-bin
120+
release-license-bin: clean
121+
$(GO) run cmd/$(PROJECT)/main.go dependency resolve --summary dist/LICENSE.tpl --output dist/licenses/ || \
122+
(echo "Error: Failed to resolve license dependencies automatically. Please check licenses manually." && exit 1)
123+
124+
release-bin: release-license-bin build
119125
-mkdir $(RELEASE_BIN)
120126
-cp -R bin $(RELEASE_BIN)
121127
-cp -R dist/* $(RELEASE_BIN)

dist/LICENSE

Lines changed: 0 additions & 260 deletions
This file was deleted.

0 commit comments

Comments
 (0)