def scan_file()

in src/advisor/scanners/scanner.py [0:0]


    def scan_file(self, filename, report):
        """Scans the file with the given name for potential porting issues.

        Args:
            filename (str): Name of the file to scan.
            report (Report): Report to add issues to.
        """
        try:
            report.add_source_file(filename)
            self.scan_filename(filename, report)
            if self.has_scan_file_object():
                with open(filename, errors='ignore') as f:
                    try:
                        self.scan_file_object(filename, f, report)
                    except KeyboardInterrupt:
                        raise
                    except:
                        report.add_error(Error(description=str(traceback.format_exc()),
                                               filename=filename))
        except KeyboardInterrupt:
            raise
        except:
            report.add_error(Error(description=str(traceback.format_exc()),
                                   filename=filename))