This is an automated email from the ASF dual-hosted git repository. kezhenxu94 pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git
commit 1667d8a23a687ded89f09601c48e0fb2cb6c6b1e Author: kezhenxu94 <[email protected]> AuthorDate: Mon Dec 21 15:56:57 2020 +0800 Reorganize the directory structure to monorepo --- .../{build.yaml => license-eye-check.yaml} | 13 +++- .licenserc.yaml | 8 +-- README.adoc | 72 ++-------------------- Dockerfile => license-eye/Dockerfile | 2 +- Makefile => license-eye/Makefile | 2 +- README.adoc => license-eye/README.adoc | 32 +++++----- {cmd => license-eye/cmd}/license-eye/main.go | 0 {commands => license-eye/commands}/header/check.go | 0 {commands => license-eye/commands}/header/fix.go | 0 .../commands}/header/header.go | 0 {commands => license-eye/commands}/root.go | 0 {commands => license-eye/commands}/version.go | 0 go.mod => license-eye/go.mod | 0 go.sum => license-eye/go.sum | 0 {internal => license-eye/internal}/logger/log.go | 0 {pkg => license-eye/pkg}/config/Config.go | 0 {pkg => license-eye/pkg}/header/check.go | 0 {pkg => license-eye/pkg}/header/config.go | 0 .../pkg}/header/fix/angle_bracket.go | 0 .../pkg}/header/fix/double_slash.go | 0 {pkg => license-eye/pkg}/header/fix/fix.go | 0 {pkg => license-eye/pkg}/header/fix/hashtag.go | 0 .../pkg}/header/fix/slash_asterisk.go | 0 {pkg => license-eye/pkg}/header/result.go | 0 .../testdata}/.licenserc_for_test_check.yaml | 2 +- .../testdata}/.licenserc_for_test_fix.yaml | 2 +- .../testdata}/exclude_test/directories/testcase.go | 0 .../exclude_test/extensions/testcase.json | 0 .../testdata}/exclude_test/extensions/testcase.md | 0 .../testdata}/exclude_test/extensions/testcase.xml | 0 .../include_test/with_license/testcase.go | 0 .../include_test/with_license/testcase.graphql | 0 .../include_test/with_license/testcase.java | 0 .../include_test/with_license/testcase.py | 0 .../include_test/with_license/testcase.sh | 0 .../include_test/with_license/testcase.yaml | 0 .../include_test/with_license/testcase.yml | 0 .../include_test/without_license/testcase.go | 0 .../include_test/without_license/testcase.graphql | 0 .../include_test/without_license/testcase.java | 0 .../include_test/without_license/testcase.md | 0 .../include_test/without_license/testcase.py | 0 .../include_test/without_license/testcase.sh | 0 .../include_test/without_license/testcase.yaml | 0 .../include_test/without_license/testcase.yml | 0 45 files changed, 38 insertions(+), 95 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/license-eye-check.yaml similarity index 87% rename from .github/workflows/build.yaml rename to .github/workflows/license-eye-check.yaml index 68fcaf2..7f65b60 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/license-eye-check.yaml @@ -16,7 +16,7 @@ # under the License. # -name: Build +name: LicenseEye on: pull_request: @@ -24,9 +24,13 @@ on: branches: - master +defaults: + run: + working-directory: license-eye + jobs: - build: - name: Build + build-license-eye: + name: Build LicenseEye runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -41,5 +45,8 @@ jobs: - name: License Check run: make license + - name: Test + run: make test + - name: Build run: make build diff --git a/.licenserc.yaml b/.licenserc.yaml index 6aa224f..719351d 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -20,11 +20,11 @@ header: paths-ignore: - '.git/**' - '.idea/**' - - 'bin/**' + - '**/bin/**' - '**/*.md' - '**/.DS_Store' - - 'test/**' - - 'go.mod' - - 'go.sum' + - '**/testdata/**' + - '**/go.mod' + - '**/go.sum' - 'LICENSE' - 'NOTICE' diff --git a/README.adoc b/README.adoc index 17501c0..d89afab 100644 --- a/README.adoc +++ b/README.adoc @@ -15,76 +15,12 @@ // specific language governing permissions and limitations // under the License. // -= license-eye -:repo: https://github.com/apache/skywalking-eyes += SkyWalking Eyes -A full-featured license guard to check and fix license headers and dependencies' licenses. - -== Install - -[subs="attributes+",source,bash] ----- -git clone {repo} -cd license-eye -make ----- - -== Usage +Infra tools that are created and used by the SkyWalking Team. -[source] ----- -$ license-eye +== License Eye A full-featured license guard to check and fix license headers and dependencies' licenses. -Usage: - license-eye [command] - -Available Commands: - header License header related commands; e.g. check, fix, etc. - help Help about any command - -Flags: - -h, --help help for license-eye - -v, --verbosity string log level (debug, info, warn, error, fatal, panic (default "info") - -Use "license-eye [command] --help" for more information about a command. ----- - -== Configuration - -[source,yaml] -.test/.licenserc_for_test.yaml ----- -include::test/.licenserc_for_test_check.yaml[] ----- - -== Check - -[source] ----- -bin/license-eye -c test/.licenserc_for_test_fix.yaml header check - -INFO Loading configuration from file: test/.licenserc_for_test.yaml serc_for_test.yaml -INFO Totally checked 23 files, valid: 8, invalid: 8, ignored: 7, fixed: 0 -ERROR The following files don't have a valid license header: -test/include_test/without_license/testcase.go -test/include_test/without_license/testcase.graphql -test/include_test/without_license/testcase.java -test/include_test/without_license/testcase.md -test/include_test/without_license/testcase.py -test/include_test/without_license/testcase.sh -test/include_test/without_license/testcase.yaml -test/include_test/without_license/testcase.yml -exit status 1 ----- - -== Fix - -[source] ----- -bin/license-eye -c test/.licenserc_for_test_fix.yaml header fix - -INFO Loading configuration from file: test/.licenserc_for_test_fix.yaml -INFO Totally checked 16 files, valid: 7, invalid: 8, ignored: 1, fixed: 8 ----- +Read link:license-eye/README.adoc[the doc] on how to use license-eye. diff --git a/Dockerfile b/license-eye/Dockerfile similarity index 99% rename from Dockerfile rename to license-eye/Dockerfile index 62c66ee..77731eb 100644 --- a/Dockerfile +++ b/license-eye/Dockerfile @@ -19,7 +19,7 @@ FROM golang:1.14.3-alpine AS build WORKDIR /src -COPY . . +COPY .. . RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /bin/license-eye diff --git a/Makefile b/license-eye/Makefile similarity index 96% rename from Makefile rename to license-eye/Makefile index 3d1612e..4a662cd 100644 --- a/Makefile +++ b/license-eye/Makefile @@ -50,7 +50,7 @@ fix-lint: .PHONY: license license: clean - $(GO) run cmd/license-eye/main.go header check + $(GO) run cmd/license-eye/main.go header check -c ../.licenserc.yaml .PHONY: test test: clean lint diff --git a/README.adoc b/license-eye/README.adoc similarity index 69% copy from README.adoc copy to license-eye/README.adoc index 17501c0..db47c46 100644 --- a/README.adoc +++ b/license-eye/README.adoc @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. // -= license-eye += License-Eye :repo: https://github.com/apache/skywalking-eyes A full-featured license guard to check and fix license headers and dependencies' licenses. @@ -25,7 +25,7 @@ A full-featured license guard to check and fix license headers and dependencies' [subs="attributes+",source,bash] ---- git clone {repo} -cd license-eye +cd skywalking-eyes/license-eye make ---- @@ -54,28 +54,28 @@ Use "license-eye [command] --help" for more information about a command. == Configuration [source,yaml] -.test/.licenserc_for_test.yaml +.testdata/.licenserc_for_test.yaml ---- -include::test/.licenserc_for_test_check.yaml[] +include::testdata/.licenserc_for_test_check.yaml[] ---- == Check [source] ---- -bin/license-eye -c test/.licenserc_for_test_fix.yaml header check +bin/license-eye -c testdata/.licenserc_for_test_fix.yaml header check -INFO Loading configuration from file: test/.licenserc_for_test.yaml serc_for_test.yaml +INFO Loading configuration from file: testdata/.licenserc_for_test.yaml serc_for_test.yaml INFO Totally checked 23 files, valid: 8, invalid: 8, ignored: 7, fixed: 0 ERROR The following files don't have a valid license header: -test/include_test/without_license/testcase.go -test/include_test/without_license/testcase.graphql -test/include_test/without_license/testcase.java -test/include_test/without_license/testcase.md -test/include_test/without_license/testcase.py -test/include_test/without_license/testcase.sh -test/include_test/without_license/testcase.yaml -test/include_test/without_license/testcase.yml +testdata/include_test/without_license/testcase.go +testdata/include_test/without_license/testcase.graphql +testdata/include_test/without_license/testcase.java +testdata/include_test/without_license/testcase.md +testdata/include_test/without_license/testcase.py +testdata/include_test/without_license/testcase.sh +testdata/include_test/without_license/testcase.yaml +testdata/include_test/without_license/testcase.yml exit status 1 ---- @@ -83,8 +83,8 @@ exit status 1 [source] ---- -bin/license-eye -c test/.licenserc_for_test_fix.yaml header fix +bin/license-eye -c testdata/.licenserc_for_test_fix.yaml header fix -INFO Loading configuration from file: test/.licenserc_for_test_fix.yaml +INFO Loading configuration from file: testdata/.licenserc_for_test_fix.yaml INFO Totally checked 16 files, valid: 7, invalid: 8, ignored: 1, fixed: 8 ---- diff --git a/cmd/license-eye/main.go b/license-eye/cmd/license-eye/main.go similarity index 100% rename from cmd/license-eye/main.go rename to license-eye/cmd/license-eye/main.go diff --git a/commands/header/check.go b/license-eye/commands/header/check.go similarity index 100% rename from commands/header/check.go rename to license-eye/commands/header/check.go diff --git a/commands/header/fix.go b/license-eye/commands/header/fix.go similarity index 100% rename from commands/header/fix.go rename to license-eye/commands/header/fix.go diff --git a/commands/header/header.go b/license-eye/commands/header/header.go similarity index 100% rename from commands/header/header.go rename to license-eye/commands/header/header.go diff --git a/commands/root.go b/license-eye/commands/root.go similarity index 100% rename from commands/root.go rename to license-eye/commands/root.go diff --git a/commands/version.go b/license-eye/commands/version.go similarity index 100% rename from commands/version.go rename to license-eye/commands/version.go diff --git a/go.mod b/license-eye/go.mod similarity index 100% rename from go.mod rename to license-eye/go.mod diff --git a/go.sum b/license-eye/go.sum similarity index 100% rename from go.sum rename to license-eye/go.sum diff --git a/internal/logger/log.go b/license-eye/internal/logger/log.go similarity index 100% rename from internal/logger/log.go rename to license-eye/internal/logger/log.go diff --git a/pkg/config/Config.go b/license-eye/pkg/config/Config.go similarity index 100% rename from pkg/config/Config.go rename to license-eye/pkg/config/Config.go diff --git a/pkg/header/check.go b/license-eye/pkg/header/check.go similarity index 100% rename from pkg/header/check.go rename to license-eye/pkg/header/check.go diff --git a/pkg/header/config.go b/license-eye/pkg/header/config.go similarity index 100% rename from pkg/header/config.go rename to license-eye/pkg/header/config.go diff --git a/pkg/header/fix/angle_bracket.go b/license-eye/pkg/header/fix/angle_bracket.go similarity index 100% rename from pkg/header/fix/angle_bracket.go rename to license-eye/pkg/header/fix/angle_bracket.go diff --git a/pkg/header/fix/double_slash.go b/license-eye/pkg/header/fix/double_slash.go similarity index 100% rename from pkg/header/fix/double_slash.go rename to license-eye/pkg/header/fix/double_slash.go diff --git a/pkg/header/fix/fix.go b/license-eye/pkg/header/fix/fix.go similarity index 100% rename from pkg/header/fix/fix.go rename to license-eye/pkg/header/fix/fix.go diff --git a/pkg/header/fix/hashtag.go b/license-eye/pkg/header/fix/hashtag.go similarity index 100% rename from pkg/header/fix/hashtag.go rename to license-eye/pkg/header/fix/hashtag.go diff --git a/pkg/header/fix/slash_asterisk.go b/license-eye/pkg/header/fix/slash_asterisk.go similarity index 100% rename from pkg/header/fix/slash_asterisk.go rename to license-eye/pkg/header/fix/slash_asterisk.go diff --git a/pkg/header/result.go b/license-eye/pkg/header/result.go similarity index 100% rename from pkg/header/result.go rename to license-eye/pkg/header/result.go diff --git a/test/.licenserc_for_test_check.yaml b/license-eye/testdata/.licenserc_for_test_check.yaml similarity index 97% rename from test/.licenserc_for_test_check.yaml rename to license-eye/testdata/.licenserc_for_test_check.yaml index cad5ecb..1ae329e 100644 --- a/test/.licenserc_for_test_check.yaml +++ b/license-eye/testdata/.licenserc_for_test_check.yaml @@ -18,7 +18,7 @@ header: under the License. paths: - - 'test/**' + - 'testdata/**' paths-ignore: - '**/.DS_Store' diff --git a/test/.licenserc_for_test_fix.yaml b/license-eye/testdata/.licenserc_for_test_fix.yaml similarity index 96% rename from test/.licenserc_for_test_fix.yaml rename to license-eye/testdata/.licenserc_for_test_fix.yaml index 19a864b..008e9f4 100644 --- a/test/.licenserc_for_test_fix.yaml +++ b/license-eye/testdata/.licenserc_for_test_fix.yaml @@ -18,7 +18,7 @@ header: under the License. paths: - - 'test/include_test/**' + - 'testdata/include_test/**' paths-ignore: - '**/.DS_Store' diff --git a/test/exclude_test/directories/testcase.go b/license-eye/testdata/exclude_test/directories/testcase.go similarity index 100% rename from test/exclude_test/directories/testcase.go rename to license-eye/testdata/exclude_test/directories/testcase.go diff --git a/test/exclude_test/extensions/testcase.json b/license-eye/testdata/exclude_test/extensions/testcase.json similarity index 100% rename from test/exclude_test/extensions/testcase.json rename to license-eye/testdata/exclude_test/extensions/testcase.json diff --git a/test/exclude_test/extensions/testcase.md b/license-eye/testdata/exclude_test/extensions/testcase.md similarity index 100% rename from test/exclude_test/extensions/testcase.md rename to license-eye/testdata/exclude_test/extensions/testcase.md diff --git a/test/exclude_test/extensions/testcase.xml b/license-eye/testdata/exclude_test/extensions/testcase.xml similarity index 100% rename from test/exclude_test/extensions/testcase.xml rename to license-eye/testdata/exclude_test/extensions/testcase.xml diff --git a/test/include_test/with_license/testcase.go b/license-eye/testdata/include_test/with_license/testcase.go similarity index 100% rename from test/include_test/with_license/testcase.go rename to license-eye/testdata/include_test/with_license/testcase.go diff --git a/test/include_test/with_license/testcase.graphql b/license-eye/testdata/include_test/with_license/testcase.graphql similarity index 100% rename from test/include_test/with_license/testcase.graphql rename to license-eye/testdata/include_test/with_license/testcase.graphql diff --git a/test/include_test/with_license/testcase.java b/license-eye/testdata/include_test/with_license/testcase.java similarity index 100% rename from test/include_test/with_license/testcase.java rename to license-eye/testdata/include_test/with_license/testcase.java diff --git a/test/include_test/with_license/testcase.py b/license-eye/testdata/include_test/with_license/testcase.py similarity index 100% rename from test/include_test/with_license/testcase.py rename to license-eye/testdata/include_test/with_license/testcase.py diff --git a/test/include_test/with_license/testcase.sh b/license-eye/testdata/include_test/with_license/testcase.sh similarity index 100% rename from test/include_test/with_license/testcase.sh rename to license-eye/testdata/include_test/with_license/testcase.sh diff --git a/test/include_test/with_license/testcase.yaml b/license-eye/testdata/include_test/with_license/testcase.yaml similarity index 100% rename from test/include_test/with_license/testcase.yaml rename to license-eye/testdata/include_test/with_license/testcase.yaml diff --git a/test/include_test/with_license/testcase.yml b/license-eye/testdata/include_test/with_license/testcase.yml similarity index 100% rename from test/include_test/with_license/testcase.yml rename to license-eye/testdata/include_test/with_license/testcase.yml diff --git a/test/include_test/without_license/testcase.go b/license-eye/testdata/include_test/without_license/testcase.go similarity index 100% rename from test/include_test/without_license/testcase.go rename to license-eye/testdata/include_test/without_license/testcase.go diff --git a/test/include_test/without_license/testcase.graphql b/license-eye/testdata/include_test/without_license/testcase.graphql similarity index 100% rename from test/include_test/without_license/testcase.graphql rename to license-eye/testdata/include_test/without_license/testcase.graphql diff --git a/test/include_test/without_license/testcase.java b/license-eye/testdata/include_test/without_license/testcase.java similarity index 100% rename from test/include_test/without_license/testcase.java rename to license-eye/testdata/include_test/without_license/testcase.java diff --git a/test/include_test/without_license/testcase.md b/license-eye/testdata/include_test/without_license/testcase.md similarity index 100% rename from test/include_test/without_license/testcase.md rename to license-eye/testdata/include_test/without_license/testcase.md diff --git a/test/include_test/without_license/testcase.py b/license-eye/testdata/include_test/without_license/testcase.py similarity index 100% rename from test/include_test/without_license/testcase.py rename to license-eye/testdata/include_test/without_license/testcase.py diff --git a/test/include_test/without_license/testcase.sh b/license-eye/testdata/include_test/without_license/testcase.sh similarity index 100% rename from test/include_test/without_license/testcase.sh rename to license-eye/testdata/include_test/without_license/testcase.sh diff --git a/test/include_test/without_license/testcase.yaml b/license-eye/testdata/include_test/without_license/testcase.yaml similarity index 100% rename from test/include_test/without_license/testcase.yaml rename to license-eye/testdata/include_test/without_license/testcase.yaml diff --git a/test/include_test/without_license/testcase.yml b/license-eye/testdata/include_test/without_license/testcase.yml similarity index 100% rename from test/include_test/without_license/testcase.yml rename to license-eye/testdata/include_test/without_license/testcase.yml
