stickee/canary

Canary provides linting and static analysis for Stickee Laravel projects

Installs: 11 305

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 1

Open Issues: 1

Type:metapackage

v4.0.0 2025-02-04 11:53 UTC

README

Contributors Total Downloads License Latest Stable Version PHP Version

Introduction

Canary provides linting and static analysis for stickee Laravel projects.

It includes:

Installation

Composer

composer require --dev stickee/canary

Config

cp vendor/stickee/php-cs-fixer-config/dist/.php-cs-fixer.php .
cp vendor/stickee/larastan-config/dist/phpstan.dist.neon .
cp vendor/stickee/larastan-config/dist/phpstan.ci.neon .
cp vendor/stickee/rector-config/dist/rector.php .

You should commit these config files.

.gitignore

if grep -q '.php-cs-fixer.cache' .gitignore;
then
    echo ".gitignore contains .php-cs-fixer.cache";
else
    echo "Adding .php-cs-fixer.cache to .gitignore";
    echo ".php-cs-fixer.cache" >> .gitignore;
    echo "Done";
fi

Usage

Canary provides a unified package that brings together powerful linting and static analysis tools that we make heavy use of at stickee.

Tools

analyse

PHPStan

vendor/bin/phpstan analyse -c phpstan.dist.neon

This command will perform static-analysis of your whole project.

It could be ran as part of a pre-commit hook.

See stickee/larastan-config for more details.

fix

PHP CS Fixer

vendor/bin/php-cs-fixer fix --config .php-cs-fixer.php

This command will attempt to fix minor code style issues.

It can be ran against a single file.

It could be ran against staged files as part of a pre-commit hook.

See stickee/php-cs-fixer-config for more details.

improve

Rector

vendor/bin/rector

This command will refactor your code in an attempt to improve it.

Any improved code must be checked before committing.

It can be ran against a single file.

It should not be ran as part of a pre-commit hook.

See stickee/rector-config for more details.

suggest

Rector in --dry-run mode

vendor/bin/rector --dry-run

This command will suggest improvements as diffs in the terminal.

See stickee/rector-config for more details.

Contributions

Contributions are welcome!

Improvements to any of the amalgamated open source tools should be directed towards their respective repositories.

License

Canary is open source software licensed under the MIT license.