code: def linter(
      src,
      fix=False,
      *,
      clang_format=False,
      cpplint=False,
      clang_tidy=False,
      iwyu=False,
      iwyu_all=False,
      python=False,
      numpydoc=False,
      cmake_format=False,
      rat=False,
      r=False,
      docker=False,
  ):
      """Run all linters."""
      with tmpdir(prefix="arrow-lint-") as root:
          build_dir = os.path.join(root, "cpp-build")
  
          # Linters yield LintResult without raising exceptions on failure.
          # This allows running all linters in one pass and exposing all
          # errors to the user.
          results = []
  
          if clang_format or cpplint or clang_tidy or iwyu:
              results.extend(
                  cpp_linter(
                      src,
                      build_dir,
                      clang_format=clang_format,
                      cpplint=cpplint,
                      clang_tidy=clang_tidy,
                      iwyu=iwyu,
                      iwyu_all=iwyu_all,
                      fix=fix,
                  )
              )
  
          if python:
              results.extend(python_linter(src, fix=fix))
  
          if python and clang_format:
              results.extend(
                  python_cpp_linter(
                      src, clang_format=clang_format, fix=fix
                  )
              )
  
          if numpydoc:
              results.extend(python_numpydoc())
  
          if cmake_format:
              results.extend(cmake_linter(src, fix=fix))
  
          if rat:
              results.extend(rat_linter(src, root))
  
          if r:
              results.extend(r_linter(src))
  
          if docker:
              results.extend(docker_linter(src))
  
          # Raise error if one linter failed, ensuring calling code can exit with
          # non-zero.
          for result in results:
              result.ok()
  
imports: import fnmatch
  import gzip
  import os
  from pathlib import Path
  import click
  from .command import Bash, Command, default_bin
  from ..compat import _get_module
  from .cmake import CMake
  from .git import git
  from .logger import logger
  from ..lang.cpp import CppCMakeDefinition, CppConfiguration
  from ..lang.python import Autopep8, Flake8, CythonLint, NumpyDoc, PythonCommand
  from .rat import Rat, exclusion_from_globs
  from .tmpdir import tmpdir
label_desc: Use image node_id 10 for calling a global function with example usage: linter(src, fix) without return types