Skip to content

Commit

Permalink
➕ Add editorconfig fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
matyo91 committed Aug 7, 2024
1 parent 46b2e58 commit ea95d42
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ dev: ## Start dev server
docs-serve: ## Start documentation server locally
composer docs-serve

editorconfig-fixer: ## Fixes text files based on given .editorconfig declarations
composer editorconfig-fixer

infection: ## Run Infection
composer infection

Expand Down
1 change: 1 addition & 0 deletions tools/castor.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import(__DIR__ . '/dev/castor.php');
import(__DIR__ . '/docs-serve/castor.php');
import(__DIR__ . '/editorconfig-fixer/castor.php');
import(__DIR__ . '/infection/castor.php');
import(__DIR__ . '/phan/castor.php');
import(__DIR__ . '/php-cs-fixer/castor.php');
Expand Down
1 change: 1 addition & 0 deletions tools/editorconfig-fixer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor/
18 changes: 18 additions & 0 deletions tools/editorconfig-fixer/castor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Flow\Tools;

use Castor\Attribute\AsTask;

use function Castor\run;

#[AsTask(description: 'Fixes text files based on given .editorconfig declarations', aliases: ['editorconfig-fixer'])]
function editorconfigFixer(): int
{
return run(
[__DIR__ . '/vendor/bin/editorconfig-fixer fix --suffix php ' . __DIR__ . '/../..'],
allowFailure: true,
)->getExitCode();
}
5 changes: 5 additions & 0 deletions tools/editorconfig-fixer/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require-dev": {
"tomasvotruba/editorconfig-fixer": "^0.1.2"
}
}
62 changes: 62 additions & 0 deletions tools/editorconfig-fixer/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ea95d42

Please sign in to comment.