# Review guidelines Theme developers act on what theme tools tell them, often without a second look. Use these guidelines when you write a change and when you review one. ## Principles 1. **Report only real problems.** A false positive costs more than a missed report. It teaches developers to ignore or disable the tool, and then they miss the true reports too. When a check can't be sure, it reports nothing. Completions, hovers and code actions follow the same rule. 2. **Keep what the theme renders.** Formatting, fixes and code actions change how code looks, never what it renders. The Prettier plugin calls this [preferring correctness](./prettier-plugin-liquid/principles/prefer-correctness.md). 3. **Good defaults, config as a last resort.** The tools work well with no configuration. An option is a sign that the default is wrong for someone, and every option adds cost for users and maintainers. The Prettier plugin follows [the same principle](./prettier-plugin-liquid/principles/opinionated.md). 4. **Upgrades are safe.** A theme that passes Theme Check keeps passing, code formats the same way, and the tools built on these packages keep working after a minor or patch release. The [releases](#releases) table lists the exceptions. ## Review gates Each gate is a yes/no question about the pull request. A "no" blocks the pull request until the author fixes it, or until a maintainer accepts an exception that the pull request description explains. ### Precision - Is every report a problem the developer has to fix? Examples: a render error, a file Shopify rejects on upload, a broken editor experience, a deprecated feature. - Does the check stay silent when it lacks information? Examples: dynamic values, files a partial checkout doesn't include, theme app extensions, missing schemas or docs. - Do the [spec cases](../specs/) cover the cases where the check reports and the cases where it stays silent? - Does the pull request description say what the change reported on a real theme, such as Dawn or Horizon? Is every new report correct? - Is every new completion, hover and code action correct at the position where it appears? ### Signal - Does the message say what is wrong and how to fix it, in the words a theme developer uses? - Does the severity match the impact? - `error`: the theme is broken. It fails to render, or Shopify rejects it on upload. - `warning`: a likely bug, a deprecation or a performance problem. - `info`: a suggestion. - Does the change avoid reporting a problem that another check, or Shopify's own validation, already reports at the same place? ### Fixes and formatting - Does every fix and suggestion produce valid Liquid, HTML and JSON? Does a spec case show the file after it applies? - Does every fix change only what the offense reports, and keep what the theme renders? - Does formatted code render the same as the original? Does formatting it a second time leave it unchanged? - Does existing code format the same way? A change to formatting output fixes incorrect output, and its changeset says so. ### TypeScript and Rust - If the change affects what a check or the parser reports, did the spec case change first? Do the TypeScript and the Rust both pass it? - If the change adds a check or changes a check's meta or the configs, are the copies in `crates/theme-check/src/node` updated? ### Defaults and configuration - Does the feature work well with no configuration? - If the change adds an option, does the pull request name a use case that no default can serve? Is the option documented? ### Compatibility - Apart from the exceptions in [releases](#releases), does every theme that passed Theme Check before this change still pass with the default configuration? - Does the parser still accept everything it accepted before? A parser error breaks Prettier, the language server and Theme Check at once. - Do check names, configuration keys, CLI flags and exported APIs keep working? A rename keeps the old name as an alias. - Do the tools built on these packages, such as the Shopify CLI, the VS Code extension and the online code editor, keep working without changes? A new entry in Theme Check's `Dependencies` or the language server's `RequiredDependencies` is optional and has a default. ### Runtime - `theme-check-common`, `theme-language-server-common`, `liquid-html-parser` and `prettier-plugin-liquid` run in the browser. Does the change use only APIs the browser has, and read files through `AbstractFileSystem`? - The language server runs checks and completions as the developer types. Does the change stay fast on a large theme? Does a check that looks at other files read them through the dependencies it receives, and avoid scanning the whole theme for each file? ## Releases | Change | Release | | --- | --- | | A new check, at any severity, including `error` | minor | | An existing check reports cases it missed before | minor | | An existing check turns on in `recommended`, or its default severity goes up | minor | | A bug fix that reports less, or a fix to incorrect formatting output | patch | | A parser change that rejects input it accepted before | major | | A change that the tools built on these packages have to adapt to | major | The first three rows can make a passing theme fail on upgrade. That is why those changes meet every precision gate before they merge, and their changeset says what the change now reports.