wearerequired / traduttore

🗼 A WordPress plugin to improve the I18N workflow for your own projects based on @GlotPress.
https://wearerequired.github.io/traduttore/
72 stars 15 forks source link

Update coding standards to use the Required ruleset #153

Closed ocean90 closed 4 years ago

ocean90 commented 5 years ago

https://github.com/wearerequired/traduttore/blob/master/phpcs.xml.dist should be changed to use https://github.com/wearerequired/coding-standards.

ocean90 commented 5 years ago
composer run lint
> vendor/bin/phpcs --report-summary --report-source .
EEEEWEEEEEEEEEEEE 17 / 17 (100%)

PHP CODE SNIFFER REPORT SUMMARY
----------------------------------------------------------------------
FILE                                                  ERRORS  WARNINGS
----------------------------------------------------------------------
...rdpress/content/plugins/traduttore/traduttore.php  0       2
.../content/plugins/traduttore/inc/Configuration.php  3       0
...rdpress/content/plugins/traduttore/inc/Export.php  5       0
...rdpress/content/plugins/traduttore/inc/Loader.php  5       0
.../content/plugins/traduttore/inc/LoaderFactory.php  4       0
...rdpress/content/plugins/traduttore/inc/Plugin.php  21      1
...dpress/content/plugins/traduttore/inc/Project.php  5       0
...content/plugins/traduttore/inc/ProjectLocator.php  15      0
...ess/content/plugins/traduttore/inc/Repository.php  11      0
...tent/plugins/traduttore/inc/RepositoryFactory.php  6       0
...rdpress/content/plugins/traduttore/inc/Runner.php  5       0
...nt/plugins/traduttore/inc/TranslationApiRoute.php  1       0
...dpress/content/plugins/traduttore/inc/Updater.php  13      1
...content/plugins/traduttore/inc/WebhookHandler.php  3       0
.../plugins/traduttore/inc/WebhookHandlerFactory.php  6       0
...ss/content/plugins/traduttore/inc/ZipProvider.php  17      0
...ntent/plugins/traduttore/inc/CLI/CacheCommand.php  2       0
...ontent/plugins/traduttore/inc/CLI/InfoCommand.php  1       5
...lugins/traduttore/inc/CLI/LanguagePackCommand.php  3       0
...ent/plugins/traduttore/inc/CLI/ProjectCommand.php  3       1
...ss/content/plugins/traduttore/inc/Loader/Base.php  3       0
...ess/content/plugins/traduttore/inc/Loader/Git.php  6       3
...ntent/plugins/traduttore/inc/Loader/Mercurial.php  2       3
...tent/plugins/traduttore/inc/Loader/Subversion.php  3       3
...ontent/plugins/traduttore/inc/Repository/Base.php  8       0
...t/plugins/traduttore/inc/Repository/Bitbucket.php  5       0
...tent/plugins/traduttore/inc/Repository/GitHub.php  2       0
...tent/plugins/traduttore/inc/Repository/GitLab.php  2       0
...nt/plugins/traduttore/inc/WebhookHandler/Base.php  6       0
...ugins/traduttore/inc/WebhookHandler/Bitbucket.php  2       0
.../plugins/traduttore/inc/WebhookHandler/GitHub.php  2       0
.../plugins/traduttore/inc/WebhookHandler/GitLab.php  2       0
----------------------------------------------------------------------
A TOTAL OF 172 ERRORS AND 19 WARNINGS WERE FOUND IN 32 FILES
----------------------------------------------------------------------
PHPCBF CAN FIX 161 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 672ms; Memory: 12MB

PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
----------------------------------------------------------------------
    SOURCE                                                       COUNT
----------------------------------------------------------------------
[x] SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameIn  92
[x] SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing.Whit  42
[ ] WordPress.PHP.DiscouragedPHPFunctions.system_calls_exec      14
[x] SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing.NoSp  9
[x] SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing.Whit  9
[ ] SlevomatCodingStandard.Namespaces.DisallowGroupUse.Disallow  5
[ ] SlevomatCodingStandard.Namespaces.MultipleUsesPerLine.Multi  5
[x] SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.  3
[ ] WordPress.WP.AlternativeFunctions.json_encode_json_encode    2
[x] Generic.Arrays.DisallowLongArraySyntax.Found                 1
[x] Generic.PHP.LowerCaseType.ReturnTypeFound                    1
[ ] PSR1.Files.SideEffects.FoundWithSymbols                      1
[x] SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBacksl  1
[x] SlevomatCodingStandard.Namespaces.UseFromSameNamespace.UseF  1
[x] SlevomatCodingStandard.Namespaces.UseSpacing.IncorrectLines  1
[x] SlevomatCodingStandard.TypeHints.NullableTypeForNullDefault  1
[ ] VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariab  1
[ ] WordPress.DB.PreparedSQL.InterpolatedNotPrepared             1
[ ] WordPress.PHP.DevelopmentFunctions.error_log_trigger_error   1
----------------------------------------------------------------------
A TOTAL OF 191 SNIFF VIOLATIONS WERE FOUND IN 19 SOURCES
----------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SOURCES AUTOMATICALLY (161 VIOLATIONS IN TOTAL)
----------------------------------------------------------------------