summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--checkers/__init__.py2
-rw-r--r--checkers/format.py2
-rw-r--r--checkers/misc.py2
-rw-r--r--checkers/similar.py2
-rw-r--r--examples/custom_raw.py4
5 files changed, 5 insertions, 7 deletions
diff --git a/checkers/__init__.py b/checkers/__init__.py
index d33cacf..969066b 100644
--- a/checkers/__init__.py
+++ b/checkers/__init__.py
@@ -120,7 +120,7 @@ class BaseRawChecker(BaseChecker):
stream must implement the readline method
"""
stream = node.file_stream
- stream.seek(0)
+ stream.seek(0) # XXX may be removed with astng > 0.23
self.process_tokens(tokenize.generate_tokens(stream.readline))
def process_tokens(self, tokens):
diff --git a/checkers/format.py b/checkers/format.py
index 6a2d5ac..0784e6a 100644
--- a/checkers/format.py
+++ b/checkers/format.py
@@ -183,7 +183,7 @@ class FormatChecker(BaseRawChecker):
international text's length is properly calculated.
"""
stream = node.file_stream
- stream.seek(0)
+ stream.seek(0) # XXX may be removed with astng > 0.23
readline = stream.readline
if sys.version_info < (3, 0):
if node.file_encoding is not None:
diff --git a/checkers/misc.py b/checkers/misc.py
index 8f6ad2d..7f09d40 100644
--- a/checkers/misc.py
+++ b/checkers/misc.py
@@ -55,7 +55,7 @@ separated by a comma.'
notes
"""
stream = node.file_stream
- stream.seek(0)
+ stream.seek(0) # XXX may be removed with astng > 0.23
# warning notes in the code
notes = []
for note in self.config.notes:
diff --git a/checkers/similar.py b/checkers/similar.py
index a647ada..1e38ed6 100644
--- a/checkers/similar.py
+++ b/checkers/similar.py
@@ -39,7 +39,7 @@ class Similar:
def append_stream(self, streamid, stream):
"""append a file to search for similarities"""
- stream.seek(0)
+ stream.seek(0) # XXX may be removed with astng > 0.23
self.linesets.append(LineSet(streamid,
stream.readlines(),
self.ignore_comments,
diff --git a/examples/custom_raw.py b/examples/custom_raw.py
index 811c785..00fbe89 100644
--- a/examples/custom_raw.py
+++ b/examples/custom_raw.py
@@ -20,9 +20,7 @@ class MyRawChecker(BaseChecker):
the module's content is accessible via node.file_stream object
"""
- stream = node.file_stream
- stream.seek(0)
- for (lineno, line) in enumerate(stream):
+ for (lineno, line) in enumerate(node.file_stream):
if line.rstrip().endswith('\\'):
self.add_message('W9901', line=lineno)