@@ -41,6 +41,76 @@ tasks:
41
41
-s "{{.ACTION_METADATA_SCHEMA_PATH}}" \
42
42
-d "action.yml"
43
43
44
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-files-task/Taskfile.yml
45
+ general:check-filenames :
46
+ desc : Check for non-portable filenames
47
+ cmds :
48
+ - |
49
+ find . \
50
+ -type d -name '.git' -prune -o \
51
+ -type d -name '.licenses' -prune -o \
52
+ -type d -name '__pycache__' -prune -o \
53
+ -type d -name 'node_modules' -prune -o \
54
+ -exec \
55
+ sh \
56
+ -c \
57
+ ' \
58
+ basename "$0" | \
59
+ grep \
60
+ --perl-regexp \
61
+ --regexp='"'"'([<>:"/\\|?*\x{0000}-\x{001F}])|(.+\.$)'"'"' \
62
+ --silent \
63
+ && \
64
+ echo "$0"
65
+ ' \
66
+ '{}' \
67
+ \; \
68
+ -execdir \
69
+ false \
70
+ '{}' \
71
+ + \
72
+ || \
73
+ {
74
+ echo
75
+ echo "Prohibited characters found in filenames"
76
+ echo "See:"
77
+ echo "https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions:~:text=except%20for%20the%20following"
78
+ false
79
+ }
80
+ - |
81
+ find . \
82
+ -type d -name '.git' -prune -o \
83
+ -type d -name '.licenses' -prune -o \
84
+ -type d -name '__pycache__' -prune -o \
85
+ -type d -name 'node_modules' -prune -o \
86
+ -exec \
87
+ sh \
88
+ -c \
89
+ ' \
90
+ basename "$0" | \
91
+ grep \
92
+ --ignore-case \
93
+ --extended-regexp \
94
+ --regexp='"'"'^(con|prn|aux|nul|com[0-9]+|lpt[0-9]+)$'"'"' \
95
+ --silent \
96
+ && \
97
+ echo "$0"
98
+ ' \
99
+ '{}' \
100
+ \; \
101
+ -execdir \
102
+ false \
103
+ '{}' \
104
+ + \
105
+ || \
106
+ {
107
+ echo
108
+ echo "Reserved filenames found"
109
+ echo "See:"
110
+ echo "https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions:~:text=use%20the%20following-,reserved%20names,-for%20the%20name"
111
+ false
112
+ }
113
+
44
114
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml
45
115
general:check-spelling :
46
116
desc : Check for commonly misspelled words
@@ -51,6 +121,33 @@ tasks:
51
121
cmds :
52
122
- poetry run codespell
53
123
124
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-files-task/Taskfile.yml
125
+ general:check-symlinks :
126
+ desc : Check for bad symlinks
127
+ cmds :
128
+ - |
129
+ find . \
130
+ -type d -name '.git' -prune -o \
131
+ -type d -name '.licenses' -prune -o \
132
+ -type d -name '__pycache__' -prune -o \
133
+ -type d -name 'node_modules' -prune -o \
134
+ -type l \
135
+ -execdir \
136
+ test ! -e '{}' \
137
+ \; \
138
+ -exec \
139
+ echo '{}' \
140
+ \; \
141
+ -execdir \
142
+ false \
143
+ '{}' \
144
+ + \
145
+ || \
146
+ {
147
+ echo 'Broken or circular symlink found'
148
+ false
149
+ }
150
+
54
151
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml
55
152
general:correct-spelling :
56
153
desc : Correct commonly misspelled words where possible
0 commit comments