Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix insert-license pre-commit #756

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: check-yaml
- id: check-toml
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.3.1
rev: v1.4.2
hooks:
- id: insert-license
files: \.rs$
Expand All @@ -14,6 +14,7 @@ repos:
- scripts/license-header.txt
- --comment-style
- //
- --use-current-year
- repo: local
hooks:
- id: cargo-sort
Expand All @@ -24,4 +25,3 @@ repos:
types: [file, toml]
files: Cargo\.toml
pass_filenames: false

2 changes: 1 addition & 1 deletion scripts/check-license.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eu

for i in $(git ls-files --exclude-standard | grep "\.rs"); do
# first line -> match -> print line -> quit
matches=$(sed -n "1{/Copyright [0-9]\{4\} CeresDB Project Authors. Licensed under Apache-2.0./p;};q;" $i)
matches=$(sed -n "1{/CeresDB Project Authors. Licensed under Apache-2.0./p;};q;" $i)
if [ -z "${matches}" ]; then
echo "License header is missing from $i."
exit 1
Expand Down
2 changes: 1 addition & 1 deletion scripts/license-header.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0.
Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0.