Skip to content

Commit 156e6ed

Browse files
mdboothlentzi90
authored andcommitted
Update verify-boilerplate.sh to ignore ensure-golangci-lint.sh
While there, remove some legacy skipped paths and rename skipped_dirs to reflect that it actually skips paths (including ensure-golangci-lint.sh, which is a file, not a directory).
1 parent 779358d commit 156e6ed

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

hack/boilerplate/boilerplate.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,20 @@ def file_passes(filename, refs, regexs):
149149
def file_extension(filename):
150150
return os.path.splitext(filename)[1].split(".")[-1].lower()
151151

152-
skipped_dirs = ['Godeps', 'third_party', '_gopath', '_output', '.git', 'cluster/env.sh',
153-
"vendor", "test/e2e/generated/bindata.go", "hack/boilerplate/test",
154-
"pkg/kubectl/generated/bindata.go"]
152+
skipped_paths = [
153+
'_output',
154+
'.git',
155+
# Downloaded, not our copyright
156+
'hack/tools/ensure-golangci-lint.sh',
157+
]
155158

156159
# list all the files contain 'DO NOT EDIT', but are not generated
157-
skipped_ungenerated_files = ['hack/lib/swagger.sh', 'hack/boilerplate/boilerplate.py']
160+
skipped_ungenerated_files = ['hack/boilerplate/boilerplate.py']
158161

159162
def normalize_files(files):
160163
newfiles = []
161164
for pathname in files:
162-
if any(x in pathname for x in skipped_dirs):
165+
if any(x in pathname for x in skipped_paths):
163166
continue
164167
newfiles.append(pathname)
165168
for i, pathname in enumerate(newfiles):
@@ -173,12 +176,12 @@ def get_files(extensions):
173176
files = args.filenames
174177
else:
175178
for root, dirs, walkfiles in os.walk(args.rootdir):
176-
# don't visit certain dirs. This is just a performance improvement
179+
# don't visit certain paths. This is just a performance improvement
177180
# as we would prune these later in normalize_files(). But doing it
178181
# cuts down the amount of filesystem walking we do and cuts down
179182
# the size of the file list
180-
for d in skipped_dirs:
181-
if d in dirs:
183+
for p in skipped_paths:
184+
if p in dirs:
182185
dirs.remove(d)
183186

184187
for name in walkfiles:

0 commit comments

Comments
 (0)