Easy CI - Tools that make easy to setup CI.

Related tags

Build Tools easy-ci
Overview

Easy CI

Downloads total

Tools that make easy to setup CI.

  • Check git conflicts in CI
  • Check TWIG and Latte templates for missing classes, non-existing static calls and constant fetches
  • Check YAML and NEON configs for the same
  • Extract Latte filters from static calls in templates

Install

composer require symplify/easy-ci --dev

Usage

1. Check your Code for Git Merge Conflicts

Do you use Git? Then merge conflicts is not what you want in your code ever to see:

<<<<<<< HEAD
this is some content to mess with
content to append
=======
totally different content to merge later

How to avoid it? Add check to your CI:

vendor/bin/easy-ci check-conflicts .

The /vendor directory is excluded by default.


2. Provide php-json for Dynamic GitHub Actions Matrix

Dynamic Matrix for GitHub Actions is one of cool way to simplify CI setup.

Instead of providing PHP versions manually one by one:

        # ...
        strategy:
            matrix:
                php:
                    - 7.3
                    - 7.4
                    - 8.0

Use information from your composer.json:

vendor/bin/easy-ci php-versions-json
# "[7.3, 7.4, 8.0]"

Use in GitHub Action Workflow like this:

jobs:
    provide_php_versions_json:
        runs-on: ubuntu-latest

        steps:
            # git clone + use PHP + composer install
            -   uses: actions/checkout@v2
            -   uses: shivammathur/setup-php@v2
                with:
                    php-version: 8.0

            -   uses: "ramsey/composer-install@v1"

            # to see the output
            -   run: vendor/bin/easy-ci php-versions-json

            # here we create the json, we need the "id:" so we can use it in "outputs" bellow
            -
                id: output_data
                run: echo "::set-output name=matrix::$(vendor/bin/easy-ci php-versions-json)"

        # here, we save the result of this 1st phase to the "outputs"
        outputs:
            matrix: ${{ steps.output_data.outputs.matrix }}

    unit_tests:
        needs: provide_php_versions_json
        strategy:
            fail-fast: false
            matrix:
                php: ${{ fromJson(needs.provide_php_versions_json.outputs.matrix) }}

        # ...

3. Check Configs for Non-Existing Classes

vendor/bin/easy-ci check-config src

Supported types are YAML and NEON.


4. Check Templates for Non-Existing Classes

vendor/bin/easy-ci check-latte-template templates

5. Check Twig Controller Paths

vendor/bin/easy-ci check-twig-render src/Controller
final class SomeController
{
    public function index()
    {
        return $this->render('does_path_exist.twig');
    }
}

6. Avoid Static Calls in Latte Templates and use FilterProvider Instead

Static calls in Latte templates are a code smell. Make your code more decoupled and use a Latte filter instead:

 # any latte file
-{\App\SomeClass::someStaticMethod($value)}
+{$value|someStaticMethod}

Filter provider can look like this:

use App\Contract\Latte\FilterProviderInterface;
use App\SomeClass;

final class SomeMethodFilterProvider implements FilterProviderInterface
{
    public function __invoke(string $name): int
    {
        return SomeClass::someStaticMethod($name);
    }

    public function getName(): string
    {
        return 'someMethod';
    }
}

7. Detect Static Calls in Your Code

vendor/bin/easy-ci detect-static src

8. Detect Commented Code

Have you ever forgot commented code in your code?

//      foreach ($matches as $match) {
//           $content = str_replace($match[0], $match[2], $content);
//      }

Clutter no more! Add check-commented-code command to your CI and don't worry about it:

vendor/bin/easy-ci check-commented-code <directory>
vendor/bin/easy-ci check-commented-code packages --line-limit 5

9. Short File === Class Name

Does short file name matches the class name?

vendor/bin/easy-ci check-file-class-name src

10. Avoid 2 classes in 1 File

What files have 2 and more classes?

vendor/bin/easy-ci find-multi-classes tests

Report Issues

In case you are experiencing a bug or want to request a new feature head over to the Symplify monorepo issue tracker

Contribute

The sources of this package are contained in the Symplify monorepo. We welcome contributions for this package on symplify/symplify.

You might also like...
Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.

Jetpack Monorepo This is the Jetpack Monorepo. It contains source code for the Jetpack plugin, the Jetpack composer packages, and other things. How to

A PHP webpage that uses string replacements to generate a binary on the fly that you can enter at setup in NEOS.

openpilot-installer-generator A PHP webpage that uses string replacements to generate a binary on the fly that you can enter at setup in NEOS. What is

A script to help setup Laravel project with common packages and configurations

About Snap Snap allow developer to create scaffold Laravel project. Installation Clone this repository in your user home directory. cd ~ git clone htt

A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.

#Vue-Cli Template for Larvel + Webpack + Hotreload (HMR) I had a really tough time getting my workflow rocking between Laravel and VueJS projects. I f

Run the following commands in your terminal to setup the project

Run the following commands in your terminal to setup the project You must have the LAMP installed on your system git clone https://github.com/Bashar-A

Ladumor Laravel Swagger  help to setup swagger in your application easily
Ladumor Laravel Swagger help to setup swagger in your application easily

Laravel Swagger Installation Install the package by the following command, composer require ladumor/laravel-swagger Add Provider Add the provider to

