PHPackages                             plenta/contao-build-tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. plenta/contao-build-tools

ActiveComposer-plugin[DevOps &amp; Deployment](/categories/devops)

plenta/contao-build-tools
=========================

Highly opinionated build tool setup for Contao websites.

0122↓26.7%2PHP

Since May 18Pushed 1mo agoCompare

[ Source](https://github.com/plenta/contao-build-tools)[ Packagist](https://packagist.org/packages/plenta/contao-build-tools)[ RSS](/packages/plenta-contao-build-tools/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (2)

terminal42 Contao Build Tools
=============================

[](#terminal42-contao-build-tools)

This is an experimental repository to ease configuration of Contao bundles and websites.

**DO NOT USE IN PRODUCTION**

Summary
-------

[](#summary)

This repo contains some highly opinionated configurations for our extensions and websites. The CQ and CS tools currently assume that your bundle or application is set up according to Symfony Best Practice for [applications](https://symfony.com/doc/current/best_practices.html) or [bundles](https://symfony.com/doc/current/bundles/best_practices.html), meaning there is an `src/`directory where all your application or bundle code lives in, but none of the configuration.

Code Quality and Code Style
---------------------------

[](#code-quality-and-code-style)

This package automatically configures the root project for code quality and code style tools. Whenever you run `composer install` or `composer update` on the project, it will also update the build tools automatically. The following tools are currently available and can be executed through the `composer run` command:

### Code Style Fixer

[](#code-style-fixer)

The `cs-fixer` script will fix the coding style in the `src/` directory according to the latest Contao coding standards. Create an `ecs.php` script in your project to extend the default configuration.

You can extend the default configuration by adding a `ecs.php` file to your project root.

### Rector

[](#rector)

The `rector` script will automatically upgrade the code to match the latest Contao standards.

You can extend the default configuration by adding a `rector.php` file to your project root.

### PHPStan

[](#phpstan)

The `phpstan` script will check your code with PHPStan.

You can extend the default configuration by adding a `phpstan.neon` file to your project root.

### Stylelint

[](#stylelint)

The `stylelint` script will check your CSS formatting with [Stylelint](https://stylelint.io).

You can extend the default configuration by adding a `.stylelintrc` file to your project root.

You can ignore files by adding a `.stylelintignore` file to your project root.

```
# .stylelintignore
layout/scss/vendor/*.scss
layout/scss/other/**/*.scss
```

### Ideas

[](#ideas)

Ideas for additional tools that could be integrated:

- maglnet/composer-require-checker
-

Overwriting Configs
-------------------

[](#overwriting-configs)

The plugin automatically scans the default Contao directories. You can override the paths used by individual tools by adding configuration under `extra.contao-build-tools.tools` in your project's `composer.json`.

```
{
    "extra": {
        "contao-build-tools": {
            "tools": {
                "ecs": {
                    "default": ["./custom-path"],
                    "contao": ["./custom-path"],
                    "template": ["./custom-path"]
                },
                "rector": {
                    "config": ["./custom-path"]
                },
                "phpstan": {
                    "config": ["./custom-path"]
                },
                "stylelint": {
                    "stylelint.config.js": {
                    }
                },
                "eslint": {
                    "eslint.config.js": {
                    }
                },
                "biome": {
                    "biome.json": {
                        "./custom-path": "./custom-path/**/*.js"
                    }
                },
                "twig-cs-fixer": {
                    "config": ["./custom-path"]
                }
            }
        }
    }
}
```

If you want to customise the paths used by Composer Dependency Analyser, create a `composer-dependency-analyser.php` file in your project's root directory and return a `Configuration` instance. This completely replaces the default `pathsToScan` configuration provided by the plugin.

```
