Skip to content

Commit

Permalink
Fix: Ignore symlinks in the tree walk
Browse files Browse the repository at this point in the history
Trying to open a symlink directly doesn't go well, and may reference
things outside the repository.  Assuming that a symlink doesn't need to
be independently opened and checked as if the file is in the repository
it'll get picked up elsewhere, and this would just be a dupe, or if it's
external it's not part of the repository and not entirely useful to
check anyway.

If it's a symlink, just skip it.

Signed-off-by: John 'Warthog9' Hawley <[email protected]>
  • Loading branch information
warthog9 committed Apr 6, 2024
1 parent 0dcb2ab commit 0255bc0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions verify-spdx-headers
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ class Index:
for file in files:
path = os.path.join(root, file)

# If the file is a symlink, don't bother
if os.path.islink( path ):
continue

# Find the language of the file.
language = self.language(path)
if language is None:
Expand Down

0 comments on commit 0255bc0

Please sign in to comment.