Esempio n. 1
0
 def run_mypy(self, paths=(), code=None):
     """Run MyPy with arguments."""
     if self.mypy:
         set_mypy_path(stub_dir)
         from coconut.command.mypy import mypy_run
         args = list(paths) + self.mypy_args
         if code is not None:
             args += ["-c", code]
         for line, is_err in mypy_run(args):
             if code is None or line not in self.mypy_errs:
                 printerr(line)
             if line not in self.mypy_errs:
                 self.mypy_errs.append(line)
             self.register_error(errmsg="MyPy error")
Esempio n. 2
0
 def run_mypy(self, paths=[], code=None):
     """Run MyPy with arguments."""
     set_mypy_path(stub_dir)
     if self.mypy:
         from coconut.command.mypy import mypy_run
         args = paths + self.mypy_args
         if code is not None:
             args += ["-c", code]
         for line, is_err in mypy_run(args):
             if code is None or line not in self.mypy_errs:
                 if is_err:
                     printerr(line)
                 else:
                     print(line)
             if line not in self.mypy_errs:
                 self.mypy_errs.append(line)
Esempio n. 3
0
 def run_mypy(self, paths=[], code=None):
     """Run MyPy with arguments."""
     set_mypy_path(stub_dir)
     if self.mypy:
         from coconut.command.mypy import mypy_run
         args = paths + self.mypy_args
         if code is not None:
             args += ["-c", code]
         for line, is_err in mypy_run(args):
             if code is None or line not in self.mypy_errs:
                 if is_err:
                     printerr(line)
                 else:
                     print(line)
             if line not in self.mypy_errs:
                 self.mypy_errs.append(line)
Esempio n. 4
0
 def run_mypy(self, paths=(), code=None):
     """Run MyPy with arguments."""
     if self.mypy:
         set_mypy_path()
         from coconut.command.mypy import mypy_run
         args = list(paths) + self.mypy_args
         if code is not None:  # interpreter
             args += ["-c", code]
         for line, is_err in mypy_run(args):
             logger.log("[MyPy]", line)
             if line.startswith(mypy_silent_err_prefixes):
                 if code is None:  # file
                     printerr(line)
                     self.register_error(errmsg="MyPy error")
             elif not line.startswith(mypy_silent_non_err_prefixes):
                 if code is None:  # file
                     printerr(line)
                     if any(infix in line for infix in mypy_err_infixes):
                         self.register_error(errmsg="MyPy error")
                 if line not in self.mypy_errs:
                     if code is not None:  # interpreter
                         printerr(line)
                     self.mypy_errs.append(line)