From 0b67e59752b8b2db5fbce3eb07b74e804fd03874 Mon Sep 17 00:00:00 2001 From: Qicz Date: Tue, 2 Aug 2022 15:53:19 +0800 Subject: [PATCH] update license template (#6) --- .github/workflows/license.yaml | 18 ++++++++++++++++++ .licenserc.json | 21 +++++++++++++++++++++ NOTICE | 5 +++++ cmd/gobatis-plus/customargs/args.go | 6 +++--- cmd/gobatis-plus/main.go | 7 +++---- example/doc.go | 6 +++--- example/example.go | 6 +++--- pkg/constants/keyword.go | 6 +++--- pkg/constants/string_pool.go | 6 +++--- pkg/generator/gobatis-gen.go | 7 +++---- pkg/mapper/base.go | 6 +++--- pkg/mapper/base_mapper.go | 11 ++++++----- pkg/mapper/base_mapper_test.go | 20 +++++++++++++++++++- pkg/mapper/query_wrapper.go | 6 +++--- pkg/mapper/wapper.go | 6 +++--- pkg/mapper/wrapper.go | 6 +++--- pkg/parser/tags.go | 6 +++--- pkg/plugin/constants.go | 6 +++--- pkg/plugin/data.go | 6 +++--- pkg/plugin/mapper.go | 6 +++--- pkg/plugin/plugin.go | 6 +++--- pkg/plugin/register.go | 6 +++--- 22 files changed, 120 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/license.yaml create mode 100644 .licenserc.json create mode 100644 NOTICE diff --git a/.github/workflows/license.yaml b/.github/workflows/license.yaml new file mode 100644 index 0000000..7e216e6 --- /dev/null +++ b/.github/workflows/license.yaml @@ -0,0 +1,18 @@ +name: License Checking + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + license: + name: License Checking + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Check License Lines + uses: kt3k/license_checker@v1.0.6 diff --git a/.licenserc.json b/.licenserc.json new file mode 100644 index 0000000..d9eacf1 --- /dev/null +++ b/.licenserc.json @@ -0,0 +1,21 @@ +{ + "**/*.go" :[ + "/*", + "* Licensed to the AcmeStack under one or more contributor license", + "* agreements. See the NOTICE file distributed with this work for", + "* additional information regarding copyright ownership.", + "* 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.", + "*/" + + ] +} \ No newline at end of file diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..c421e45 --- /dev/null +++ b/NOTICE @@ -0,0 +1,5 @@ +Copyright (c) 2013 - 2022, AcmeStack +All rights reserved. + +This product includes software developed at +The AcmeStack (https://www.acmestack.org/). diff --git a/cmd/gobatis-plus/customargs/args.go b/cmd/gobatis-plus/customargs/args.go index 51306e6..cd0ca79 100644 --- a/cmd/gobatis-plus/customargs/args.go +++ b/cmd/gobatis-plus/customargs/args.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 diff --git a/cmd/gobatis-plus/main.go b/cmd/gobatis-plus/main.go index c95dac0..efb2441 100644 --- a/cmd/gobatis-plus/main.go +++ b/cmd/gobatis-plus/main.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 @@ -23,7 +23,6 @@ import ( "github.com/acmestack/gobatis-plus/cmd/gobatis-plus/customargs" "github.com/acmestack/gobatis-plus/pkg/generator" "github.com/spf13/pflag" - "k8s.io/klog/v2" ) func main() { diff --git a/example/doc.go b/example/doc.go index 5da709c..bf65163 100644 --- a/example/doc.go +++ b/example/doc.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 diff --git a/example/example.go b/example/example.go index f1b2cdf..0bbf515 100644 --- a/example/example.go +++ b/example/example.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 diff --git a/pkg/constants/keyword.go b/pkg/constants/keyword.go index cf9a098..6f1da9c 100644 --- a/pkg/constants/keyword.go +++ b/pkg/constants/keyword.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 diff --git a/pkg/constants/string_pool.go b/pkg/constants/string_pool.go index adcce07..d4705eb 100644 --- a/pkg/constants/string_pool.go +++ b/pkg/constants/string_pool.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 diff --git a/pkg/generator/gobatis-gen.go b/pkg/generator/gobatis-gen.go index dc091e5..62c77d2 100644 --- a/pkg/generator/gobatis-gen.go +++ b/pkg/generator/gobatis-gen.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 @@ -29,7 +29,6 @@ import ( "k8s.io/gengo/generator" "k8s.io/gengo/namer" "k8s.io/gengo/types" - "k8s.io/klog/v2" ) var ( diff --git a/pkg/mapper/base.go b/pkg/mapper/base.go index ee08c21..a8de5da 100644 --- a/pkg/mapper/base.go +++ b/pkg/mapper/base.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 diff --git a/pkg/mapper/base_mapper.go b/pkg/mapper/base_mapper.go index e179b9d..b3c6b9b 100644 --- a/pkg/mapper/base_mapper.go +++ b/pkg/mapper/base_mapper.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 @@ -19,12 +19,13 @@ package mapper import ( "context" - "github.com/acmestack/gobatis" - "github.com/acmestack/gobatis-plus/pkg/constants" "reflect" "strconv" "strings" "time" + + "github.com/acmestack/gobatis" + "github.com/acmestack/gobatis-plus/pkg/constants" ) type BaseMapper[T any] struct { diff --git a/pkg/mapper/base_mapper_test.go b/pkg/mapper/base_mapper_test.go index 8d1e017..3385778 100644 --- a/pkg/mapper/base_mapper_test.go +++ b/pkg/mapper/base_mapper_test.go @@ -1,13 +1,31 @@ +/* + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + * 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 mapper import ( "encoding/json" "fmt" + "testing" + "github.com/acmestack/gobatis" "github.com/acmestack/gobatis/datasource" "github.com/acmestack/gobatis/factory" _ "github.com/go-sql-driver/mysql" - "testing" ) func connect() factory.Factory { diff --git a/pkg/mapper/query_wrapper.go b/pkg/mapper/query_wrapper.go index 1df7b1e..e8f712e 100644 --- a/pkg/mapper/query_wrapper.go +++ b/pkg/mapper/query_wrapper.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 diff --git a/pkg/mapper/wapper.go b/pkg/mapper/wapper.go index 3dfa7e4..d6a8e62 100644 --- a/pkg/mapper/wapper.go +++ b/pkg/mapper/wapper.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 diff --git a/pkg/mapper/wrapper.go b/pkg/mapper/wrapper.go index 46986c5..823e156 100644 --- a/pkg/mapper/wrapper.go +++ b/pkg/mapper/wrapper.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 diff --git a/pkg/parser/tags.go b/pkg/parser/tags.go index 6fd32aa..2e0491a 100644 --- a/pkg/parser/tags.go +++ b/pkg/parser/tags.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 diff --git a/pkg/plugin/constants.go b/pkg/plugin/constants.go index 075e676..1b1840d 100644 --- a/pkg/plugin/constants.go +++ b/pkg/plugin/constants.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 diff --git a/pkg/plugin/data.go b/pkg/plugin/data.go index e465ea8..b6ef0dd 100644 --- a/pkg/plugin/data.go +++ b/pkg/plugin/data.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 diff --git a/pkg/plugin/mapper.go b/pkg/plugin/mapper.go index 28f5371..8abaff2 100644 --- a/pkg/plugin/mapper.go +++ b/pkg/plugin/mapper.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 diff --git a/pkg/plugin/plugin.go b/pkg/plugin/plugin.go index e643741..be700b3 100644 --- a/pkg/plugin/plugin.go +++ b/pkg/plugin/plugin.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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 diff --git a/pkg/plugin/register.go b/pkg/plugin/register.go index 130ae1f..1262324 100644 --- a/pkg/plugin/register.go +++ b/pkg/plugin/register.go @@ -1,7 +1,7 @@ /* - * Copyright (c) 2022, AcmeStack - * All rights reserved. - * + * Licensed to the AcmeStack under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * 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