Skip to content

Commit d67dddb

Browse files
authored
Simplify dev tools (#831)
1 parent 9c9e430 commit d67dddb

File tree

11 files changed

+12
-31
lines changed

11 files changed

+12
-31
lines changed

.dev-tools/build-infection-config renamed to .dev-tools/build-infection-config.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#!/usr/bin/env php
2-
<?php
1+
<?php declare(strict_types=1);
32

43
/*
54
* This file is part of PHP CS Fixer: custom fixers.

.dev-tools/check_file_permissions.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ set -eu
44
files_with_wrong_permissions=$(
55
git ls-files --stage .. \
66
':!*.sh' \
7-
':!build-infection-config' \
8-
':!readme' \
97
| grep '100755 ' \
108
| sort -fh
119
)

.dev-tools/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"@composer normalize --no-check-lock ../composer.json",
5050
"@composer normalize --no-check-lock",
5151
"php-cs-fixer fix --ansi --config=../.php-cs-fixer.php --verbose || exit 0",
52-
"@php build-infection-config",
52+
"@php ./build-infection-config.php",
53+
"@php ./readme.php > ../README.md",
5354
"phpcbf || exit 0"
5455
],
5556
"infection": [

.dev-tools/phpcs.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<file>../src</file>
1111
<file>../tests</file>
1212
<file>../.php-cs-fixer.php</file>
13-
<exclude-pattern>./src/Readme/php-cs-fixer.config.*.php</exclude-pattern>
1413

1514
<rule ref='PSR12'>
1615
<exclude name='Generic.Files.LineLength' />

.dev-tools/readme renamed to .dev-tools/readme.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#!/usr/bin/env php
2-
<?php
1+
<?php declare(strict_types=1);
32

43
/*
54
* This file is part of PHP CS Fixer: custom fixers.

.dev-tools/src/Readme/ReadmeCommand.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ private function usage(): string
161161
```
162162
',
163163
$this->diff(
164-
\file_get_contents(__DIR__ . '/php-cs-fixer.config.before.php'),
165-
\file_get_contents(__DIR__ . '/php-cs-fixer.config.after.php')
164+
\file_get_contents(__DIR__ . '/php-cs-fixer.config.before.txt'),
165+
\file_get_contents(__DIR__ . '/php-cs-fixer.config.after.txt')
166166
)
167167
);
168168
}
@@ -271,17 +271,12 @@ private function contributing(): string
271271
'## Contributing
272272
Request feature or report bug by creating [issue](https://github.com/%s/issues).
273273
274-
Alternatively, fork the repo, develop your changes, regenerate `README.md`:
275-
```bash
276-
%s
277-
```
278-
make sure all checks pass:
274+
Alternatively, fork the repository, develop your changes, make sure everything is fine:
279275
```bash
280276
composer verify
281277
```
282278
and submit pull request.',
283279
$this->composer()->name,
284-
\substr(\end($this->composer()->scripts->fix), 1)
285280
);
286281
}
287282

.dev-tools/src/Readme/php-cs-fixer.config.after.php renamed to .dev-tools/src/Readme/php-cs-fixer.config.after.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
return (new PhpCsFixer\Config)
2+
return (new PhpCsFixer\Config())
33
->registerCustomFixers(new PhpCsFixerCustomFixers\Fixers())
44
->setRules([
55
'@PSR2' => true,

.dev-tools/src/Readme/php-cs-fixer.config.before.php renamed to .dev-tools/src/Readme/php-cs-fixer.config.before.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
return (new PhpCsFixer\Config)
2+
return (new PhpCsFixer\Config())
33
->setRules([
44
'@PSR2' => true,
55
'array_syntax' => ['syntax' => 'short'],

.php-cs-fixer.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,5 @@
4848
PhpCsFixer\Finder::create()
4949
->ignoreDotFiles(false)
5050
->in(__DIR__)
51-
->notName('php-cs-fixer.config.*.php')
52-
->append([
53-
__DIR__ . '/.dev-tools/build-infection-config',
54-
__DIR__ . '/.dev-tools/readme',
55-
])
5651
)
5752
->setRules($rules);

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ composer require --dev kubawerlos/php-cs-fixer-custom-fixers
2424
In your PHP CS Fixer configuration register fixers and use them:
2525
```diff
2626
<?php
27-
return (new PhpCsFixer\Config)
27+
return (new PhpCsFixer\Config())
2828
+ ->registerCustomFixers(new PhpCsFixerCustomFixers\Fixers())
2929
->setRules([
3030
'@PSR2' => true,
@@ -619,11 +619,7 @@ A class that implements the `__toString ()` method must explicitly implement the
619619
## Contributing
620620
Request feature or report bug by creating [issue](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues).
621621

622-
Alternatively, fork the repo, develop your changes, regenerate `README.md`:
623-
```bash
624-
php .dev-tools/readme > README.md
625-
```
626-
make sure all checks pass:
622+
Alternatively, fork the repository, develop your changes, make sure everything is fine:
627623
```bash
628624
composer verify
629625
```

0 commit comments

Comments
 (0)