content: [[linter]]
  code = 'FLAKE8'
  include_patterns = ['**/*.py']
  exclude_patterns = [
      '.git/**',
      '**/build/**',
      '**/__pycache__/**',
      '**/third_party/**',
      'multipy/runtime/example/generated/**',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/flake8_linter.py',
      '--',
      '@{{PATHSFILE}}'
  ]
  init_command = [
      'python3',
      'scripts/linter/adapters/pip_init.py',
      '--dry-run={{DRYRUN}}',
      'flake8==3.8.2',
      'flake8-bugbear==20.1.4',
      'flake8-comprehensions==3.3.0',
      'flake8-executable==2.0.4',
      'flake8-pyi==20.5.0',
      'mccabe==0.6.1',
      'pycodestyle==2.6.0',
      'pyflakes==2.2.0',
  ]
  
  
  [[linter]]
  code = 'CLANGFORMAT'
  include_patterns = [
      '**/*.h',
      '**/*.cpp',
  ]
  exclude_patterns = [
      '.git/**',
      '**/build/**',
      '**/__pycache__/**',
      '**/third_party/**',
      'multipy/runtime/example/generated/**',
  ]
  init_command = [
      'python3',
      'scripts/linter/adapters/s3_init.py',
      '--config-json=scripts/linter/adapters/s3_init_config.json',
      '--linter=clang-format',
      '--dry-run={{DRYRUN}}',
      '--output-dir=.lintbin',
      '--output-name=clang-format',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/clangformat_linter.py',
      '--binary=.lintbin/clang-format',
      '--',
      '@{{PATHSFILE}}'
  ]
  is_formatter = true
  
  [[linter]]
  code = 'MYPY'
  include_patterns = ['**/*.py']
  exclude_patterns = [
      '.git/**',
      '**/build/**',
      '**/__pycache__/**',
      '**/third_party/**',
      'multipy/runtime/example/generated/**',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/mypy_linter.py',
      '--config=mypy.ini',
      '--',
      '@{{PATHSFILE}}'
  ]
  init_command = [
      'python3',
      'scripts/linter/adapters/pip_init.py',
      '--dry-run={{DRYRUN}}',
      'numpy==1.21.6',
      'expecttest==0.1.3',
      'mypy==0.960',
      'types-requests==2.27.25',
      'types-six==1.16.15',
      'types-PyYAML==6.0.7',
      'types-tabulate==0.8.8',
      'types-protobuf==3.19.18',
      'types-pkg-resources==0.1.3',
      'types-Jinja2==2.11.9',
      'junitparser==2.1.1',
      'rich==10.9.0',
      'pyyaml==6.0',
  ]
  
  [[linter]]
  code = 'CLANGTIDY'
  include_patterns = [
      'multipy/runtime/**/*.h',
      'multipy/runtime/**/*.cpp',
  ]
  exclude_patterns = [
      '.git/**',
      '**/build/**',
      '**/__pycache__/**',
      '**/third_party/**',
      'multipy/runtime/example/generated/**',
  ]
  init_command = [
      'python3',
      'scripts/linter/adapters/s3_init.py',
      '--config-json=scripts/linter/adapters/s3_init_config.json',
      '--linter=clang-tidy',
      '--dry-run={{DRYRUN}}',
      '--output-dir=.lintbin',
      '--output-name=clang-tidy',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/clangtidy_linter.py',
      '--binary=.lintbin/clang-tidy',
      '--build_dir=./multipy/runtime/build',
      '--',
      '@{{PATHSFILE}}'
  ]
  
  [[linter]]
  code = 'TYPEIGNORE'
  include_patterns = ['**/*.py']
  exclude_patterns = [
      '.git/**',
      '**/build/**',
      '**/__pycache__/**',
      '**/third_party/**',
      'multipy/runtime/example/generated/**',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/grep_linter.py',
      '--pattern=# type:\s*ignore([^\[]|$)',
      '--linter-name=TYPEIGNORE',
      '--error-name=unqualified type: ignore',
      """--error-description=\
          This line has an unqualified `type: ignore`; \
          please convert it to `type: ignore[xxxx]`\
      """,
      '--',
      '@{{PATHSFILE}}'
  ]
  
  
  [[linter]]
  code = 'NEWLINE'
  include_patterns=['**']
  exclude_patterns=[
      '.git/**',
      '**/build/**',
      '**/__pycache__/**',
      '.lintbin/**',
      '.clang-format',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/newlines_linter.py',
      '--',
      '@{{PATHSFILE}}',
  ]
  is_formatter = true
  
  [[linter]]
  code = 'SPACES'
  include_patterns = ['**']
  exclude_patterns = [
      '.git/**',
      '**/build/**',
      '**/__pycache__/**',
      '**/third_party/**',
      '.clang-format',
      'multipy/runtime/example/generated/**',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/grep_linter.py',
      '--pattern=[[:blank:]]$',
      '--linter-name=SPACES',
      '--error-name=trailing spaces',
      '--replace-pattern=s/[[:blank:]]+$//',
      """--error-description=\
          This line has trailing spaces; please remove them.\
      """,
      '--',
      '@{{PATHSFILE}}'
  ]
  
  [[linter]]
  code = 'TABS'
  include_patterns = ['**']
  exclude_patterns = [
      '.git/**',
      '**/build/**',
      '**/__pycache__/**',
      '**/third_party/**',
      'scripts/linter/adapters/**',
      'multipy/runtime/example/generated/**',
      '.lintrunner.toml',
      '.clang-format',
      'README.md',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/grep_linter.py',
      # @lint-ignore TXT2
      '--pattern= ',
      '--linter-name=TABS',
      '--error-name=saw some tabs',
      '--replace-pattern=s/\t/    /',
      """--error-description=\
          This line has tabs; please replace them with spaces.\
      """,
      '--',
      '@{{PATHSFILE}}'
  ]
  
  [[linter]]
  code = 'INCLUDE'
  include_patterns = [
      '**/*.cpp',
      '**/*.h',
  ]
  exclude_patterns = [
      '.git/**',
      '**/build/**',
      '**/__pycache__/**',
      '**/third_party/**',
      'multipy/runtime/example/generated/**',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/grep_linter.py',
      '--pattern=#include "',
      '--linter-name=INCLUDE',
      '--error-name=quoted include',
      '--replace-pattern=s/#include "(.*)"$/#include <\1>/',
      """--error-description=\
          This #include uses quotes; please convert it to #include <xxxx>\
      """,
      '--',
      '@{{PATHSFILE}}'
  ]
  
  [[linter]]
  code = 'PYBIND11_INCLUDE'
  include_patterns = [
      '**/*.cpp',
      '**/*.h',
  ]
  exclude_patterns = [
      '.git/**',
      '**/build/**',
      '**/__pycache__/**',
      '**/third_party/**',
      'multipy/runtime/example/generated/**',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/grep_linter.py',
      '--pattern=#include <pybind11\/',
      '--allowlist-pattern=#include <torch\/csrc\/utils\/pybind.h>',
      '--linter-name=PYBIND11_INCLUDE',
      '--match-first-only',
      '--error-name=direct include of pybind11',
      # https://stackoverflow.com/a/33416489/23845
      # NB: this won't work if the pybind11 include is on the first line;
      # but that's fine because it will just mean the lint will still fail
      # after applying the change and you will have to fix it manually
      '--replace-pattern=1,/(#include <pybind11\/)/ s/(#include <pybind11\/)/#include <torch\/csrc\/utils\/pybind.h>\n\1/',
      """--error-description=\
          This #include directly includes pybind11 without also including \
          #include <torch/csrc/utils/pybind.h>;  this means some important \
          specializations may not be included.\
      """,
      '--',
      '@{{PATHSFILE}}'
  ]
  
  [[linter]]
  code = 'PYBIND11_SPECIALIZATION'
  include_patterns = [
      '**/*.cpp',
      '**/*.h',
  ]
  exclude_patterns = [
      '.git/**',
      '**/build/**',
      '**/__pycache__/**',
      '**/third_party/**',
      'multipy/runtime/example/generated/**',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/grep_linter.py',
      '--pattern=PYBIND11_DECLARE_HOLDER_TYPE',
      '--linter-name=PYBIND11_SPECIALIZATION',
      '--error-name=pybind11 specialization in non-standard location',
      """--error-description=\
          This pybind11 specialization (PYBIND11_DECLARE_HOLDER_TYPE) should \
          be placed in torch/csrc/utils/pybind.h so that it is guaranteed to be \
          included at any site that may potentially make use of it via py::cast. \
          If your specialization is in the same header file as the definition \
          of the holder type, you can ignore this lint by adding your header to \
          the exclude_patterns for this lint in .lintrunner.toml.  For more \
          information see https://github.com/pybind/pybind11/issues/4099 \
      """,
      '--',
      '@{{PATHSFILE}}'
  ]
  
  [[linter]]
  code = 'PYPIDEP'
  include_patterns = ['.github/**']
  exclude_patterns = [
      '**/*.rst',
      '**/*.py',
      '**/*.md',
      '**/*.diff',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/grep_linter.py',
      """--pattern=\
      (pip|pip3|python -m pip|python3 -m pip|python3 -mpip|python -mpip) \
      install ([a-zA-Z0-9][A-Za-z0-9\\._\\-]+)([^/=<>~!]+)[A-Za-z0-9\\._\\-\\*\\+\\!]*$\
      """,
      '--linter-name=PYPIDEP',
      '--error-name=unpinned PyPI install',
      """--error-description=\
          This line has unpinned PyPi installs; \
          please pin them to a specific version: e.g. 'thepackage==1.2'\
      """,
      '--',
      '@{{PATHSFILE}}'
  ]
  
  [[linter]]
  code = 'EXEC'
  include_patterns = ['**']
  exclude_patterns = [
      '.git/**',
      '**/build/**',
      '**/__pycache__/**',
      '**/third_party/**',
      'multipy/runtime/example/generated/**',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/exec_linter.py',
      '--',
      '@{{PATHSFILE}}',
  ]
  
  [[linter]]
  code = 'CMAKE'
  include_patterns = [
      "**/*.cmake",
      "**/*.cmake.in",
      "**/CMakeLists.txt",
  ]
  exclude_patterns = [
      '.git/**',
      '**/build/**',
      '**/__pycache__/**',
      '**/third_party/**',
      'multipy/runtime/example/generated/**',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/cmake_linter.py',
      '--config=.cmakelintrc',
      '--',
      '@{{PATHSFILE}}',
  ]
  init_command = [
      'python3',
      'scripts/linter/adapters/pip_init.py',
      '--dry-run={{DRYRUN}}',
      'cmakelint==1.4.1',
  ]
  
  [[linter]]
  code = 'SHELLCHECK'
  include_patterns = [
      '.jenkins/pytorch/**/*.sh'
  ]
  command = [
      'python3',
      'scripts/linter/adapters/shellcheck_linter.py',
      '--',
      '@{{PATHSFILE}}',
  ]
  init_command = [
      'python3',
      'scripts/linter/adapters/pip_init.py',
      '--dry-run={{DRYRUN}}',
      'shellcheck-py==0.7.2.1',
  ]
  
  [[linter]]
  code = 'ACTIONLINT'
  include_patterns = [
      '.github/workflows/*.yml',
      '.github/workflows/*.yaml',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/actionlint_linter.py',
      '--binary=.lintbin/actionlint',
      '--',
      '@{{PATHSFILE}}',
  ]
  init_command = [
      'python3',
      'scripts/linter/adapters/s3_init.py',
      '--config-json=scripts/linter/adapters/s3_init_config.json',
      '--linter=actionlint',
      '--dry-run={{DRYRUN}}',
      '--output-dir=.lintbin',
      '--output-name=actionlint',
  ]
  
  [[linter]]
  code = 'TESTOWNERS'
  include_patterns = [
      'test/**/test_*.py',
      'test/**/*_test.py',
  ]
  exclude_patterns = [
      'test/run_test.py',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/testowners_linter.py',
      '--',
      '@{{PATHSFILE}}',
  ]
  
  # Black + usort
  [[linter]]
  code = 'UFMT'
  include_patterns = [
      '**/*.py',
  ]
  command = [
      'python3',
      'scripts/linter/adapters/ufmt_linter.py',
      '--',
      '@{{PATHSFILE}}'
  ]
  init_command = [
      'python3',
      'scripts/linter/adapters/pip_init.py',
      '--dry-run={{DRYRUN}}',
      '--no-black-binary',
      'black==22.3.0',
      'ufmt==1.3.3',
      'usort==1.0.2',
  ]
  is_formatter = true
  