-
-
Notifications
You must be signed in to change notification settings - Fork 261
Expand file tree
/
Copy pathcheck-headers.sh
More file actions
72 lines (47 loc) · 1.4 KB
/
check-headers.sh
File metadata and controls
72 lines (47 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
if [ -z "$*" ]
then
exit 0
fi
grep -L '^# Copyright (C) [0-9-]*,\? Python Software Foundation' $* | while read -r file
do
cat <<EOF
Please update the po comment in $file using:
sed -i '1i # Copyright (C) $(date +%Y), Python Software Foundation' "$file"
EOF
done
grep -l '^# SOME DESCRIPTIVE TITLE' $* | while read -r file
do
cat <<EOF
Please clean the po comment in $file using:
sed -i '/^# SOME DESCRIPTIVE TITLE/d' "$file"
EOF
done
grep -l '^# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.' $* | while read -r file
do
cat <<EOF
Please clean the po comment in $file using:
sed -i '/^# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR./d' "$file"
EOF
done
grep -L '^"Project-Id-Version: Python 3\\n"$' $* | while read -r file
do
cat <<EOF
Please update the 'Project-Id-Version' header in $file using:
sed -i 's/^"Project-Id-Version:.*"$/"Project-Id-Version: Python 3\\\\n"/' $file
EOF
done
grep -L '^"Language: fr\\n"$' $* | while read -r file
do
cat <<EOF
Please update the 'Language' header in $file using:
sed -i 's/^.Language-Team.*/\\0\\n"Language: fr\\\\n"/' $file
EOF
done
grep -L '^"Language-Team: FRENCH <traductions@lists.afpy.org>\\n"' $* | while read -r file
do
cat <<EOF
Please update the 'Language-Team' header in $file using:
sed -i 's/"Language-Team: LANGUAGE <LL@li.org>\\\\n"/"Language-Team: FRENCH <traductions@lists.afpy.org>\\\\n"/' $file
EOF
done