Skip to content

Commit

Permalink
add tools to check ASF headers in code files. (apache#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
Firstsawyou authored and LiteSun committed Sep 21, 2020
1 parent e8b0cb2 commit 8ff2080
Show file tree
Hide file tree
Showing 19 changed files with 326 additions and 4 deletions.
105 changes: 105 additions & 0 deletions .actions/ASF-Release.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements; and to You under the Apache License, Version 2.0.

# scanCode.py configuration file

# List of filenames containing the text of valid license (headers)
# These files SHOULD be in the same directory path where scanCode.py
# resides.
[Licenses]
ASFLicenseHeader.txt
ASFLicenseHeaderBash.txt
ASFLicenseHeaderMarkdown.txt
ASFLicenseHeaderLua.txt

# Filters (path/filename) with wildcards and associated scan checks
# that are to be run against them. The checks are actual valid
# function names found in scanCode.py.
[Includes]
*=is_not_symlink, regex_check
*.conf=has_block_license, eol_at_eof, regex_check
*.go=has_block_license, eol_at_eof, regex_check
*.gradle=has_block_license, eol_at_eof, regex_check
*.groovy=has_block_license, eol_at_eof, regex_check
*.html=has_block_license, regex_check
*.java=no_tabs, has_block_license, eol_at_eof, regex_check
*.js=has_block_license, regex_check
*.md=no_tabs, has_block_license, eol_at_eof, regex_check
*.properties=no_tabs, has_block_license, eol_at_eof, regex_check
*.py=no_tabs, has_block_license, eol_at_eof, regex_check
*.scala=has_block_license, no_tabs, eol_at_eof, regex_check
*.sh=has_block_license, eol_at_eof, regex_check
*.swift=no_tabs, has_block_license, eol_at_eof, regex_check
*.yaml=has_block_license, eol_at_eof, regex_check
*.yml=has_block_license, eol_at_eof, regex_check
*.css=has_block_license, regex_check
*.tsx=has_block_license, regex_check
*.ts=has_block_license, regex_check
*.less=has_block_license, regex_check
*Dockerfile*=has_block_license

# Sanity check files not required to have ASF headers because either they
# are excluded or are not packaged with the Apache source release.
*.cfg=regex_check
*.ini=regex_check
*.j2=regex_check
*.json=regex_check
*.txt=regex_check
*.xml=regex_check

# List of paths (inclusive of subdirectories) to exclude from code scanning
[Excludes]

# General tooling & binary file exclusions
.bin
.dockerignore
.eslintrc.*
.git
.gitattributes
.github
.gitignore
.gradle
.idea
.jshintrc
.pydevproject
.rat-excludes
.tox

# Skip files containing MIT License
scripts/verifyCommit.js
src/components/HeaderDropdown/index.less
src/components/HeaderDropdown/index.tsx
src/components/NoticeIcon
src/components/PageLoading/index.tsx
src/components/RightContent
src/e2e/__mocks__/antd-pro-merge-less.js
src/e2e/baseLayout.e2e.js
src/pages/404.tsx
src/service-worker.js
compose/dashboard_conf/nginx.conf
docker/nginx.conf

# The README.md file cannot be found, but it will be detected
dag-to-lua-1.1/README.md

api/build.sh


# Exclude Apache standard legal files
CREDITS.txt
DISCLAIMER.txt
LICENSE*.txt
NOTICE.txt

conf
.actions/openwhisk-utilities

[Options]
# Not all code files allow licenses to appear starting at the first character
# of the file. This option tells the scan to allow licenses to appear starting
# within the first 'x' characters of each code file (as provided by this option's
# value).
LICENSE_SLACK_LENGTH=500

# List of regular expressions for forbidden strings, e.g. \w+@company.com
[Regex]
18 changes: 18 additions & 0 deletions .actions/ASFLicenseHeaderMarkdown.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--
#
# 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 regarding copyright ownership.
# The 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.
#
-->
1 change: 1 addition & 0 deletions .actions/openwhisk-utilities
Submodule openwhisk-utilities added at 8636f9
4 changes: 4 additions & 0 deletions .github/workflows/api_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ jobs:
working-directory: ./api
run: |
go test ./...
- name: run Makefile
run: |
make license-check
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
<!--
#
# 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 regarding copyright ownership.
# The 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.
#
-->

# Contributing to Apache APISIX Dashboard

Firstly, thanks for your interest in contributing! I hope that this will be a
Expand Down
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# 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 regarding copyright ownership.
# The 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-check: Check apisix-dashboard source code for Apache License
.PHONY: license-check
license-check:
ifeq ("$(wildcard .actions/openwhisk-utilities/scancode/scanCode.py)", "")
git clone https://github.com/apache/openwhisk-utilities.git .actions/openwhisk-utilities
cp .actions/ASF* .actions/openwhisk-utilities/scancode/
endif
.actions/openwhisk-utilities/scancode/scanCode.py --config .actions/ASF-Release.cfg ./
19 changes: 19 additions & 0 deletions USER_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
<!--
#
# 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 regarding copyright ownership.
# The 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.
#
-->

# User Guide

Please visit [http://139.217.190.60/](http://139.217.190.60/) in browser to have a full-preview of the Apache APISIX Dashboard.
Expand Down
16 changes: 16 additions & 0 deletions api/route/route_group.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* 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 regarding copyright ownership.
* The 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.
*/
package route

import (
Expand Down
16 changes: 16 additions & 0 deletions api/route/route_group_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* 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 regarding copyright ownership.
* The 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.
*/
package route

import (
Expand Down
16 changes: 16 additions & 0 deletions api/service/upstream_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* 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 regarding copyright ownership.
* The 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.
*/
package service

import (
Expand Down
1 change: 0 additions & 1 deletion compose/apisix_conf/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ etcd:
- "http://192.17.5.10:2379" # multiple etcd address
prefix: "/apisix" # apisix configurations prefix
timeout: 30 # 30 seconds

2 changes: 1 addition & 1 deletion compose/grafana_conf/provisioning/dashboards/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ providers:
disableDeletion: false
editable: false
options:
path: /var/lib/grafana/dashboards
path: /var/lib/grafana/dashboards
2 changes: 1 addition & 1 deletion compose/grafana_conf/provisioning/datasources/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ datasources:
org_id: 1
type: 'prometheus'
url: 'http://prometheus:9090'
version: 1
version: 1
2 changes: 1 addition & 1 deletion src/pages/Consumer/components/Step1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ const Step1: React.FC<Props> = ({ form, disabled }) => {
);
};

export default Step1;
export default Step1;
16 changes: 16 additions & 0 deletions src/pages/Route/components/Step3/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* 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 regarding copyright ownership.
* The 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.
*/
import React, { useState } from 'react';
import { Radio, Tooltip } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
Expand Down
17 changes: 17 additions & 0 deletions src/pages/User/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
/*
* 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 regarding copyright ownership.
* The 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.
*/

export { default as UserZhCN } from './locales/zh-CN';
export { default as UserEnUS } from './locales/en-US';
17 changes: 17 additions & 0 deletions src/pages/User/locales/en-US.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* 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 regarding copyright ownership.
* The 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.
*/

export default {
'component.user.login': 'Login',
'component.user.loginMethodPassword': 'Username & Password',
Expand Down
17 changes: 17 additions & 0 deletions src/pages/User/locales/zh-CN.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* 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 regarding copyright ownership.
* The 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.
*/

export default {
'component.user.login': '登录',
'component.user.loginMethodPassword': '账号密码登录',
Expand Down
17 changes: 17 additions & 0 deletions src/pages/User/typing.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* 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 regarding copyright ownership.
* The 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.
*/

import React from 'react';

declare namespace UserModule {
Expand Down

0 comments on commit 8ff2080

Please sign in to comment.