Skip to content

Commit 85995a8

Browse files
committed
Updated Skyrim linter
1 parent aaef57c commit 85995a8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Source/Modules/Skyrim/Linter.py

+6
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,8 @@ def CacheScript(self, name, path = None, line = None):
15911591
except UnicodeDecodeError:
15921592
with open(fullPath, encoding="utf8") as f:
15931593
scriptContents = f.read()
1594+
if not scriptContents or len(scriptContents) == 0:
1595+
self.Abort("The '%s' script contains nothing." % name)
15941596
lines = []
15951597
tokens = []
15961598
try:
@@ -1603,6 +1605,8 @@ def CacheScript(self, name, path = None, line = None):
16031605
tokens.append(token)
16041606
except LexicalError as e:
16051607
self.Abort("Found a lexical error in the '%s' script." % name)
1608+
if not lines:
1609+
self.Abort("The '%s' script has no lines of code that are not comments." % name)
16061610
extends = []
16071611
functions = {}
16081612
properties = {}
@@ -1615,6 +1619,8 @@ def CacheScript(self, name, path = None, line = None):
16151619
statements.append(stat)
16161620
except SyntacticError as e:
16171621
self.Abort("Found a syntactic error in the '%s' script." % name)
1622+
if not statements:
1623+
self.Abort("No statements to process in the '%s' script." % name)
16181624
header = False
16191625
if statements[0].type == self.STAT_SCRIPTHEADER:
16201626
if statements[0].data.parent:

0 commit comments

Comments
 (0)