Check using fine-grained incremental mode. If is_tty is True format the output nicely with colors and summary line (unless disabled in self.options). Also pass the terminal_width to formatter.
(
self, sources: list[BuildSource], export_types: bool, is_tty: bool, terminal_width: int
)
| 417 | return res |
| 418 | |
| 419 | def check( |
| 420 | self, sources: list[BuildSource], export_types: bool, is_tty: bool, terminal_width: int |
| 421 | ) -> dict[str, Any]: |
| 422 | """Check using fine-grained incremental mode. |
| 423 | |
| 424 | If is_tty is True format the output nicely with colors and summary line |
| 425 | (unless disabled in self.options). Also pass the terminal_width to formatter. |
| 426 | """ |
| 427 | old_export_types = self.options.export_types |
| 428 | self.options.export_types = self.options.export_types or export_types |
| 429 | if not self.fine_grained_manager: |
| 430 | res = self.initialize_fine_grained(sources, is_tty, terminal_width) |
| 431 | else: |
| 432 | if not self.following_imports(): |
| 433 | messages = self.fine_grained_increment(sources, explicit_export_types=export_types) |
| 434 | else: |
| 435 | messages = self.fine_grained_increment_follow_imports( |
| 436 | sources, explicit_export_types=export_types |
| 437 | ) |
| 438 | res = self.increment_output(messages, sources, is_tty, terminal_width) |
| 439 | self.flush_caches() |
| 440 | self.update_stats(res) |
| 441 | self.options.export_types = old_export_types |
| 442 | return res |
| 443 | |
| 444 | def flush_caches(self) -> None: |
| 445 | self.fscache.flush() |