-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update README to reflect dennis-i18n workspace package details
- Loading branch information
Showing
1 changed file
with
7 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,25 @@ | ||
# About | ||
|
||
This image provides the most recent [rector](https://github.com/rectorphp/rector) in a docker image. | ||
This package provides the most recent [dennis](https://github.com/mozilla/dennis) pot/po linter in a docker image. | ||
|
||
## Why ? | ||
|
||
I needed a way to provide [rector](https://github.com/rectorphp/rector) on demand and cross platform (Linux/maxOS/Windows). | ||
I needed a way to provide [dennis](https://github.com/mozilla/dennis) on demand and cross platform (Linux/maxOS/Windows). | ||
|
||
=> That's exactly what a Docker image can do :-) | ||
|
||
# Usage | ||
|
||
@TODO: add usage documentation | ||
|
||
See [rector](https://github.com/rectorphp/rector) homepage for all options. | ||
See [dennis](https://github.com/mozilla/dennis) homepage for all options. | ||
|
||
# Snippets | ||
|
||
- jump into docker image using bash : `docker run -q -it --rm --user "$(id -u $USER):$(id -g $USER)" --entrypoint /bin/sh ionos-wordpress/rector-php` | ||
- show pot/po status for a specific folder : `docker run -it --rm -v $(pwd):/project ionos-wordpress/dennis-i18n status packages/wp-plugin/test-plugin/languages/ packages/wp-plugin/essentials/languages/` | ||
|
||
- show [rector](https://github.com/rectorphp/rector) version : `docker run -q -it --rm --user "$(id -u $USER):$(id -g $USER)" ionos-wordpress/rector-php --version` | ||
- show pot/po status for a specific file : `docker run -it --rm -v $(pwd):/project ionos-wordpress/dennis-i18n status packages/wp-plugin/test-plugin/languages/ packages/wp-plugin/essentials/languages/wp-plugin.pot` (last argument can also be a po file) | ||
|
||
## Example usage | ||
- lint a folder containaing pot/po files : `docker run -it --rm -v $(pwd):/project ionos-wordpress/dennis-i18n lint packages/wp-plugin/test-plugin/languages/ packages/wp-plugin/essentials/languages/` (last argument can also be a po file) | ||
|
||
Create a file `rector.php` in your project root directory with the following content: | ||
|
||
```php | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Config\RectorConfig; | ||
|
||
return RectorConfig::configure() | ||
->withSkip([ | ||
__DIR__ . '/dist/vendor', | ||
__DIR__ . '/dist/languages', | ||
]) | ||
->withParallel() | ||
// see https://github.com/rectorphp/rector-src/blob/3ed476b9ab65958d85416e48a810b11dbaf4283a/build/config/config-downgrade.php | ||
//->withPHPStanConfigs([__DIR__ . '/phpstan-for-downgrade.neon']) | ||
|
||
//->withPhpVersion(PhpVersion::PHP_83) | ||
|
||
-> withPreparedSets( | ||
// deadCode: true, | ||
// codeQuality: true, | ||
// codingStyle: true, | ||
// typeDeclarations: true, | ||
// privatization: true, | ||
// naming: true, | ||
// instanceOf: true, | ||
// earlyReturn: true, | ||
// strictBooleans: true, | ||
// carbon: true, | ||
// rectorPreset: true, | ||
// phpunitCodeQuality: true, | ||
// doctrineCodeQuality: true, | ||
// symfonyCodeQuality: true, | ||
// symfonyConfigs: true, | ||
// // composer based | ||
// twig: true, | ||
// phpunit: true, | ||
) | ||
|
||
// downgrade php code to php 7.4 | ||
->withDowngradeSets( | ||
php74: true, | ||
); | ||
``` | ||
|
||
and call | ||
|
||
```bash | ||
docker run -q -it --rm --user "$(id -u $USER):$(id -g $USER)" -v $(pwd):/project ionos-wordpress/rector-php | ||
``` | ||
|
||
to get your project checked against the configured coding standard. | ||
- show [dennis](https://github.com/mozilla/dennis) version : `docker run -q -it --rm --user "$(id -u $USER):$(id -g $USER)" ionos-wordpress/rector-php --version` |