-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add license check for move, typescript, javascript files (#1051)
- Loading branch information
Showing
5 changed files
with
20 additions
and
7 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
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 |
---|---|---|
@@ -1,20 +1,21 @@ | ||
#!/bin/bash | ||
# shellcheck disable=SC2044 | ||
# shellcheck disable=SC2044,SC2086,SC2016 | ||
# This script checks each file starts with a license comment | ||
set -e | ||
set -o pipefail | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
TOPLEVEL="${DIR}/../" | ||
|
||
# Iterate over rust files not in the target directory | ||
for i in $(find "$TOPLEVEL" -path "$TOPLEVEL/target" -prune -o -iname "*.rs" -print) | ||
# Iterate over files in the repo that satisfy the following rules | ||
# 1. File extension is one of .(move | rs | tsx | ts | js) | ||
# 2. File directory is not '$TOPLEVEL/target' or "**/build" or "**/node_modules" | ||
for i in $(find $TOPLEVEL -type d \( -path '$TOPLEVEL/target' -o -name 'node_modules' -o -name 'build' \) -prune -o \( -iname '*.rs' -o -iname '*.move' -o -iname '*.tsx' -o -iname '*.ts' -o -iname '*.js' \) -print) | ||
do | ||
CNT=$(head -n3 "$i" | grep -oEe '// (Copyright \(c\) 2022, Mysten Labs, Inc.|SPDX-License-Identifier: Apache-2.0)' | wc -l) | ||
# echo "$i $CNT" | ||
CNT=$(head -n3 "$i" | grep -oEe '// (Copyright \(c\) 2022, Mysten Labs, Inc.|SPDX-License-Identifier: Apache-2.0)' | wc -l) || true | ||
if [ "$CNT" -lt 2 ] | ||
then | ||
echo "File $i has an incorrect license header" | ||
exit 1 | ||
echo "File $i has an incorrect license header" | ||
exit 1 | ||
fi | ||
done |
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
95ed0a6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bench results
�[0m�[0m�[1m�[32m Finished�[0m release [optimized] target(s) in 0.29s
�[0m�[0m�[1m�[32m Running�[0m
target/release/bench
�[2m2022-03-24T22:52:35.240056Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Starting benchmark: TransactionsAndCerts
�[2m2022-03-24T22:52:35.240088Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Preparing accounts.
�[2m2022-03-24T22:52:35.240526Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Open database on path: "/tmp/DB_BB66C4CF424FF93FA6550618DF64AB1E990C9AAC"
�[2m2022-03-24T22:52:35.411590Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Init Authority.
�[2m2022-03-24T22:52:35.515042Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Generate empty store with Genesis.
�[2m2022-03-24T22:52:36.180140Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Preparing transactions.
�[2m2022-03-24T22:52:36.644118Z�[0m �[32m INFO�[0m �[2msui_network::transport�[0m�[2m:�[0m Listening to TCP traffic on 127.0.0.1:9555
�[2m2022-03-24T22:52:37.645486Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Number of TCP connections: 2
�[2m2022-03-24T22:52:37.645547Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Sending requests.
�[2m2022-03-24T22:52:37.646310Z�[0m �[32m INFO�[0m �[2msui_network::network�[0m�[2m:�[0m Sending TCP requests to 127.0.0.1:9555
�[2m2022-03-24T22:52:37.646322Z�[0m �[32m INFO�[0m �[2msui_network::network�[0m�[2m:�[0m Sending TCP requests to 127.0.0.1:9555
�[2m2022-03-24T22:52:39.838825Z�[0m �[32m INFO�[0m �[2msui_network::network�[0m�[2m:�[0m Done sending TCP requests to 127.0.0.1:9555
�[2m2022-03-24T22:52:39.878281Z�[0m �[32m INFO�[0m �[2msui_network::network�[0m�[2m:�[0m Done sending TCP requests to 127.0.0.1:9555
�[2m2022-03-24T22:52:39.878385Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Received 2000 responses.
�[2m2022-03-24T22:52:39.951662Z�[0m �[33m WARN�[0m �[2mbench�[0m�[2m:�[0m Completed benchmark for TransactionsAndCerts
Total time: 2232822us, items: 100000, tx/sec: 44786.373477151334