csl

Mayesto CSL

Codacy Badge

This pack was designed for more accurate checking of files

Install

composer global require mayesto/csl

ln -s ~/.composer/vendor/bin/csl /usr/bin

Usage

Check command

csl check ./src --yaml=./config.yml

RunOptions:
--format=value      Output format. Possible values: table, json
--yaml=filepath     Select config file in yaml format
-s|--short          Short file path on result
-vvv                Debug mode

Features

Rules

Config file

At this moment file config is supported only in yaml format!

Example of file:

fileIterator: Mayesto\CSL\FileIterator\Git # Name of iterator class
rules: # Array of rules
  Mayesto\CSL\Rule\ParserValidation:

  Mayesto\CSL\Rule\ClassAuthorPattern:
    arguments:
      - '.*?<name@example.com>'

  Mayesto\CSL\Rule\ParserValidation:

  Mayesto\CSL\Rule\InternalFunctionNamespace:

  Mayesto\CSL\Rule\ClassPhpDoc:

  Mayesto\CSL\Rule\MethodReturnTypeRequire:

  Mayesto\CSL\Rule\ClassAuthorRequire:

  Mayesto\CSL\Rule\TooMuchEmptyLines:
    arguments:
      - 2 # Number of empty lines generating an error. Default: 2
      
  Mayesto\CSL\Rule\ClassMethodPhpDocEmptyLineBeforeReturn:

  Mayesto\CSL\Rule\EmptyLineOnEndOfFile:
  
  TestRule:
    file: /home/user/TestRule.php # Class which implements RuleInterface

License

Author

This pack was made by Mayesto. If you have any question, send me an email. m@mayesto.pl