File tree Expand file tree Collapse file tree 3 files changed +60
-1
lines changed
composer-root-version-checker Expand file tree Collapse file tree 3 files changed +60
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ MAKEFLAGS += --no-builtin-rules
99PHPUNIT_BIN = vendor/bin/phpunit
1010PHPUNIT = $(PHPUNIT_BIN )
1111
12+ RECTOR_BIN = ../vendor-bin/rector/vendor/bin/rector
13+ RECTOR = $(RECTOR_BIN ) --config=rector.php
14+
1215
1316.PHONY : help
1417help :
1720
1821
1922.PHONY : check
20- check : cs cs_lint check_root_version phpunit
23+ check : rector cs autoreview check_root_version phpunit
2124
2225
2326.PHONY : check_root_version
@@ -32,6 +35,11 @@ dump_root_version: vendor
3235 @./bin/dump
3336
3437
38+ .PHONY : autoreview
39+ autoreview : # # Runs the AutoReview checks
40+ autoreview : cs_lint rector_lint
41+
42+
3543.PHONY : cs
3644cs : # # Runs the fixers
3745cs : gitignore_sort composer_normalize php_cs_fixer
@@ -75,6 +83,14 @@ php_cs_fixer_lint:
7583phpunit : $(PHPUNIT_BIN ) vendor
7684 $(PHPUNIT )
7785
86+ .PHONY : rector
87+ rector : $(RECTOR_BIN )
88+ $(RECTOR )
89+
90+ .PHONY : rector_lint
91+ rector_lint : $(RECTOR_BIN )
92+ $(RECTOR ) --dry-run
93+
7894vendor : composer.lock
7995 composer install
8096 touch -c $@
@@ -86,3 +102,6 @@ composer.lock: composer.json
86102
87103$(PHPUNIT_BIN ) : vendor
88104 touch -c $@
105+
106+ $(RECTOR_BIN ) :
107+ cd ..; $(MAKE ) --makefile Makefile $@
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /*
6+ * This file is part of the humbug/php-scoper package.
7+ *
8+ * Copyright (c) 2017 Théo FIDRY <[email protected] >, 9+ * Pádraic Brady <[email protected] > 10+ *
11+ * For the full copyright and license information, please view the LICENSE
12+ * file that was distributed with this source code.
13+ */
14+
15+ use Rector \Config \RectorConfig ;
16+ use Rector \PHPUnit \Set \PHPUnitSetList ;
17+ use Rector \Set \ValueObject \LevelSetList ;
18+
19+ return static function (RectorConfig $ rectorConfig ): void {
20+ $ rectorConfig ->paths ([
21+ __DIR__ .'/bin ' ,
22+ __DIR__ .'/src ' ,
23+ __DIR__ .'/tests ' ,
24+ ]);
25+
26+ $ rectorConfig ->autoloadPaths ([
27+ __DIR__ .'/vendor/autoload.php ' ,
28+ __DIR__ .'/../vendor-bin/rector/vendor/autoload.php ' ,
29+ ]);
30+
31+ $ rectorConfig ->importNames ();
32+
33+ $ rectorConfig ->sets ([
34+ LevelSetList::UP_TO_PHP_81 ,
35+ LevelSetList::UP_TO_PHP_82 ,
36+
37+ PHPUnitSetList::PHPUNIT_90 ,
38+ ]);
39+ };
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ protected function getExpectedHelpOutput(): string
4040
4141 [33mcheck_root_version:[0m Checks that the Composer root version is up to date
4242 [33mdump_root_version:[0m Dumps the latest Composer root version
43+ [33mautoreview:[0m Runs the AutoReview checks
4344 [33mcs:[0m Runs the fixers
4445 [33mcs_lint:[0m Runs the linters
4546 [33mtest:[0m Runs the tests
You can’t perform that action at this time.
0 commit comments