Skip to content

Commit

Permalink
Merge pull request #13344 from nextcloud/feat/noid/add-rector
Browse files Browse the repository at this point in the history
🤖 techdebt: Add PHP rector
  • Loading branch information
nickvergessen authored Oct 9, 2024
2 parents 805ec3f + 749bcea commit 930d3f9
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ updates:
- "/vendor-bin/mozart"
- "/vendor-bin/phpunit"
- "/vendor-bin/psalm"
- "/vendor-bin/rector"
commit-message:
prefix: "ci"
include: "scope"
Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"cs:fix": "php-cs-fixer fix",
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './lib/Vendor/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -print0 | xargs -0 -n1 php -l",
"openapi": "generate-spec --verbose && (npm run typescript:generate || echo 'Please manually regenerate the typescript OpenAPI models')",
"rector:check": "rector --dry-run",
"rector:fix": "rector",
"psalm": "psalm --threads=1",
"psalm:dev": "psalm --no-cache --threads=$(nproc)",
"psalm:update-baseline": "psalm --threads=1 --update-baseline --set-baseline=tests/psalm-baseline.xml",
Expand Down
24 changes: 24 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

use Nextcloud\Rector\Set\NextcloudSets;
use Rector\Config\RectorConfig;

return RectorConfig::configure()
->withPaths([
__DIR__ . '/appinfo',
__DIR__ . '/lib',
__DIR__ . '/templates',
__DIR__ . '/tests/php',
])
->withSkipPath(__DIR__ . '/lib/Vendor')
->withPhpSets(php73: true)
->withSets([
NextcloudSets::NEXTCLOUD_27,
])
->withTypeCoverageLevel(0);
2 changes: 1 addition & 1 deletion templates/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

script('spreed', 'talk-main');
\OCP\Util::addScript('spreed', 'talk-main');
style('spreed', 'icons');
2 changes: 1 addition & 1 deletion templates/recording.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

script('spreed', 'talk-recording');
\OCP\Util::addScript('spreed', 'talk-recording');
style('spreed', 'icons');
6 changes: 6 additions & 0 deletions vendor-bin/rector/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"require-dev": {
"rector/rector": "^1.2.0",
"nextcloud/rector": "^0.2.1"
}
}
198 changes: 198 additions & 0 deletions vendor-bin/rector/composer.lock

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

0 comments on commit 930d3f9

Please sign in to comment.