Allow Python files not to be executable
.py files may be modules which are not standalone program, so allow them not to be executable. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
6d5c7bc69a
commit
15898eec23
1 changed files with 5 additions and 1 deletions
|
@ -161,9 +161,13 @@ class PermissionIssueTracker(FileIssueTracker):
|
|||
|
||||
heading = "Incorrect permissions:"
|
||||
|
||||
# .py files can be either full scripts or modules, so they may or may
|
||||
# not be executable.
|
||||
suffix_exemptions = frozenset({".py"})
|
||||
|
||||
def check_file_for_issue(self, filepath):
|
||||
is_executable = os.access(filepath, os.X_OK)
|
||||
should_be_executable = filepath.endswith((".sh", ".pl", ".py"))
|
||||
should_be_executable = filepath.endswith((".sh", ".pl"))
|
||||
if is_executable != should_be_executable:
|
||||
self.files_with_issues[filepath] = None
|
||||
|
||||
|
|
Loading…
Reference in a new issue