Package for Laravel that gives artisan commands to setup and edit environment files.
Package for Laravel that gives artisan commands to setup and edit environment files.

Setup and work with .env files in Laravel from the command line NOTE: This doesn't work with Laravel 5 since .env files were changed. This is for Lara

Setup Docker Para Projetos Laravel

Setup Docker Para Projetos Laravel

Easily setup SEO in your laravel project with lara-head :heart: @code4mk
Easily setup SEO in your laravel project with lara-head :heart: @code4mk

installation composer require code4mk/lara-head usage meta ~ inside controller use Khead; class Test { public function home() { Khead::setMeta

Helps you securely setup a master password and login into user accounts with it.
Helps you securely setup a master password and login into user accounts with it.

🔑 Make your Login form smart in a minute! Built with ❤️ for every smart laravel developer Helps you set a master password in .env file and login into

This is a setup for a Tor based shared web hosting server

General Information: This is a setup for a Tor based shared hosting server. It is provided as is and before putting it into production you should make

Redirects any user which hasn't setup two factor authentication yet to /2fa/

force-two-factor Redirects any user which hasn't setup two factor authentication yet to /2fa/. Use together with the forked two-factor plugin at https

Vagrant-boxes - Setup scripts and docs for my vagrant boxes, primarily aimed at Web/SilverStripe developement

zauberfisch's vagrant boxes zauberfisch/silverstripe-debian64 Debian 10 x86_64 LAMP Box with many extra features, pre-configured for SilverStripe Sour

Production ready scalable Magento setup utilizing the docker

Magento docker image Requirements This docker image expects 2 other linked containers to work . Mysqldb or Mariadb linked as 'db' Memcached linked as

Laravel 8 boilerplate in docker-compose with Treafik and SSL setup and github workflow ready for CI/CD pipeline

Laravel8 boilerplate Laravel 8 boilerplate in docker-compose with Treafik and SSL setup with .github workflow ready To start the containers in prod en

composer plugin for a better frontend setup

node-composer composer plugin for a better frontend setup PHP projects mostly are Web-Applications. Many Web-Applications also need a frontend part wh

Use this skeleton application to quickly setup and start working on a new Slim Framework 4 application

Slim Framework 4 Skeleton Application Use this skeleton application to quickly setup and start working on a new Slim Framework 4 application. This app

Setup Docker Para Projetos Laravel 9 com PHP 8

Setup Docker Para Projetos Laravel 9 com PHP 8

A seamless django like admin panel setup for Laravel. Simple, non-cms table manager for admins.
A seamless django like admin panel setup for Laravel. Simple, non-cms table manager for admins.

Seamless Admin Panel A seamless Django-like admin panel setup for Laravel. Simple, non-cms table manager for admins. Installation steps Require the Pa

Owner
Easy Coding Standard, Static Site Generator, Package Builder utils on PHP 8.0 and Symfony 5.4
null
PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.

P H I N G Thank you for using PHING! PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant. You can do anything wit

The Phing Project 1.1k Dec 22, 2022
Phpake is a make-like utility built for PHP.

Phpake is a make-like utility built for PHP. It is pronounced fake because the second p is silent just like the second p in the word elephpant.

Jigar Mehta 8 Jul 26, 2022
GitHub action to setup PHP with required extensions, php.ini configuration, code-coverage support and various tools like composer...

Setup PHP in GitHub Actions Setup PHP with required extensions, php.ini configuration, code-coverage support and various tools like composer in GitHub

Shivam Mathur 2.4k Jan 6, 2023
GitHub action to setup PHP with required extensions, php.ini configuration, code-coverage support and various tools like composer...

Setup PHP in GitHub Actions Setup PHP with required extensions, php.ini configuration, code-coverage support and various tools like composer in GitHub

Shivam Mathur 2.4k Jan 6, 2023
An opinionated Laravel setup using my favourite tools

Opinionated Laravel Template This is a template I use when starting a new Laravel project. It is opinionated and uses the conventions I prefer to work

Luke Downing 42 Nov 26, 2022
DooTask is a lightweight open source online project task management tool that provides various document collaboration tools, online mind mapping, online flowcharting, project management, task distribution, instant IM, file management and other tools.

DooTask is a lightweight open source online project task management tool that provides various document collaboration tools, online mind mapping, online flowcharting, project management, task distribution, instant IM, file management and other tools.

kuaifan 3k Jan 5, 2023
A premade, easy to use local development setup to be used for authoring Laravel applications

Laravel Drydock This project is a premade, easy to use local development setup to be used for authoring Laravel applications. The deliverables of this

Alexander Trauzzi 19 Nov 11, 2022
My solution use PHP with a class for easy setup

My solution use PHP with a class for easy setup. It accepts requests with the get method just passing the username and password as well as the ip and http port of the Proxmox server. Just needing a web server.

Full Monitoring 2 Jan 15, 2022
BreadBooru is a light, quick, and easy to setup imageboard with themes, images, and video support

BreadBooru a bad imageboard, that has nothing to do with (dan/gel)booru, and yet still has booru in the name BreadBooru is a light, quick, and easy to

bread 2 Jan 22, 2022
Easy XHProf setup to profile your laravel application!

Introduction Laravel XHProf provides you with a simple setup to profile your laravel application with the well known XHProf php extension originally d

Zacharias Creutznacher 122 Dec 23, 2022