forked from hyperledger-labs/go-perun
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📄 Add NOTICE file and CI check, update README
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
- Loading branch information
Showing
5 changed files
with
124 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2020 - See NOTICE file for copyright holders. | ||
# | ||
# 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. | ||
|
||
set -e | ||
exit_code=0 | ||
|
||
# This script checks that all new commiters email adresses are contained in the NOTICE | ||
# file. | ||
# To check all commits on the current branch: ./check-notice-authors.sh | ||
# To check all commits newer than base: ./check-notice-authors.sh base | ||
|
||
# Call with an ancestor whereas all commits newer than the ancestor are checked. | ||
base="$1" | ||
if [ -z "$base" ]; then | ||
commits="$(git rev-list --reverse HEAD)" | ||
else | ||
commits="$(git rev-list --reverse $base..HEAD)" | ||
fi | ||
|
||
# Authors found in commits and NOTICE. | ||
declare -A known_authors | ||
# Authors found only in commits but not NOTICE file. | ||
declare -A assumed_authors | ||
|
||
for c in $commits; do | ||
author=$(git show -s --format='%an <%ae>' $c) | ||
# Check Signed-Off-By message | ||
if ! git show -s --format='%B' $c | grep -wq "Signed-off-by: $author"; then | ||
echo "Commit $c is missing or has wrong 'Signed-off-by' message." | ||
exit_code=1 | ||
fi | ||
|
||
# Get the notice file of the commit and check that the author is in it. | ||
notice=$(git show $c:NOTICE 2> /dev/null || true) | ||
for k in "${known_authors[@]}"; do | ||
a="${known_authors[$k]}" | ||
if ! echo "$notice" | grep -wq "$a"; then | ||
echo "Author '$a' was deleted from NOTICE in commit $c" | ||
exit_code=1 | ||
fi | ||
done | ||
if [ -n "${assumed_authors[$author]}" ]; then | ||
continue | ||
fi | ||
# This must be the first commit of this author, since he should add himself | ||
# to the NOTICE file here. | ||
if ! echo "$notice" | grep -wq "$author"; then | ||
echo "Author '$author' is missing from NOTICE file and should have been added in commit $c." | ||
assumed_authors[$author]="$author" | ||
unset "known_authors[$author]" | ||
exit_code=1 | ||
else | ||
known_authors[$author]="$author" | ||
unset "assumed_authors[$author]" | ||
fi | ||
done | ||
|
||
exit $exit_code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
// Copyright (c) 20XX Chair of Applied Cryptography, Technische Universität | ||
// Darmstadt, Germany. All rights reserved. This file is part of go-perun. Use | ||
// of this source code is governed by the Apache 2.0 license that can be found | ||
// in the LICENSE file. | ||
// Copyright 20XX - See NOTICE file for copyright holders. | ||
// | ||
// 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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This is the official list of Perun Network go-perun copyright | ||
# holders and authors. | ||
# | ||
# Often employers or academic institutions have ownership over code that is | ||
# written in certain circumstances, so please do due diligence to ensure that | ||
# you have the right to submit the code. | ||
# | ||
# When adding J Random Contributor's name to this file, either J's name on its | ||
# own or J's name associated with J's organization's name should be added, | ||
# depending on whether J's employer (or academic institution) has ownership | ||
# over code that is written for this project. | ||
# | ||
# How to add names to this file: | ||
# Individual's name <submission email address>. | ||
# | ||
# If Individual's organization is copyright holder of her contributions add the | ||
# organization's name, optionally also the contributor's name: | ||
# | ||
# Organization's name | ||
# Individual's name <submission corporate email address> | ||
# | ||
# Please keep the list in alphabetical order. | ||
|
||
Chair of Applied Cryptography, Technische Universität Darmstadt, Germany | ||
Hendrik Amler <[email protected]> | ||
Christoph Conrads <[email protected]> | ||
Norbert Dzikowski <[email protected]> | ||
Luigi Iandolo <[email protected]> | ||
Steffen Rattay <[email protected]> | ||
Sebastian Stammler <[email protected]> | ||
Oliver Tale-Yazdi <[email protected]> | ||
Marius van der Wijden <[email protected]> | ||
|
||
Robert Bosch GmbH | ||
Manoranjith <[email protected]> | ||
Anagha Sukumaran <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters