tools: various updates
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/877/head
parent
d8c6266e53
commit
e255c957f7
|
@ -43,4 +43,4 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cd apps/memories
|
cd apps/memories
|
||||||
make install-tools
|
make install-tools
|
||||||
vendor/bin/psalm --no-cache --shepherd --stats --threads=4
|
vendor/bin/psalm --no-cache --shepherd --stats --threads=4 lib
|
||||||
|
|
|
@ -15,21 +15,14 @@ declare(strict_types=1);
|
||||||
$finder = PhpCsFixer\Finder::create()
|
$finder = PhpCsFixer\Finder::create()
|
||||||
->ignoreDotFiles(false)
|
->ignoreDotFiles(false)
|
||||||
->ignoreVCSIgnored(true)
|
->ignoreVCSIgnored(true)
|
||||||
->exclude('tests/Fixtures')
|
->in(__DIR__.'/lib')
|
||||||
->in(__DIR__)
|
|
||||||
->append([
|
|
||||||
__DIR__.'/dev-tools/doc.php',
|
|
||||||
// __DIR__.'/php-cs-fixer', disabled, as we want to be able to run bootstrap file even on lower PHP version, to show nice message
|
|
||||||
])
|
|
||||||
;
|
;
|
||||||
|
|
||||||
$config = new PhpCsFixer\Config();
|
$config = new PhpCsFixer\Config();
|
||||||
$config
|
$config
|
||||||
|
->setUsingCache(true)
|
||||||
->setRiskyAllowed(true)
|
->setRiskyAllowed(true)
|
||||||
->setRules([
|
->setRules([
|
||||||
'@PHP71Migration' => false,
|
|
||||||
'@PHP71Migration:risky' => false,
|
|
||||||
'@PHPUnit75Migration:risky' => true,
|
|
||||||
'@PhpCsFixer' => true,
|
'@PhpCsFixer' => true,
|
||||||
'@PhpCsFixer:risky' => true,
|
'@PhpCsFixer:risky' => true,
|
||||||
'general_phpdoc_annotation_remove' => ['annotations' => ['expectedDeprecation']], // one should use PHPUnit built-in method instead
|
'general_phpdoc_annotation_remove' => ['annotations' => ['expectedDeprecation']], // one should use PHPUnit built-in method instead
|
||||||
|
@ -39,21 +32,4 @@ $config
|
||||||
->setFinder($finder)
|
->setFinder($finder)
|
||||||
;
|
;
|
||||||
|
|
||||||
// special handling of fabbot.io service if it's using too old PHP CS Fixer version
|
|
||||||
if (false !== getenv('FABBOT_IO')) {
|
|
||||||
try {
|
|
||||||
PhpCsFixer\FixerFactory::create()
|
|
||||||
->registerBuiltInFixers()
|
|
||||||
->registerCustomFixers($config->getCustomFixers())
|
|
||||||
->useRuleSet(new PhpCsFixer\RuleSet($config->getRules()))
|
|
||||||
;
|
|
||||||
} catch (PhpCsFixer\ConfigurationException\InvalidConfigurationException $e) {
|
|
||||||
$config->setRules([]);
|
|
||||||
} catch (UnexpectedValueException $e) {
|
|
||||||
$config->setRules([]);
|
|
||||||
} catch (InvalidArgumentException $e) {
|
|
||||||
$config->setRules([]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $config;
|
return $config;
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"intelephense.environment.phpVersion": "7.4.0",
|
|
||||||
"intelephense.stubs": [
|
"intelephense.stubs": [
|
||||||
"apache",
|
"apache",
|
||||||
"bcmath",
|
"bcmath",
|
||||||
|
@ -75,8 +74,19 @@
|
||||||
"zlib",
|
"zlib",
|
||||||
"imagick"
|
"imagick"
|
||||||
],
|
],
|
||||||
|
"intelephense.environment.phpVersion": "8.0.0",
|
||||||
|
"intelephense.environment.documentRoot": "${workspaceFolder}/../../",
|
||||||
|
"php-cs-fixer.allow-risky": true,
|
||||||
|
"psalm.disableAutoComplete": true,
|
||||||
"[php]": {
|
"[php]": {
|
||||||
"editor.formatOnSave": false
|
"editor.defaultFormatter": "muuvmuuv.vscode-just-php-cs-fixer"
|
||||||
|
},
|
||||||
|
"[vue]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"vetur.experimental.templateInterpolationService": true,
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
},
|
},
|
||||||
"[markdown]": {
|
"[markdown]": {
|
||||||
"files.trimTrailingWhitespace": false
|
"files.trimTrailingWhitespace": false
|
||||||
|
@ -87,6 +97,5 @@
|
||||||
"**/patches": true
|
"**/patches": true
|
||||||
},
|
},
|
||||||
"git.alwaysSignOff": true,
|
"git.alwaysSignOff": true,
|
||||||
"intelephense.environment.documentRoot": "/var/www/html",
|
"editor.formatOnSave": true,
|
||||||
"editor.formatOnSave": true
|
|
||||||
}
|
}
|
4
Makefile
4
Makefile
|
@ -10,10 +10,10 @@ install-tools:
|
||||||
composer install
|
composer install
|
||||||
|
|
||||||
php-lint:
|
php-lint:
|
||||||
vendor/bin/php-cs-fixer fix lib
|
vendor/bin/php-cs-fixer fix
|
||||||
|
|
||||||
psalm:
|
psalm:
|
||||||
vendor/bin/psalm
|
vendor/bin/psalm lib
|
||||||
|
|
||||||
npm-init:
|
npm-init:
|
||||||
npm ci
|
npm ci
|
||||||
|
|
|
@ -52,9 +52,14 @@ Memories is a _batteries-included_ photo management solution for Nextcloud with
|
||||||
1. ☁ Clone this into your `custom_apps` folder of your Nextcloud.
|
1. ☁ Clone this into your `custom_apps` folder of your Nextcloud.
|
||||||
1. 📥 Install [Composer](https://getcomposer.org/) and [Node.js 18](https://nodejs.org)
|
1. 📥 Install [Composer](https://getcomposer.org/) and [Node.js 18](https://nodejs.org)
|
||||||
1. 👩💻 In a terminal, run the command `make dev-setup` to install the dependencies.
|
1. 👩💻 In a terminal, run the command `make dev-setup` to install the dependencies.
|
||||||
1. 🏗 To build/watch the UI, run `make watch-js`. Lint-fix PHP with `make php-lint`.
|
1. 🏗 To build/watch the UI, run `make watch-js`.
|
||||||
1. ✅ Enable the app through the app management of your Nextcloud.
|
1. ✅ Enable the app through the app management of your Nextcloud.
|
||||||
1. ⚒️ (Strongly recommended) use VS Code and install Vetur and Prettier.
|
1. ⚒️ (Strongly recommended) use VS Code for development and install these extensions.
|
||||||
|
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode): For autoformatting Vue and Typescript
|
||||||
|
- [PHP Intelephense](https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client): For PHP intellisense and static analysis
|
||||||
|
- [PHP-CS-Fixer](https://marketplace.visualstudio.com/items?itemName=muuvmuuv.vscode-just-php-cs-fixer): For PHP formatting (alternatively, `make php-cs-fixer`)
|
||||||
|
- [Psalm](https://marketplace.visualstudio.com/items?itemName=getpsalm.psalm-vscode-plugin): For PHP static analysis (alternatively, `make psalm`)
|
||||||
|
- [Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur): For Vue intellisense and static analysis
|
||||||
|
|
||||||
## 🤝 Support the project
|
## 🤝 Support the project
|
||||||
|
|
||||||
|
|
20
psalm.xml
20
psalm.xml
|
@ -6,14 +6,25 @@
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns="https://getpsalm.org/schema/config"
|
xmlns="https://getpsalm.org/schema/config"
|
||||||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
||||||
|
cacheDirectory=".cache/psalm"
|
||||||
>
|
>
|
||||||
<projectFiles>
|
<projectFiles>
|
||||||
<directory name="lib" />
|
<directory name="lib" />
|
||||||
<ignoreFiles>
|
|
||||||
<!-- Careful to not exclude ourselves! -->
|
<!--
|
||||||
|
Duplication is due to differences in language server and CLI
|
||||||
|
The CLI needs the files in extraFiles since we specify lib as
|
||||||
|
the scan directory. The language server needs the files in
|
||||||
|
projectFiles since it doesn't seem to support extraFiles.
|
||||||
|
-->
|
||||||
<directory name="../../lib" />
|
<directory name="../../lib" />
|
||||||
<directory name="../../apps/files" />
|
<directory name="../../apps/files/lib/Event" />
|
||||||
<directory name="../../3rdparty" />
|
<directory name="../../3rdparty/doctrine" />
|
||||||
|
<directory name="../../3rdparty/psr" />
|
||||||
|
<directory name="../../3rdparty/guzzlehttp" />
|
||||||
|
|
||||||
|
<ignoreFiles>
|
||||||
|
<directory name="vendor" />
|
||||||
</ignoreFiles>
|
</ignoreFiles>
|
||||||
</projectFiles>
|
</projectFiles>
|
||||||
<extraFiles>
|
<extraFiles>
|
||||||
|
@ -22,7 +33,6 @@
|
||||||
<directory name="../../3rdparty/doctrine" />
|
<directory name="../../3rdparty/doctrine" />
|
||||||
<directory name="../../3rdparty/psr" />
|
<directory name="../../3rdparty/psr" />
|
||||||
<directory name="../../3rdparty/guzzlehttp" />
|
<directory name="../../3rdparty/guzzlehttp" />
|
||||||
<directory name="../../3rdparty/doctrine" />
|
|
||||||
</extraFiles>
|
</extraFiles>
|
||||||
<issueHandlers>
|
<issueHandlers>
|
||||||
<UndefinedDocblockClass>
|
<UndefinedDocblockClass>
|
||||||
|
|
Loading…
Reference in New Issue