Commit Graph

317 Commits

Author SHA1 Message Date
Rodrigo Primo
ec18076f71 Combine PHPStan config files into one
Before this commit, we had two different PHPStan configuration files. One
for the lib directory (phpstan.neon) and another one for the tests directory
(phpstan-tests.neon). This commit combines both files into one
(phpstan.neon) to make it easier to maintain and make changes to PHPStan
configurations.

As part of this process, it was necessary to change the Robo command
`./do qa:phpstan` to call PHPStan only once and to
combine php-version-dependent-config-tests.php and
php-version-dependent-config-libs.php in a new file called
php-version-dependent-config.php.

Another benefit of this change is that running PHPStan only once with a
single configuration file means that it runs about 20% faster than
the previous setup.

[MAILPOET-4024]
2021-12-16 11:36:24 +01:00
Jan Jakes
cb5363b143 Remove JS makepot tooling 2021-12-13 12:52:15 +01:00
Jan Jakes
7db9a82c4e Move PHP makepot tools up to tasks/mailpot 2021-12-13 12:52:15 +01:00
Jan Jakes
2afec666b7 Make POT file output closer to previous state 2021-12-13 12:52:15 +01:00
Rostislav Wolny
df6a955f0c Fix deprecation warnings coming from pQuery library
[MAILPOET-3980]
2021-12-13 09:36:43 +01:00
Jan Jakes
f4656f5d89 Make pot file name configurable 2021-12-07 14:32:05 +01:00
Jan Jakes
f6e1c0c101 Use early return in makepot.js 2021-12-07 14:32:05 +01:00
Jan Jakes
527224f755 Remove specific file exclusions from PHP_CodeSniffer config 2021-12-06 12:56:48 +01:00
Jan Jakes
b535594bc1 Set PHP_CodeSniffer ruleset paths relative to its install
This allows running the ruleset from different directories than the free plugin.
See: https://github.com/squizlabs/PHP_CodeSniffer/issues/2764#issuecomment-856677915
2021-12-06 12:56:48 +01:00
Rostislav Wolny
54414b4174 Add WooCommercePackages stubs to PHPStan
I had to move loading those stubs to bootstrap files because it was not able to load the class
when placed in scanFiles.
Note this is also recommended in documentation https://github.com/php-stubs/woocommerce-stubs
[MAILPOET-3920]
2021-11-24 13:00:10 +01:00
Rostislav Wolny
3b061e5f9b Fix TypeScript errors coming from multiple versions of types/react
[MAILPOET-3920]
2021-11-24 13:00:10 +01:00
Pavel Dohnal
652fa9ce80 Add a check if translations are ready
[MAILPOET-3807]
2021-11-10 09:43:22 +01:00
Pavel Dohnal
eda7a74f25 Remove the http client from constructor
[MAILPOET-3807]
2021-11-10 09:43:22 +01:00
Pavel Dohnal
70c9583296 Prepare translations before the release
[MAILPOET-3806]
2021-11-03 13:36:21 +01:00
Rostislav Wolny
c8ce0d96ac Update PHPStan packages
[MAILPOET-3889]
2021-10-28 15:44:18 +02:00
Rostislav Wolny
64b591f70b Update php code sniffer packages
[MAILPOER-3889]
2021-10-28 15:44:18 +02:00
wxa
d6cdbc844d Improve latest release version detection
[MAILPOET-3825]
2021-10-18 11:07:08 +02:00
Pavel Dohnal
a7153d71b6 Fix script to prevent multiple var statements
[MAILPOET-3724]
2021-09-27 16:11:42 +02:00
Rostislav Wolny
85c4aa7aa1 Remove unnecessary post-instal fix for invalid CSS
The issue was already fixed in the @wordpress/block-editor
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Rostislav Wolny
6a1344d3e2 Fix strict mode errors in Backbone.Supermodel
[MAILPOET-3214]
2021-09-22 11:56:49 +02:00
Pavel Dohnal
ec86e742c2 Fix coding standards
[MAILPOET-3732]
2021-09-17 12:17:36 +02:00
Pavel Dohnal
21839fc30b Fix indentation of multiline function declarations
[MAILPOET-3732]
2021-09-17 12:17:36 +02:00
Pavel Dohnal
cdda3480ca Make all constructor signatures multiline
[MAILPOET-3732]
2021-09-16 14:19:40 +02:00
Pavel Dohnal
150862d986 Add a rule to enforce multiline constructors
[MAILPOET-3732]
2021-09-16 14:19:40 +02:00
Jan Lysý
3ede4366b6 Update phpstan dependencies
[MAILPOET-3725]
2021-08-16 15:56:39 +02:00
Jan Lysý
42a3d01b77 Update CodeSniffer dependencies
[MAILPOET-3725]
2021-08-16 15:56:39 +02:00
Rodrigo Primo
8513a4d986 Fix checkMissingTypehint PHPStan errors
This commit removes the checkMissingTypehints flag
from PHPStan configuration files and fixes all associated errors in our
code base.

[MAILPOET-3236]
2021-08-09 12:58:56 +02:00
Rodrigo Primo
e59992cc16 Fix checkGenericClassInNonGenericObjectType PHPStan errors
This commit removes the checkGenericClassInNonGenericObjectType flag
from PHPStan configuration files and fixes all associated errors in our
code base.

