Skip to content

Commit

Permalink
Prepare more tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
lochmueller committed Mar 24, 2021
1 parent 250406d commit 55616d4
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 61 deletions.
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Contribution

Pull Requests are always welcome! Please don't forget to add an issue and connect it to your pull requests. This is very helpful to understand what kind of issue the PR is going to solve.

Bugfixes: Please describe what kind of bug your fix solve and give us feedback how to reproduce the issue. We're going to accept only bugfixes if we can reproduce the issue.

Features: Please create a issue first and describe the feature!

## Code Checks

The extension use PHP CS Fixer & PHP Unit in tooling. Please run "composer code" or equivalent to execute PHP CS Fixer and the tests in front of the commit!

More tooling will be added shortly.
2 changes: 1 addition & 1 deletion Classes/Form/Element/CalendarizeInfoElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function render()
/**
* Get event list.
*
* @param $events
* @param array $events
*
* @return string
*/
Expand Down
6 changes: 3 additions & 3 deletions Classes/Hooks/ProcessCmdmapClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class ProcessCmdmapClass extends AbstractHook
* @param string $command
* @param string $table
* @param int $uid
* @param $value
* @param mixed $value
* @param DataHandler $handler
* @param $pasteUpdate
* @param $pasteDatamap
* @param mixed $pasteUpdate
* @param mixed $pasteDatamap
*/
public function processCmdmap_postProcess($command, $table, $uid, $value, $handler, $pasteUpdate, $pasteDatamap)
{
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@
Thank you for support and sponsoring the extension:

- [All contributors](https://github.com/lochmueller/calendarize/graphs/contributors)!

## Contribution

Check CONTRIBUTING.md file!
39 changes: 39 additions & 0 deletions Resources/Private/Build/Rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

declare(strict_types=1);

use Rector\Core\Configuration\Option;
use Rector\Core\ValueObject\PhpVersion;
use Rector\PostRector\Rector\NameImportingPostRector;
use Ssch\TYPO3Rector\Configuration\Typo3Option;
use Ssch\TYPO3Rector\Set\Typo3SetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();

$parameters->set(Option::SETS, [
Typo3SetList::TYPO3_104,
Typo3SetList::TYPO3_11,
]);

$parameters->set(Option::AUTO_IMPORT_NAMES, true);
$parameters->set(Option::IMPORT_SHORT_CLASSES, false);
$parameters->set(Option::IMPORT_DOC_BLOCKS, false);
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_73);
$parameters->set(Typo3Option::OUTPUT_CHANGELOG, true);

$parameters->set(Option::SKIP, [
NameImportingPostRector::class => [
'ClassAliasMap.php',
'ext_localconf.php',
'ext_emconf.php',
'ext_tables.php',
__DIR__ . '/**/TCA/*',
__DIR__ . '/**/Configuration/RequestMiddlewares.php',
__DIR__ . '/**/Configuration/Commands.php',
__DIR__ . '/**/Configuration/AjaxRoutes.php',
__DIR__ . '/**/Configuration/Extbase/Persistence/Classes.php',
],
]);
};
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"squizlabs/php_codesniffer": "^2.6",
"friendsofphp/php-cs-fixer": "^2.16",
"phpmd/phpmd": "^2.4",
"scrutinizer/ocular": "^1.3"
"scrutinizer/ocular": "^1.3",
"phpstan/phpstan": "^0.12.82"
},
"config": {
"vendor-dir": ".Build/vendor",
Expand Down Expand Up @@ -85,6 +86,12 @@
],
"tool:phpdoc": [
"docker run --rm -v $(pwd):/data phpdoc/phpdoc -d Classes -t .Build/phpdoc"
],
"tool:rector": [
"docker run --rm --volume $PWD:/app --user $(id -u):$(id -g) ghcr.io/sabbelasichon/typo3-rector process --config=Resources/Private/Build/Rector.php"
],
"tool:phpstan": [
"phpstan analyse -c phpstan.neon"
]
}
}
117 changes: 61 additions & 56 deletions composer.lock

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

5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: 1
paths:
- Classes
- Tests

0 comments on commit 55616d4

Please sign in to comment.