content: # Configuration for lintrunner https://github.com/suo/lintrunner
  merge_base_with = 'main'
  
  [[linter]]
  code = 'RUFF'
  include_patterns = [
      '**/*.py',
      '**/*.pyi',
  ]
  exclude_patterns = [
      'tests/models/**',
  ]
  command = [
      'python',
      '-m',
      'lintrunner_adapters',
      'run',
      'ruff_linter',
      '--config=pyproject.toml',
      '@{{PATHSFILE}}'
  ]
  init_command = [
      'python',
      '-m',
      'lintrunner_adapters',
      'run',
      'pip_init',
      '--dry-run={{DRYRUN}}',
      '--requirement=requirements/lintrunner/requirements.txt',
  ]
  is_formatter = true
  
  [[linter]]
  code = 'MYPY'
  include_patterns = [
      'onnxscript/**/*.py',
      'onnxscript/**/*.pyi',
  ]
  exclude_patterns = [
      'tests/**', # Skip linting test files for speed
      # FIXME: Fix typing annotations in these files
      'onnxscript/converter_test.py',
      'onnxscript/converter.py',
      'onnxscript/evaluator_test.py',
      'onnxscript/evaluator.py',
      'onnxscript/onnx_types.py',
      'onnxscript/**/*_test.py', # Skip linting test files for speed
      'onnxscript/function_libs/torch_lib/ops/**', # Operators typing do not play well with mypy
      'onnxscript/optimizer/_legacy/evaluator.py',  # FIXME
      'onnxscript/optimizer/_legacy/constant_folding.py',  # FIXME
      'onnxscript/rewriter/onnxruntime/transformers/fastgelu.py',  # FIXME
      'onnxscript/rewriter/onnxruntime/instance_to_group_normalization.py',  # FIXME
      'onnxscript/rewriter/ort_fusions/models/*.py',  # onnxscript code
      'onnxscript/rewriter/ort_fusions/models/_phi2lm.py',  # onnxscript code
      'onnxscript/rewriter/ort_fusions/models/_phi4lm.py',  # onnxscript code
      'onnxscript/rewriter/ort_fusions/_rotary_embedding_models.py',  # onnxscript code
      'onnxscript/rewriter/onnxruntime/transformers/multihead_attention.py',  # FIXME
      'onnxscript/tools/function_unittest_producer.py',  # FIXME
      'onnxscript/rewriter/onnxruntime/transformers/layernorm.py',  # FIXME
  ]
  command = [
      'python',
      '-m',
      'lintrunner_adapters',
      'run',
      'mypy_linter',
      '--config=pyproject.toml',
      '--show-disable',
      '--',
      '@{{PATHSFILE}}'
  ]
  init_command = [
      'python',
      '-m',
      'lintrunner_adapters',
      'run',
      'pip_init',
      '--dry-run={{DRYRUN}}',
      '--requirement=requirements/lintrunner/requirements.txt',
  ]
  
  [[linter]]
  code = 'RUFF-FORMAT'
  include_patterns = [
      '**/*.py',
  ]
  exclude_patterns = [
      'tests/onnx_backend_test_code/**',
  ]
  command = [
      'python',
      '-m',
      'lintrunner_adapters',
      'run',
      'ruff_format_linter',
      '--',
      '@{{PATHSFILE}}'
  ]
  init_command = [
      'python',
      '-m',
      'lintrunner_adapters',
      'run',
      'pip_init',
      '--dry-run={{DRYRUN}}',
      '--requirement=requirements/lintrunner/requirements.txt',
  ]
  is_formatter = true
  
  [[linter]]
  code = 'PYLINT'
  include_patterns = [
      '**/*.py',
  ]
  exclude_patterns = [
      'examples/**',
      'docs/**',
      'onnxscript/converter_test.py',
      'tests/functions/**',
      'tests/models/**',
      'tests/onnx_backend_test_code/**',
      'onnxscript/optimizer/**',  # FIXME
      'onnxscript/rewriter/**',  # FIXME
  ]
  command = [
      'python',
      '-m',
      'lintrunner_adapters',
      'run',
      'pylint_linter',
      '--rcfile=pyproject_pylint.toml',
      '--show-disable',
      '--',
      '@{{PATHSFILE}}'
  ]
  init_command = [
      'python',
      '-m',
      'lintrunner_adapters',
      'run',
      'pip_init',
      '--dry-run={{DRYRUN}}',
      '--requirement=requirements/lintrunner/requirements.txt',
  ]
  
  [[linter]]
  code = 'EDITORCONFIG-CHECKER'
  include_patterns = ['**']
  exclude_patterns = [
      '**/*.ipynb',
      '**/*.onnx',
      '**/*.pb'
  ]
  command = [
      'python',
      '-m',
      'lintrunner_adapters',
      'run',
      'editorconfig_checker_linter',
      '--',
      '@{{PATHSFILE}}'
  ]
  init_command = [
      'python',
      '-m',
      'lintrunner_adapters',
      'run',
      'pip_init',
      '--dry-run={{DRYRUN}}',
      '--requirement=requirements/lintrunner/requirements.txt',
  ]
  