[MAILPOET-3236]
2021-08-09 12:58:56 +02:00
Rodrigo Primo
f0dc0b3556 Stop excluding the PHPStan checkMissingTypehints error
This check doesn't produce any errors so we don't need to exclude it
from our checks. Note that this only removes the exclusion of this error
from phpstan.neon. The same error check is kept in phpstan-tests.neon as
there are some change that we need to make to two tests before being
able to update this file as well.

[MAILPOET-3236]
2021-08-09 12:58:56 +02:00
Rodrigo Primo
30b4b3e073 Stop excluding the PHPStan checkMissingVarTagTypehint error
This check doesn't produce any errors so we don't need to exclude it
from our checks.

[MAILPOET-3236]
2021-08-09 12:58:56 +02:00
Rostislav Wolny
7a3ffa388f Update PHPStan
[MAILPOET-3658]
2021-07-06 13:29:00 +02:00
Rostislav Wolny
8e0cbc9626 Remove deprecated rule from code sniffer
See bcbf756f05 (diff-0816e9a78035205a67cca7c38cb5c4870365492c7179ab30115a274a583ef0e5)
[MAILPOET-3658]
2021-07-06 13:29:00 +02:00
Rostislav Wolny
65b834a9ff Update renamed NotCamelCaps rule
[MAILPOET-3658]
2021-07-06 13:29:00 +02:00
Rostislav Wolny
76fe9082a3 Update php code sniffer packages
[MAILPOET-3658]
2021-07-06 13:29:00 +02:00
Jan Lysý
8d716a0ec8 Add replacing invalid CSS from form-editor to postinstall script
[MAILPOET-3634]
2021-05-26 15:25:53 +02:00
Rostislav Wolny
c55d4f06be Check for more filename variants when downloading release zip
[MAILPOET-3482]
2021-04-26 13:47:41 +02:00
Rostislav Wolny
e02980e0f9 Add meta info with version along side the downloaded plugin
[MAILPOET-3482]
2021-04-26 13:47:41 +02:00
Rostislav Wolny
44f1269916 Change plugins download directory
[MAILPOET-3482]
2021-04-26 13:47:41 +02:00
Rostislav Wolny
ff806859cb Add robo command for downloading WooCommerce
[MAILPOET-3482]
2021-04-26 13:47:41 +02:00
Pavel Dohnal
bf7c4e6b58 Add PHP_CodeSniffer Standards Composer Installer Plugin 2021-04-23 11:13:38 +02:00
Rostislav Wolny
726cbf4679 Configure Woo Subscriptions versions for Circle CI
[MAILPOET-3471]
2021-04-20 15:51:09 +02:00
Rostislav Wolny
120baeeb00 Add WooCommerceSubscriptions factory to tests
[MAILPOET-3471]
2021-04-20 15:51:09 +02:00
Rostislav Wolny
6c2d428355 Add simple Github client for downloading release assets
[MAILPOET-3471]
2021-04-20 15:51:09 +02:00
Rodrigo Primo
8c4805cd0a Update pattern to ignore PHPStan error
Since we updated to PHPStan 0.12.83 we started getting the error bellow.
It seems this happened because the message of an error that we were
already ignoring was changed. This commit simply updates the pattern we
use to ignore the error to reflect the change in the new PHPStan
version.

```
 ------ ---------------------------------------------------------------------
  Line   lib/Features/FeatureFlagsController.php
 ------ ---------------------------------------------------------------------
         Ignored error pattern #^Cannot access offset \(int\|string\) on
         array\|false# in path
         /home/circleci/mailpoet/lib/Features/FeatureFlagsController.php was
         not matched in reported errors.
  44     Cannot access offset (int|string) on array<string,
         MailPoet\Entities\FeatureFlagEntity>|false.
 ------ ---------------------------------------------------------------------
```

[MAILPOET-3491]
2021-04-12 08:55:14 +02:00
Rodrigo Primo
0f6d7a5627 Update PHPStan to 0.12.83
[MAILPOET-3491]
2021-04-12 08:55:14 +02:00
Jan Lysý
a9745eeec0 Add sort versions from Jira by release date
[MAILPOET-3510]
2021-03-23 15:59:00 +01:00
wxa
be320ad995 Update parsleyjs [MAILPOET-3386]
Note: deferred.pipe() fix is not implemented yet, see https://github.com/guillaumepotier/Parsley.js/pull/1347
2021-03-03 14:59:54 +01:00
wxa
7423a618e2 Update spectrum-colorpicker [MAILPOET-3386]
The deprecated jQuery methods are fixed in GitHub, but not in npm,
so I've decided to apply a patch from the repo until it gets released.
2021-03-03 14:59:54 +01:00
Rodrigo Primo
70138089d7 PHPCS: set the supported PHP versions in the ruleset file
This commit moves the definition of the supported PHP versions from
RoboFile.php file to the PHPCS configuration file, ruleset.xml. This
should make it easier to configure PHPCS in other places like the IDE.

I also removed the constraint of the highest supported PHP version
(previously, it was hard-coded to 8.0) as I believe we support new PHP
versions as soon as they are released. With this change, we don't need to
remember to update testVersion tag whenever there is a new PHP version.

[MAILPOET-3439]
2021-02-22 15:31:56 +03:00
Jan Lysý
1999c02e3d Check if file is renamed in fix-phpunit.php
[MAILPOET-3395]
2021-02-04 17:58:42 +01:00