Giter VIP home page Giter VIP logo

canary's Introduction

Stickee Canary

Contributors Total Downloads License Latest Stable Version PHP Version

Introduction

Canary provides linting and static analysis for stickee Laravel projects.

It includes:

Husky and Lint Staged

Lint Staged can be used to lint staged files and Husky can be used to manage the pre-commit hook that would call it.

The install command will copy example configs over for these tools but you must install them before running it.

Installation

mkdir -p tools/canary
composer require --working-dir=tools/canary stickee/canary
tools/canary/vendor/bin/canary install

Why do we install tools into their own directory?

You should commit this new directory and the config files that are installed.

Usage

Canary provides a unified and decoupled platform for making use of powerful linting and static analysis tools that we make heavy use of at stickee.

Options

To pass options through you must write them after a --.

tools/canary/vendor/bin/canary analyse -- -c phpstan.ci.neon --error-format=github

Commands

analyse

PHPStan

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

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

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

See stickee/larastan-config for more details.

fix

PHP CS Fixer

tools/canary/vendor/bin/canary fix -- --config .php-cs-fixer.dist.php

This command will attempt to fix minor code style issues.

It can be ran against a single file.

It should be ran against staged files as part of the pre-commit hook.

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

suggest

Rector in --dry-run mode

tools/canary/vendor/bin/canary suggest

This command will suggest improvements as diffs in the terminal.

Any suggested improvements must be performed manually or you can run the improve command to do it for you.

See stickee/rector-config for more details.

improve

Rector

tools/canary/vendor/bin/canary improve

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 the pre-commit hook.

See stickee/rector-config for more details.

Note

You may find it useful to add these improvements as patches with Git.

You could use a Git integration in your editor or stage the improvements as patches with:

git add <file> -p

Contributions

Contributions are welcome! Canary is written using Laravel Zero. Improvements to any of the amalgamated open source tools should be directed towards their respective repositories.

You are encouraged to provide tests, which are written using the Pest testing framework.

License

Canary is open source software licensed under the MIT license.

canary's People

Contributors

stickeepaul avatar stickeeoliver avatar semantic-release-bot avatar oliverearl avatar dependabot[bot] avatar stickeegreg avatar zebranorth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.