Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion products/tools/cli/automatic-refactoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The Administration Twig migrations are implemented as individual fixers under [`
Other registered tools do not modify files in `fix` mode:

- `php-cs-fixer` and `prettier` are used for [formatting](./formatter.md).
- `phpstan`, `storefront-twig`, and `sw-cli` report findings during [validation](./validation.md).
- `phpstan`, `storefront-twig`, and `builtin` report findings during [validation](./validation.md).

Selecting one of these tools with `fix --only` therefore does not modify anything.

Expand Down
2 changes: 1 addition & 1 deletion products/tools/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The Shopware CLI binary itself does not require PHP or Node.js for every command
- **Composer** when the CLI prepares PHP verifier dependencies or resolves project/extension dependencies
- **npm** when the CLI prepares its JavaScript verifier dependencies

Basic `extension validate` uses the built-in `sw-cli` checks and does not require a local PHP or Node.js runtime. The [Docker images](installation.md#docker-image) include the verifier runtime dependencies and are recommended for consistent validation, refactoring, and formatting environments.
Basic `extension validate` uses the built-in `builtin` checks and does not require a local PHP or Node.js runtime. The [Docker images](installation.md#docker-image) include the verifier runtime dependencies and are recommended for consistent validation, refactoring, and formatting environments.

When you use the Docker-based development environment, run Composer and PHP tools inside the web container rather than on the host. See [Running Composer, PHP, and npm](../../../guides/development/dev-environment.md#running-composer-php-and-npm).

Expand Down
18 changes: 11 additions & 7 deletions products/tools/cli/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@

Validation has two modes:

- **Basic (default)**: Runs the built-in `sw-cli` checks, including metadata, icon, snippets, PHP linting, and packaging-related checks. It does not require a locally installed PHP or Node.js runtime.
- **Basic (default)**: Runs the built-in `builtin` checks, including metadata, icon, snippets, PHP linting, and packaging-related checks. It does not require a locally installed PHP or Node.js runtime.
- **Full (`--full`)**: Runs the basic checks plus validation tools such as PHPStan, ESLint, Stylelint, and the Administration and Storefront Twig linters.

:::warning
`--only` does not enable full validation. Without `--full`, `extension validate` runs only the built-in `sw-cli` checks. For example, `extension validate --only phpstan` does not run PHPStan; use `extension validate --full --only phpstan`.
`--only` does not enable full validation. Without `--full`, `extension validate` runs only the built-in `builtin` checks. For example, `extension validate --only phpstan` does not run PHPStan; use `extension validate --full --only phpstan`.
:::

:::info
The built-in checker was previously named `sw-cli`. That name is still accepted by `--only` and `--exclude` as a legacy alias, but it now prints a deprecation warning. Use `builtin` in new commands and configuration.
:::

### Recommended setup: Docker
Expand Down Expand Up @@ -55,7 +59,7 @@

## What is validated in basic mode?

Basic mode runs the `sw-cli` tool. It includes checks such as the following; this list is not exhaustive. The identifier in brackets is the value you can use in [validation ignores](#validation-ignores).
Basic mode runs the `builtin` tool. It includes checks such as the following; this list is not exhaustive. The identifier in brackets is the value you can use in [validation ignores](#validation-ignores).

Metadata and extension structure checks include:

Expand Down Expand Up @@ -142,17 +146,17 @@

With `--full`, `extension validate` calls the validation check implemented by each registered tool. The tools that currently add validation findings are:

| Tool | Reports in `validate` | Rewrites in `fix` | Formats in `format` | Notes |

Check warning on line 149 in products/tools/cli/validation.md

View workflow job for this annotation

GitHub Actions / Documentation Markdown Linter

MD060

Table columns should be aligned
| ----------------- | --------------------- | ----------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------- |

Check warning on line 150 in products/tools/cli/validation.md

View workflow job for this annotation

GitHub Actions / Documentation Markdown Linter

MD060

Table columns should be aligned
| `sw-cli` | ✅ (extensions only) | — | — | Extension metadata, snippets, structure, packaging. Returns immediately for a project, so **projects get no metadata validation** |
| `builtin` | ✅ (extensions only) | — | — | Extension metadata, snippets, structure, packaging. Returns immediately for a project, so **projects get no metadata validation**. Legacy alias: `sw-cli` |
| `phpstan` | ✅ | — | — | PHP static analysis; skipped for apps (no `composer.json`) |

Check warning on line 152 in products/tools/cli/validation.md

View workflow job for this annotation

GitHub Actions / Documentation Markdown Linter

MD060

Table columns should be aligned
| `eslint` | ✅ | ✅ | — | JavaScript, Vue, TypeScript with Shopware-specific rules |

Check warning on line 153 in products/tools/cli/validation.md

View workflow job for this annotation

GitHub Actions / Documentation Markdown Linter

MD060

Table columns should be aligned
| `stylelint` | ✅ | ✅ | — | CSS/SCSS with Shopware standards |

Check warning on line 154 in products/tools/cli/validation.md

View workflow job for this annotation

GitHub Actions / Documentation Markdown Linter

MD060

Table columns should be aligned
| `admin-twig` | ✅ | ✅ | ✅ | Administration Twig component checks and migrations |

Check warning on line 155 in products/tools/cli/validation.md

View workflow job for this annotation

GitHub Actions / Documentation Markdown Linter

MD060

Table columns should be aligned
| `storefront-twig` | ✅ | — | — | Storefront Twig checks (accessibility, inline styles); reports only |

Check warning on line 156 in products/tools/cli/validation.md

View workflow job for this annotation

GitHub Actions / Documentation Markdown Linter

MD060

Table columns should be aligned
| `rector` | — | ✅ | — | PHP breaking-change and upgrade rules. **Rewrites without reporting** — nothing appears in `validate` |

Check warning on line 157 in products/tools/cli/validation.md

View workflow job for this annotation

GitHub Actions / Documentation Markdown Linter

MD060

Table columns should be aligned
| `symfony-xml` | — | ✅ | — | Converts deprecated `services.xml` / `routes.xml` to YAML |

Check warning on line 158 in products/tools/cli/validation.md

View workflow job for this annotation

GitHub Actions / Documentation Markdown Linter

MD060

Table columns should be aligned
| `php-cs-fixer` | — | — | ✅ | PHP code style (Shopware Coding Standard) |

Check warning on line 159 in products/tools/cli/validation.md

View workflow job for this annotation

GitHub Actions / Documentation Markdown Linter

MD060

Table columns should be aligned
| `prettier` | — | — | ✅ | JavaScript, Vue, TypeScript, CSS, SCSS formatting |

Every tool is registered for all three verbs, but the unmarked combinations above are implemented as no-ops. Passing such a tool to `--only` is therefore silently ineffective — `fix --only phpstan` and `fix --only prettier` both do nothing.
Expand All @@ -161,8 +165,8 @@

| Command | Tools that do work |
| ------------------------------------- | --------------------------------------------------------------------------- |
| `extension validate` | `sw-cli`, `phpstan`, `eslint`, `stylelint`, `admin-twig`, `storefront-twig` |
| `project validate` | the same, minus `sw-cli` |
| `extension validate` | `builtin`, `phpstan`, `eslint`, `stylelint`, `admin-twig`, `storefront-twig` |
| `project validate` | the same, minus `builtin` |
| `extension fix` / `project fix` | `rector`, `admin-twig`, `eslint`, `stylelint`, `symfony-xml` |
| `extension format` / `project format` | `admin-twig`, `php-cs-fixer`, `prettier` |

Expand Down Expand Up @@ -319,7 +323,7 @@
`project validate` gathers local extension source directories and configured bundles and runs the registered validation tools against them. Composer-managed extensions resolved under `vendor/` are skipped. Project-level validation settings are read from `.config/shopware-project.yml` under `validation`.

:::warning
`project validate` does not run extension metadata and packaging validation for every contained extension. The `sw-cli` verifier only runs with a single-extension context. Run `extension validate` for an individual extension when you also need its Composer or manifest metadata, icon, snippet, and package checks.
`project validate` does not run extension metadata and packaging validation for every contained extension. The `builtin` verifier only runs with a single-extension context. Run `extension validate` for an individual extension when you also need its Composer or manifest metadata, icon, snippet, and package checks.
:::

If you omit the path, `project validate` discovers the nearest Shopware project by walking up from the current directory. A directory is recognized when its Composer metadata references `shopware/core` and `bin/console` exists; `PROJECT_ROOT` overrides this discovery.
Expand Down
Loading