Skip to content

Commit 6ce7b4e

Browse files
committed
Standardize and auto add license headers for Shell files with pre-commit
1 parent ac3b180 commit 6ce7b4e

File tree

11 files changed

+140
-124
lines changed

11 files changed

+140
-124
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ repos:
6262
- .github/workflows/license-templates/LICENSE.txt
6363
- --fuzzy-match-generates-todo
6464
exclude: ^(CHANGES|ISSUE_TEMPLATE|PULL_REQUEST_TEMPLATE)\.md$|^ui/docs/(full|smoke)-test-plan\.template\.md$
65+
- id: insert-license
66+
name: add license for all Shell files
67+
description: automatically adds a licence header to all Shell files that don't have a license header
68+
files: \.sh$
69+
args:
70+
- --comment-style
71+
- '|#|'
72+
- --license-filepath
73+
- .github/workflows/license-templates/LICENSE.txt
74+
- --fuzzy-match-generates-todo
6575
- repo: https://github.com/pre-commit/pre-commit-hooks
6676
rev: v6.0.0
6777
hooks:

plugins/hypervisors/hyperv/buildagent.sh

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
#!/bin/bash
2-
# Licensed to the Apache Software Foundation (ASF) under one
3-
# or more contributor license agreements. See the NOTICE file
4-
# distributed with this work for additional information
5-
# regarding copyright ownership. The ASF licenses this file
6-
# to you under the Apache License, Version 2.0 (the
7-
# "License"); you may not use this file except in compliance
8-
# with the License. You may obtain a copy of the License at
2+
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
910
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11+
# http://www.apache.org/licenses/LICENSE-2.0
1112
#
12-
# Unless required by applicable law or agreed to in writing,
13-
# software distributed under the License is distributed on an
14-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
# KIND, either express or implied. See the License for the
16-
# specific language governing permissions and limitations
17-
# under the License.
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
1820
export EnableNuGetPackageRestore=true
1921
wget http://nuget.org/nuget.exe
2022
mv nuget.exe ./DotNet/ServerResource/.nuget/NuGet.exe
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
#Licensed to the Apache Software Foundation (ASF) under one
2-
#or more contributor license agreements. See the NOTICE file
3-
#distributed with this work for additional information
4-
#regarding copyright ownership. The ASF licenses this file
5-
#to you under the Apache License, Version 2.0 (the
6-
#"License"); you may not use this file except in compliance
7-
#with the License. You may obtain a copy of the License at
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
88
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
9+
# http://www.apache.org/licenses/LICENSE-2.0
1010
#
11-
#Unless required by applicable law or agreed to in writing,
12-
#software distributed under the License is distributed on an
13-
#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14-
#KIND, either express or implied. See the License for the
15-
#specific language governing permissions and limitations
16-
#under the License.
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
1717

1818
CERT="/etc/ovs-agent/cert"
1919
socat OPENSSL-LISTEN:8899,reuseaddr,fork,verify=0,key=$CERT/key.pem,cert=$CERT/certificate.pem TCP:localhost:8898 &
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
#Licensed to the Apache Software Foundation (ASF) under one
2-
#or more contributor license agreements. See the NOTICE file
3-
#distributed with this work for additional information
4-
#regarding copyright ownership. The ASF licenses this file
5-
#to you under the Apache License, Version 2.0 (the
6-
#"License"); you may not use this file except in compliance
7-
#with the License. You may obtain a copy of the License at
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
88
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
9+
# http://www.apache.org/licenses/LICENSE-2.0
1010
#
11-
#Unless required by applicable law or agreed to in writing,
12-
#software distributed under the License is distributed on an
13-
#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14-
#KIND, either express or implied. See the License for the
15-
#specific language governing permissions and limitations
16-
#under the License.
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
1717

1818
cd /var/log
1919
tail -f ovm-consoled.log devmon.log messages ovs-agent.log ovmwatch.log

scripts/vm/hypervisor/kvm/nasbackup.sh

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
#!/usr/bin/bash
2-
## Licensed to the Apache Software Foundation (ASF) under one
3-
## or more contributor license agreements. See the NOTICE file
4-
## distributed with this work for additional information
5-
## regarding copyright ownership. The ASF licenses this file
6-
## to you under the Apache License, Version 2.0 (the
7-
## "License"); you may not use this file except in compliance
8-
## with the License. You may obtain a copy of the License at
9-
##
10-
## http://www.apache.org/licenses/LICENSE-2.0
11-
##
12-
## Unless required by applicable law or agreed to in writing,
13-
## software distributed under the License is distributed on an
14-
## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
## KIND, either express or implied. See the License for the
16-
## specific language governing permissions and limitations
17-
## under the License.
2+
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
1819

