Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lint

on:
push:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest

# 'push' runs on inner branches, 'pull_request' will run only on outer PRs
if: >
github.event_name == 'push'
|| (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name != github.repository)

permissions:
contents: read
steps:
- name: Code Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
extensions: gd, zip, intl, yaml, pdo_mysql, rdkafka, imagick
tools: composer:v2
coverage: none

- name: Install dependencies
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist

- name: PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@

/logs/*
!/logs/.gitkeep

.php-cs-fixer.cache
14 changes: 14 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
;

return (new PhpCsFixer\Config())
->setRules([
'@PER-CS2x0' => true,
'@PHP8x2Migration' => true,
])
->setFinder($finder)
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
;
21 changes: 21 additions & 0 deletions bin/chandler-latte-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env php
<?php

$_SERVER["HTTP_ACCEPT_LANGUAGE"] = false;
$bootstrap = require(__DIR__ . "/../chandler/Bootstrap.php");
$bootstrap->ignite(true);

$path = $argv[1] ?? '.';

use Chandler\MVC\SimplePresenter;

final class TestPresenter extends SimplePresenter {}

$presenter = new TestPresenter();
$latte = $presenter->getTemplatingEngine();
$latte->addExtension(new \Latte\Essential\TranslatorExtension(tr(...)));
$latte->setStrictParsing();
$linter = new Latte\Tools\Linter(engine: $latte);

$ok = $linter->scanDirectory($path);
exit($ok ? 0 : 1);
45 changes: 0 additions & 45 deletions chandler.iml

This file was deleted.

60 changes: 0 additions & 60 deletions chandler.ipr

This file was deleted.

101 changes: 0 additions & 101 deletions chandler.iws

This file was deleted.

Loading
Loading