# Ported from alibaba/open-code-review (Apache-2.0):
#   internal/config/rules/rule_docs/github_config.md
#   at commit 89ec55b14442c9f2601fb55b5f554fb6fabbe2c7.
# OCR tool names were replaced with this workflow's read-only
# exploration language. See the NOTICE.md and LICENSE files
# in rules/builtin/ for attribution and license details.
version: 1

rules:
  - id: format.github-config
    match:
      paths:
        - ".github/**/*.{yaml,yml}"
      except:
        - ".github/workflows/**"
    checks:
      - id: issue-template-validation
        category: correctness
        guidance: |
          - **Missing required fields**: Issue templates should have `name`, `description`, and `body` fields
          - **Invalid input types**: Verify `type` values in body inputs are valid (dropdown, input, textarea, checkboxes, markdown)
          - **Empty options in dropdowns**: Dropdown type inputs must have non-empty `options` list
          - **Missing `id` on inputs**: Form inputs without `id` cannot be parsed programmatically
      - id: release-configuration
        category: correctness
        guidance: |
          - **Undefined category labels**: Labels referenced in `categories[].labels` should exist in the repository (note: this is a warning, as labels may be created separately)
          - **Missing default category**: A `release.yml` without a catch-all category (using `*`) may omit some PRs from release notes
      - id: general-structure
        category: correctness
        guidance: |
          - **YAML syntax correctness**: Indentation consistency, proper quoting of special characters, valid anchors/aliases usage
          - **Spelling errors in YAML keys**: Check for typos in configuration keys that would be silently ignored
