Automattic / Automattic/VIP-Coding-Standards

Adding WordPress-VIP-Go ruleset suppresses many warnings

Đang mở
#441 13 bình luận 0 reaction 1 người được giao Được giao cho @rebeccahum Xem trên GitHub
Ngôn ngữ chính
PHP
Star
261
Fork
44
Merge trung bình
19 phút
Pull request đã merge (30 ngày)
1

Mô tả

## Bug Description

Adding the `WordPress-VIP-Go` ruleset suppresses many warning from `WordPress-Core`, including `StrictComparisons.LooseComparison`.

Sample file (test.php)
```php


```

Output:
```
$ vendor/bin/phpcs test.php
W 1 / 1 (100%)
```

Example ruleset:
```

```

Output:
```
$ vendor/bin/phpcs test.php
W 1 / 1 (100%)

FILE: test.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
2 | WARNING | Found: ==. Use strict comparisons (=== or !==).
| | (WordPress.PHP.StrictComparisons.LooseComparison)
-----------------------------------------------------------------------------------------------------------------

Time: 268ms; Memory: 8MB
```

## Environment

| Question | Answer
| ------------------------| -------
| PHP version | 7.3.3
| PHP_CodeSniffer version | 3.4.2
| VIPCS version | 2.0.0

## Additional Context (optional)

The problem seems to be this commit: https://github.com/Automattic/VIP-Coding-Standards/commit/b8c5b767e96d32bbfa096a2d9e07f7db382737d9

Setting `` to 3 results in no output. Setting it to 5 results in the expected output.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.