src/eric7/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py

branch
eric7
changeset 9507
1f39839655ea
parent 9482
a2bc06a54d9d
diff -r 62397ab8df8c -r 1f39839655ea src/eric7/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py
--- a/src/eric7/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py	Fri Nov 11 17:14:21 2022 +0100
+++ b/src/eric7/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py	Fri Nov 11 17:49:06 2022 +0100
@@ -7,6 +7,8 @@
 Module implementing the syntax check for Python 3.
 """
 
+# TODO: rename this module 'pyCheckSyntax'
+
 import ast
 import builtins
 import contextlib
@@ -46,21 +48,6 @@
     return syntaxAndPyflakesBatchCheck
 
 
-def normalizeCode(codestring):
-    """
-    Function to normalize the given code.
-
-    @param codestring code to be normalized (string)
-    @return normalized code (string)
-    """
-    codestring = codestring.replace("\r\n", "\n").replace("\r", "\n")
-
-    if codestring and codestring[-1] != "\n":
-        codestring += "\n"
-
-    return codestring
-
-
 def extractLineFlags(line, startComment="#", endComment="", flagsLine=False):
     """
     Function to extract flags starting and ending with '__' from a line
@@ -93,6 +80,7 @@
     return flags
 
 
+# TODO: rename this function 'pySyntaxAndPyflakesCheck'
 def syntaxAndPyflakesCheck(
     filename, codestring, checkFlakes=True, ignoreStarImportWarnings=False
 ):
@@ -115,6 +103,7 @@
     )
 
 
+# TODO: rename this function 'pySyntaxAndPyflakesBatchCheck'
 def syntaxAndPyflakesBatchCheck(argumentsList, send, fx, cancelled, maxProcesses=0):
     """
     Module function to check syntax for a batch of files.
@@ -234,8 +223,6 @@
     @rtype dict
     """
     try:
-        codestring = normalizeCode(codestring)
-
         # Check for VCS conflict markers
         for conflictMarkerRe in VcsConflictMarkerRegExpList:
             conflict = conflictMarkerRe.search(codestring)

eric ide

mercurial