code: def cmake_linter(src, fix=False):
      """
      Run cmake-format on all CMakeFiles.txt
      """
      logger.info("Running cmake-format linters")
  
      cmake_format = CMakeFormat.from_patterns(
          src.path,
          include_patterns=[
              "ci/**/*.cmake",
              "cpp/CMakeLists.txt",
              "cpp/src/**/*.cmake",
              "cpp/src/**/*.cmake.in",
              "cpp/src/**/CMakeLists.txt",
              "cpp/examples/**/CMakeLists.txt",
              "cpp/cmake_modules/*.cmake",
              "go/**/CMakeLists.txt",
              "java/**/CMakeLists.txt",
              "matlab/**/CMakeLists.txt",
              "python/CMakeLists.txt",
          ],
          exclude_patterns=[
              "cpp/cmake_modules/FindNumPy.cmake",
              "cpp/cmake_modules/FindPythonLibsNew.cmake",
              "cpp/cmake_modules/UseCython.cmake",
              "cpp/src/arrow/util/config.h.cmake",
          ],
      )
      method = cmake_format.fix if fix else cmake_format.check
  
      yield LintResult.from_cmd(method())
  
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 2 for calling a global function with example usage: cmake_linter(src, fix) without return types