Reorganize the directory structure to monorepo
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 @@
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 @@
- 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 @@
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
+
+Infra tools that are created and used by the SkyWalking Team.
+
+== License Eye
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
-
-[source]
-----
-$ 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 98%
rename from Dockerfile
rename to license-eye/Dockerfile
index 62c66ee..77731eb 100644
--- a/Dockerfile
+++ b/license-eye/Dockerfile
@@ -19,7 +19,7 @@
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 @@
.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/license-eye/README.adoc b/license-eye/README.adoc
new file mode 100644
index 0000000..db47c46
--- /dev/null
+++ b/license-eye/README.adoc
@@ -0,0 +1,90 @@
+// Licensed to 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. Apache Software Foundation (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.
+//
+= License-Eye
+:repo: https://github.com/apache/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 skywalking-eyes/license-eye
+make
+----
+
+== Usage
+
+[source]
+----
+$ 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]
+.testdata/.licenserc_for_test.yaml
+----
+include::testdata/.licenserc_for_test_check.yaml[]
+----
+
+== Check
+
+[source]
+----
+bin/license-eye -c testdata/.licenserc_for_test_fix.yaml header check
+
+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:
+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
+----
+
+== Fix
+
+[source]
+----
+bin/license-eye -c testdata/.licenserc_for_test_fix.yaml header fix
+
+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 @@
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 @@
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