rule: LT13

test_pass_leading_whitespace_statement:
  pass_str: "SELECT foo FROM bar\n"

test_pass_leading_whitespace_comment:
  pass_str: "/*I am a comment*/\nSELECT foo FROM bar\n"

test_pass_leading_whitespace_inline_comment:
  pass_str: "--I am a comment\nSELECT foo FROM bar\n"

test_pass_leading_whitespace_inline_comment_hash:
  pass_str: "# I am a comment\nSELECT foo FROM bar\n"
  configs:
    core:
      dialect: bigquery

test_pass_leading_whitespace_jinja_comment:
  pass_str: "{# I am a comment #}\nSELECT foo FROM bar\n"

test_pass_leading_whitespace_jinja_if:
  pass_str: "{% if True %}\nSELECT foo\nFROM bar;\n{% endif %}\n"

test_pass_leading_whitespace_jinja_for:
  pass_str: "{% for item in range(10) %}\nSELECT foo_{{ item }}\nFROM bar;\n{% endfor %}\n"

test_fail_leading_whitespace_statement:
  fail_str: "\n  SELECT foo FROM bar\n"
  fix_str: "SELECT foo FROM bar\n"

test_fail_leading_whitespace_comment:
  fail_str: "\n  /*I am a comment*/\nSELECT foo FROM bar\n"
  fix_str: "/*I am a comment*/\nSELECT foo FROM bar\n"

test_fail_leading_whitespace_inline_comment:
  fail_str: "\n  --I am a comment\nSELECT foo FROM bar\n"
  fix_str: "--I am a comment\nSELECT foo FROM bar\n"

test_fail_leading_whitespace_jinja_comment:
  fail_str: "\n  {# I am a comment #}\nSELECT foo FROM bar\n"
  fix_str: "{# I am a comment #}\nSELECT foo FROM bar\n"

test_fail_leading_whitespace_jinja_if:
  fail_str: "\n  {% if True %}\nSELECT foo\nFROM bar;\n{% endif %}\n"
  fix_str: "{% if True %}\nSELECT foo\nFROM bar;\n{% endif %}\n"

test_fail_leading_whitespace_jinja_for:
  fail_str: "\n  {% for item in range(10) %}\nSELECT foo_{{ item }}\nFROM bar;\n{% endfor %}\n"
  fix_str: "{% for item in range(10) %}\nSELECT foo_{{ item }}\nFROM bar;\n{% endfor %}\n"
