Skip to content

2.4.0

Choose a tag to compare

@dereuromark dereuromark released this 14 Nov 02:50
· 92 commits to master since this release

Improvements

Custom Linter Tasks System

Added a flexible linter system for running project-specific code quality checks that don't fit into standard static analysis tools (phpcs, phpstan, rector).

Run them in locally and in your CI.

output

Key Highlights:

  • Extensible: Create custom tasks in App\Command\Linter\Task\
  • Fast: Designed for quick validation (completes in seconds)
  • Configurable: Enable/disable tasks via FQCN-based config

Included Default Tasks

Four production-ready linter tasks are included and enabled by default:

  1. no-mixed-in-templates - Enforce specific type annotations in templates (not mixed)
  2. use-orm-query - Detect incorrect Cake\Database\Query imports (should be Cake\ORM\Query\SelectQuery)
  3. use-base-migration - Flag deprecated AbstractMigration/AbstractSeed usage
  4. single-request-per-test - Validate controller tests have only one request per method

Usage Examples

  # Run all tasks
  bin/cake linter

  # Run with verbose output (shows paths)
  bin/cake linter -v

  # Run specific task
  bin/cake linter --task use-orm-query

  # List available tasks
  bin/cake linter --list

Configuration

Customize tasks in config/app.php:

'TestHelper' => [
    'Linter' => [
        'tasks' => [
            // Add custom tasks
            \App\Command\Linter\Task\MyCustomTask::class,

            // Disable default tasks
            \TestHelper\Command\Linter\Task\UseOrmQueryTask::class => false,
        ],
    ],
],

Full Changelog: 2.3.0...2.4.0