PHPackages                             tightenco/duster - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. tightenco/duster

ActiveProject[Testing &amp; Quality](/categories/testing)

tightenco/duster
================

Automatic configuration for Laravel apps to apply Tighten's standard linting &amp; code standards.

v3.4.1(1mo ago)5942.4M—0%24[9 issues](https://github.com/tighten/duster/issues)[3 PRs](https://github.com/tighten/duster/pulls)20MITPHPPHP ^8.2.0CI passing

Since Feb 1Pushed 1mo ago10 watchersCompare

[ Source](https://github.com/tighten/duster)[ Packagist](https://packagist.org/packages/tightenco/duster)[ Docs](https://github.com/tighten/duster)[ RSS](/packages/tightenco-duster/feed)WikiDiscussions 3.x Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (73)Used By (20)

[![Project Banner](https://raw.githubusercontent.com/tighten/duster/main/banner.png)](https://raw.githubusercontent.com/tighten/duster/main/banner.png)

Duster
======

[](#duster)

Automatically apply Tighten's default code style for Laravel apps.

Duster is built on top of the following tools:

- TLint: lints Laravel and PHP code for issues not covered by other tools
    - using the default `Tighten` preset
- PHP\_CodeSniffer: sniffs issues that can't be fixed automatically
    - using the `Tighten` preset which is mostly PSR1 with some Tighten-specific rules
- PHP CS Fixer: adds custom rules not supported by Laravel Pint
    - `CustomOrderedClassElementsFixer` Tighten-specific order of class elements
- Pint: Laravel's code style rules (with a few Tighten specific customizations)
    - using the default `Laravel` preset with some Tighten-specific rules

You can view a list of the compiled rules and examples of what they do in the [style guide](./style-guide.md).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require tightenco/duster --dev
```

Optionally you can publish a GitHub Actions config:

```
./vendor/bin/duster github-actions
```

Or you can publish Husky Hooks:

```
./vendor/bin/duster husky-hooks
```

If you are using a containerized environment and do not have PHP installed locally, you can use the `--env` option to specify it:

```
./vendor/bin/duster husky-hooks --env=ddev
```

Supported environments are `ddev`, `warden` `lando`, and `sail`.

Usage
-----

[](#usage)

To lint everything at once:

```
./vendor/bin/duster lint
```

To fix everything at once:

```
./vendor/bin/duster fix
```

To dust only files that have uncommitted changes according to Git, you may use the `--dirty` option:

```
./vendor/bin/duster lint --dirty
#or
./vendor/bin/duster fix --dirty
```

To view all available commands:

```
./vendor/bin/duster
#or
./vendor/bin/duster commands
```

### Usage with Sail

[](#usage-with-sail)

```
./vendor/bin/sail php ./vendor/bin/duster
```

Alternatively, Sail has a bin [script](https://github.com/laravel/sail/blob/1.x/bin/sail#L211) that eases the execution of package binaries, so you do the same thing like this:

```
./vendor/bin/sail bin duster
```

Customizing
-----------

[](#customizing)

If you need to include or exclude files or directories for each tool you can create a `duster.json` config file in your project root:

```
{
    "include": [
        "bin",
        "scripts",
        "src",
        "tests"
    ],
    "exclude": [
        "tests/fixtures",
        "**/folderToExclude/**"
    ]
}
```

To run additional scripts as part of Duster first add them to `duster.json` as part of `scripts` separated into `lint` and `fix`.

The key is the name of the command (used with the `--using` flag), and the value is an array of arguments passed to [`Symfony\Component\Process\Process`](https://symfony.com/doc/current/components/process.html).

```
{
    "scripts": {
        "lint": {
            "phpstan": ["./vendor/bin/phpstan", "analyse"]
        }
    },
    "processTimeout": 120
}
```

Duster will pick these up automatically when running either `lint` or `fix`. By default, additional scripts timeout after 60 seconds. You can overwrite this setting using the `processTimeout` key.

To customize which tools Duster runs, or the order in which they are executed you can use the `--using` flag and supply a comma-separated list of commands:

```
./vendor/bin/duster lint --using="phpstan,tlint,pint"
```

### TLint

[](#tlint)

Create a `tlint.json` file in your project root. Learn more in the [TLint documentation](https://github.com/tighten/tlint#configuration).

### PHP\_CodeSniffer

[](#php_codesniffer)

Create a `.phpcs.xml.dist` file in your project root with the following:

```

    app
    config
    database
    public
    resources
    routes
    tests

```

Now you can add customizations below the `` line or even disable the Tighten rule to use your own ruleset. Learn more in this [introductory article](https://ncona.com/2012/12/creating-your-own-phpcs-standard/).

### PHP CS Fixer

[](#php-cs-fixer)

Create a `.php-cs-fixer.dist.php` file in your project root with the contents from [Duster's `.php-cs-fixer.dist.php`](standards/.php-cs-fixer.dist.php) file. Learn more in the [PHP CS Fixer documentation](https://cs.symfony.com/doc/config.html).

### Pint

[](#pint)

Create a `pint.json` file in your project root, you can use [Duster's `pint.json`](standards/pint.json) file as a starting point. Learn more in the [Pint documentation](https://laravel.com/docs/pint#configuring-pint).

GitHub Action
-------------

[](#github-action)

There's a [GitHub Action](https://github.com/tighten/duster-action) you use to clean-up your workflows.

> **Warning** Heads Up! Workflows that commit to your repo will stop any currently running workflows and not trigger another workflow run.

One solution is to run your other workflows after Duster has completed by updating the trigger on those workflows:

```
on:
  # Commits made in Duster Fix will not trigger any workflows
  # This workflow is configured to run after Duster finishes
  workflow_run:
    workflows: ["Duster Fix"]
    types:
      - completed
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Matt Stauffer](https://github.com/mattstauffer)
- [Anthony Clark](https://github.com/driftingly)
- [Tom Witkowski](https://github.com/devgummibeer) - much of the original idea and syntax for this was inspired by his [`elbgoods/ci-test-tools`](https://github.com/elbgoods/ci-test-tools) package
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

72

—

ExcellentBetter than 100% of packages

Maintenance88

Actively maintained with recent releases

Popularity63

Solid adoption and visibility

Community44

Growing community involvement

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 71.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~29 days

Recently: every ~92 days

Total

65

Last Release

53d ago

Major Versions

v0.7.0 → v1.0.02023-03-08

v1.2.1 → v2.0.02023-04-18

1.x-dev → v2.0.12023-05-12

v2.7.5 → v3.0.02024-06-03

v2.7.6 → v3.0.22024-09-27

PHP version history (7 changes)v0.1.0alpha1PHP ^7.4

v0.2.0-rc.1PHP ^7.4|^8.0

v0.3.2PHP ^7.3|^8.0

v0.4.0PHP ^8.0|^8.1

v0.5.0PHP ^8.0

v2.0.0PHP ^8.1.0

v3.0.0PHP ^8.2.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/151829?v=4)[Matt Stauffer](/maintainers/mattstauffer)[@mattstauffer](https://github.com/mattstauffer)

---

Top Contributors

[![driftingly](https://avatars.githubusercontent.com/u/194221?v=4)](https://github.com/driftingly "driftingly (274 commits)")[![mattstauffer](https://avatars.githubusercontent.com/u/151829?v=4)](https://github.com/mattstauffer "mattstauffer (62 commits)")[![tonysm](https://avatars.githubusercontent.com/u/1178621?v=4)](https://github.com/tonysm "tonysm (13 commits)")[![rissajackson](https://avatars.githubusercontent.com/u/57572484?v=4)](https://github.com/rissajackson "rissajackson (7 commits)")[![ArielMejiaDev](https://avatars.githubusercontent.com/u/31971074?v=4)](https://github.com/ArielMejiaDev "ArielMejiaDev (6 commits)")[![msamgan](https://avatars.githubusercontent.com/u/29948727?v=4)](https://github.com/msamgan "msamgan (6 commits)")[![musa11971](https://avatars.githubusercontent.com/u/21341801?v=4)](https://github.com/musa11971 "musa11971 (3 commits)")[![jonsugar](https://avatars.githubusercontent.com/u/1974648?v=4)](https://github.com/jonsugar "jonsugar (2 commits)")[![ThaKladd](https://avatars.githubusercontent.com/u/470556?v=4)](https://github.com/ThaKladd "ThaKladd (2 commits)")[![Gummibeer](https://avatars.githubusercontent.com/u/6187884?v=4)](https://github.com/Gummibeer "Gummibeer (2 commits)")[![FrankGREV](https://avatars.githubusercontent.com/u/136092258?v=4)](https://github.com/FrankGREV "FrankGREV (1 commits)")[![svenluijten](https://avatars.githubusercontent.com/u/11269635?v=4)](https://github.com/svenluijten "svenluijten (1 commits)")[![Rigby90](https://avatars.githubusercontent.com/u/575561?v=4)](https://github.com/Rigby90 "Rigby90 (1 commits)")[![benholmen](https://avatars.githubusercontent.com/u/1056188?v=4)](https://github.com/benholmen "benholmen (1 commits)")[![chenrui333](https://avatars.githubusercontent.com/u/1580956?v=4)](https://github.com/chenrui333 "chenrui333 (1 commits)")[![jerredhurst](https://avatars.githubusercontent.com/u/13042804?v=4)](https://github.com/jerredhurst "jerredhurst (1 commits)")

---

Tags

codequalityformatterlaravellinterphpphplaravelCode styletightencoduster

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/tightenco-duster/health.svg)

```
[![Health](https://phpackages.com/badges/tightenco-duster/health.svg)](https://phpackages.com/packages/tightenco-duster)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[nunomaduro/laravel-mojito

A lightweight package for testing Laravel views.

368435.5k11](/packages/nunomaduro-laravel-mojito)[calebdw/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

1484.6k3](/packages/calebdw-larastan)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