1920
set -eo pipefail
2021

scripts/vm/hypervisor/kvm/nsrkvmbackup.sh

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
#!/bin/bash
2-
## Licensed to the Apache Software Foundation (ASF) under one
3-
## or more contributor license agreements. See the NOTICE file
4-
## distributed with this work for additional information
5-
## regarding copyright ownership. The ASF licenses this file
6-
## to you under the Apache License, Version 2.0 (the
7-
## "License"); you may not use this file except in compliance
8-
## with the License. You may obtain a copy of the License at
9-
##
10-
## http://www.apache.org/licenses/LICENSE-2.0
11-
##
12-
## Unless required by applicable law or agreed to in writing,
13-
## software distributed under the License is distributed on an
14-
## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
## KIND, either express or implied. See the License for the
16-
## specific language governing permissions and limitations
17-
## under the License.
2+
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
1819

1920
version=0.9.1
2021
OPTIND=1

scripts/vm/hypervisor/kvm/nsrkvmrestore.sh

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
#!/bin/bash
2-
## Licensed to the Apache Software Foundation (ASF) under one
3-
## or more contributor license agreements. See the NOTICE file
4-
## distributed with this work for additional information
5-
## regarding copyright ownership. The ASF licenses this file
6-
## to you under the Apache License, Version 2.0 (the
7-
## "License"); you may not use this file except in compliance
8-
## with the License. You may obtain a copy of the License at
9-
##
10-
## http://www.apache.org/licenses/LICENSE-2.0
11-
##
12-
## Unless required by applicable law or agreed to in writing,
13-
## software distributed under the License is distributed on an
14-
## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
## KIND, either express or implied. See the License for the
16-
## specific language governing permissions and limitations
17-
## under the License.
2+
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
1819

1920
version=0.9.1
2021
OPTIND=1

systemvm/debian/opt/cloud/bin/baremetal_snat.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#!/bin/bash
22

3-
#Licensed to the Apache Software Foundation (ASF) under one
4-
#or more contributor license agreements. See the NOTICE file
5-
#distributed with this work for additional information
6-
#regarding copyright ownership. The ASF licenses this file
7-
#to you under the Apache License, Version 2.0 (the
8-
#"License"); you may not use this file except in compliance
9-
#with the License. You may obtain a copy of the License at
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
1010
#
11-
# http://www.apache.org/licenses/LICENSE-2.0
11+
# http://www.apache.org/licenses/LICENSE-2.0
1212
#
13-
#Unless required by applicable law or agreed to in writing,
14-
#software distributed under the License is distributed on an
15-
#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16-
#KIND, either express or implied. See the License for the
17-
#specific language governing permissions and limitations
18-
#under the License.
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
1919

2020
set +u
2121

systemvm/debian/opt/cloud/bin/dnsmasq.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
23
# Licensed to the Apache Software Foundation (ASF) under one
34
# or more contributor license agreements. See the NOTICE file
45
# distributed with this work for additional information
@@ -10,6 +11,7 @@
1011
# http://www.apache.org/licenses/LICENSE-2.0
1112
#
1213
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
1315
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1416
# KIND, either express or implied. See the License for the
1517
# specific language governing permissions and limitations

systemvm/debian/opt/cloud/bin/prepare_pxe.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/sh
2-
#
2+
33
# Licensed to the Apache Software Foundation (ASF) under one
44
# or more contributor license agreements. See the NOTICE file
55
# distributed with this work for additional information
6-
# # regarding copyright ownership. The ASF licenses this file
6+
# regarding copyright ownership. The ASF licenses this file
77
# to you under the Apache License, Version 2.0 (the
88
# "License"); you may not use this file except in compliance
99
# with the License. You may obtain a copy of the License at
@@ -16,7 +16,6 @@
1616
# KIND, either express or implied. See the License for the
1717
# specific language governing permissions and limitations
1818
# under the License.
19-
#
2019

2120
set +u
2221

0 commit comments

Comments
 (0)