-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathTaskfile.yml
100 lines (98 loc) · 2.97 KB
/
Taskfile.yml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# See: https://taskfile.dev/#/usage
version: "3"
tasks:
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-files-task/Taskfile.yml
general:check-filenames:
desc: Check for non-portable filenames
cmds:
- |
find . \
-type d -name '.git' -prune -o \
-type d -name '.licenses' -prune -o \
-type d -name '__pycache__' -prune -o \
-type d -name 'node_modules' -prune -o \
-exec \
sh \
-c \
' \
basename "$0" | \
grep \
--extended-regexp \
--regexp='"'"'([<>:"/\\|?*'"'"'"$(printf "\001-\037")"'"'"'])|(.+\.$)'"'"' \
--silent \
&& \
echo "$0"
' \
'{}' \
\; \
-execdir \
false \
'{}' \
+ \
|| \
{
echo
echo "Prohibited characters found in filenames"
echo "See:"
echo "https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions:~:text=except%20for%20the%20following"
false
}
- |
find . \
-type d -name '.git' -prune -o \
-type d -name '.licenses' -prune -o \
-type d -name '__pycache__' -prune -o \
-type d -name 'node_modules' -prune -o \
-exec \
sh \
-c \
' \
basename "$0" | \
grep \
--ignore-case \
--extended-regexp \
--regexp='"'"'^(con|prn|aux|nul|com[0-9]+|lpt[0-9]+)$'"'"' \
--silent \
&& \
echo "$0"
' \
'{}' \
\; \
-execdir \
false \
'{}' \
+ \
|| \
{
echo
echo "Reserved filenames found"
echo "See:"
echo "https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions:~:text=use%20the%20following-,reserved%20names,-for%20the%20name"
false
}
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-files-task/Taskfile.yml
general:check-symlinks:
desc: Check for bad symlinks
cmds:
- |
find . \
-type d -name '.git' -prune -o \
-type d -name '.licenses' -prune -o \
-type d -name '__pycache__' -prune -o \
-type d -name 'node_modules' -prune -o \
-type l \
-execdir \
test ! -e '{}' \
\; \
-exec \
echo '{}' \
\; \
-execdir \
false \
'{}' \
+ \
|| \
{
echo 'Broken or circular symlink found'
false
}