README.md

October 23, 2023 ยท View on GitHub

โœ๏ธ Codely's Easy Coding Standards configuration

Codely Open Source CodelyTV Courses

Opinionated linting configuration considering modern PHP best practices and providing consistency. ๐Ÿ‘Œ

Take a look, play and have fun with this. Stars are welcome ๐Ÿ˜Š

๐Ÿ‘€ How to use

  1. Install the dependency
    composer require --dev codelytv/coding-style
    
  2. Add it to your ecs.php file:
    use CodelyTv\CodingStyle;
    use Symplify\EasyCodingStandard\Config\ECSConfig;
    
    return function (ECSConfig $ecsConfig): void {
        $ecsConfig->paths([__DIR__ . '/src',]);
    
        $ecsConfig->sets([CodingStyle::DEFAULT]);
    
        // Or this if you prefer to have the code aligned
        // $ecsConfig->sets([CodingStyle::ALIGNED]);
    };
    
  3. Execute it:
    ./vendor/bin/ecs check
    

๐Ÿค” What it does

  • Lints PHP using PSR-12
  • Extends some config (you can see all the rules here)
  • Use tabs to indent (reason). If you want to use spaces, you can add the following line at the end of your ecs.php:
    use Symplify\EasyCodingStandard\ValueObject\Option;
    
    $ecsConfig->indentation(Option::INDENTATION_SPACES);
    

๐Ÿ“ฆ How to release a new version

Simply create a new GitHub Release following semantic versioning.

๐Ÿ‘Œ Codely Code Quality Standards

Publishing this package we are committing ourselves to the following code quality standards:

  • ๐Ÿค Respect Semantic Versioning: No breaking changes in patch or minor versions
  • ๐Ÿค No surprises in transitive dependencies: Use the bare minimum dependencies needed to meet the purpose
  • ๐ŸŽฏ One specific purpose to meet without having to carry a bunch of unnecessary other utilities
  • ๐Ÿ“– Well documented Readme showing how to install and use
  • โš–๏ธ License favoring Open Source and collaboration