code: def collect_errors() -> list[str]:
      errors: list[tuple[str, str, int]] = []
  
      def test_this_file(fname: str, test_file: IO[str]) -> None:
          line = None
  
          for idx, line in enumerate(test_file):
              line_no = idx + 1
  
              if idx == 0 and len(line.strip()) == 0:
                  errors.append((message_multi_bof, fname, line_no))
              if line.endswith(" \n") or line.endswith("\t\n"):
                  errors.append((message_space, fname, line_no))
              if line.endswith("\r\n") or line.endswith("\r"):
                  errors.append((message_carriage, fname, line_no))
              if use_tab_rule(fname) and tab_in_leading(line):
                  errors.append((message_tabs, fname, line_no))
              # if len(line) > MAX_LINE_LENGTH:
              #    errors.append((message_too_long, fname, line_no))
  
          if line is not None:
              if idx > 0 and len(line.strip()) == 0:
                  errors.append((message_multi_eof, fname, line_no))
              if not line.endswith("\n"):
                  errors.append((message_eof, fname, line_no))
  
      paths = (
          subprocess.check_output(["git", "ls-files"])
          .decode("utf-8")
          .split("\n")
      )
  
      for path in paths:
          if not path:
              continue
  
          if path in exclude_paths:
              continue
  
          if path.endswith(exclude_exts):
              continue
  
          if path.startswith(exclude_dirs):
              continue
  
          with open(path, encoding="utf-8", newline="") as file:
              test_this_file(path, file)
  
      return [
          msg.format(path=fname, line_no=line_no)
          for (msg, fname, line_no) in errors
      ]
  
file_path: bokeh/tests/codebase/test_code_quality.py
imports: from __future__ import annotations
  import pytest
  import subprocess
  from os import pardir
  from os.path import abspath, basename, join, split, splitext
  from typing import IO
label_desc: Use image node_id 4 for calling a global function with example usage: collect_errors() and returns: unknown