Skip to content

Commit 8b9b9ea

Browse files
committed
Merge remote-tracking branch 'origin/master' into whitespace-incompatibility
2 parents dc4c2d9 + 5798f29 commit 8b9b9ea

File tree

96 files changed

+2988
-381
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2988
-381
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,39 @@
22
name: Bug report
33
about: Create a report to help us improve
44
title: ''
5-
labels: ''
5+
labels: ['Status: triage', 'Type: bug']
66
assignees: ''
77

88
---
99

10-
**Describe the bug**
10+
<!--
11+
Before reporting a sniff related bug, please check the error code using `phpcs -s`.
12+
13+
If the error code starts with anything other than `Generic`, `MySource`, `PEAR`,
14+
`PSR1`, `PSR2`, `PSR12`, `Squiz` or `Zend`, the error is likely coming from an
15+
external PHP_CodeSniffer standard.
16+
17+
Please report bugs for externally maintained sniffs to the appropriate external
18+
standard repository (not here).
19+
-->
20+
21+
## Describe the bug
1122
A clear and concise description of what the bug is.
1223

13-
**Code sample**
24+
### Code sample
1425
```php
15-
echo "A short code snippet that can be used to reproduce the bug";
26+
echo "A short code snippet that can be used to reproduce the bug. Do NOT paste screenshots of code!";
1627
```
1728

18-
**Custom ruleset**
29+
### Custom ruleset
1930
```xml
2031
<?xml version="1.0"?>
2132
<ruleset name="My Custom Standard">
2233
<description>If you are using a custom ruleset, please enter it here.</description>
2334
</ruleset>
2435
```
2536

26-
**To reproduce**
37+
### To reproduce
2738
Steps to reproduce the behavior:
2839
1. Create a file called `test.php` with the code sample above...
2940
2. Run `phpcs test.php ...`
@@ -32,14 +43,24 @@ Steps to reproduce the behavior:
3243
PHPCS output here
3344
```
3445

35-
**Expected behavior**
46+
## Expected behavior
3647
A clear and concise description of what you expected to happen.
3748

38-
**Versions (please complete the following information):**
39-
- OS: [e.g., Windows 10, MacOS 10.15]
40-
- PHP: [e.g., 7.2, 7.4]
41-
- PHPCS: [e.g., 3.5.5, master]
42-
- Standard: [e.g., PSR2, PSR12, Squiz]
49+
## Versions (please complete the following information)
4350

44-
**Additional context**
51+
| | |
52+
|-------------------------|------------------------------------------------------------------------------|
53+
| Operating System | [e.g., Windows 10, MacOS 10.15] |
54+
| PHP version | [e.g., 7.2, 7.4] |
55+
| PHP_CodeSniffer version | [e.g., 3.5.5, master] |
56+
| Standard | [e.g., PSR2, PSR12, Squiz, custom] |
57+
| Install type | [e.g. Composer (global/local), PHAR, PEAR, git clone, other (please expand)] |
58+
59+
## Additional context
4560
Add any other context about the problem here.
61+
62+
## Please confirm:
63+
64+
- [ ] I have searched the issue list and am not opening a duplicate issue.
65+
- [ ] I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
66+
- [ ] I have verified the issue still exists in the `master` branch of PHP_CodeSniffer.

.github/pull_request_template.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!-- Provide a general summary of your changes in the title above. -->
2+
3+
<!--
4+
Please target the `master` branch when submitting your pull request, unless your change **only** applies to PHPCS 4.x.
5+
-->
6+
7+
## Description
8+
<!--
9+
What do you want to achieve with this PR? Why did you write this code? What problem does this PR solve?
10+
Describe your changes in detail and, if relevant, explain which choices you have made and why.
11+
-->
12+
13+
14+
### Suggested changelog entry
15+
<!-- Please provide a short description of the change for the changelog. -->
16+
17+
18+
### Related issues/external references
19+
20+
Fixes #
21+
22+
23+
## Types of changes
24+
<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
25+
- [ ] Bug fix _(non-breaking change which fixes an issue)_
26+
- [ ] New feature _(non-breaking change which adds functionality)_
27+
- [ ] Breaking change _(fix or feature that would cause existing functionality to change)_
28+
- [ ] This change is only breaking for integrators, not for external standards or end-users.
29+
- [ ] Documentation improvement
30+
31+
32+
## PR checklist
33+
<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
34+
- [ ] I have checked there is no other PR open for the same change.
35+
- [ ] I have read the [Contribution Guidelines](.github/CONTRIBUTING.md).
36+
- [ ] I grant the project the right to include and distribute the code under the BSD-3-Clause license (and I have the right to grant these rights).
37+
- [ ] I have added tests to cover my changes.
38+
- [ ] I have verified that the code complies with the projects coding standards.
39+
- [ ] [Required for new sniffs] I have added XML documentation for the sniff.
40+
- [ ] [Required for new files] I have added any new files to the `package.xml` file.
41+
42+
<!--
43+
============================================================================================
44+
Please make sure your pull request passes all continuous integration checks!
45+
46+
PRs which are failing their CI checks will likely be ignored by the maintainers.
47+
48+
PRs using atomic, descriptive commits are hugely appreciated as it will make
49+
reviewing your changes easier for the maintainers.
50+
============================================================================================
51+
-->

.github/workflows/manage-labels.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Remove outdated labels
2+
3+
on:
4+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
5+
issues:
6+
types:
7+
- closed
8+
pull_request_target:
9+
types:
10+
- closed
11+
12+
jobs:
13+
on-issue-close:
14+
runs-on: ubuntu-latest
15+
if: github.repository_owner == 'squizlabs' && github.event.issue.state == 'closed'
16+
17+
name: Clean up labels on issue close
18+
19+
steps:
20+
- uses: mondeja/remove-labels-gh-action@v1
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
labels: |
24+
Status: awaiting feedback
25+
Status: close candidate
26+
Status: needs investigation
27+
Status: triage
28+
29+
on-pr-merge:
30+
runs-on: ubuntu-latest
31+
if: github.repository_owner == 'squizlabs' && github.event.pull_request.merged == true
32+
33+
name: Clean up labels on PR merge
34+
35+
steps:
36+
- uses: mondeja/remove-labels-gh-action@v1
37+
with:
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
labels: |
40+
Status: awaiting feedback
41+
Status: close candidate
42+
Status: needs investigation
43+
Status: triage
44+
45+
on-pr-close:
46+
runs-on: ubuntu-latest
47+
if: github.repository_owner == 'squizlabs' && github.event_name == 'pull_request_target' && github.event.pull_request.merged == false
48+
49+
name: Clean up labels on PR close
50+
51+
steps:
52+
- uses: mondeja/remove-labels-gh-action@v1
53+
with:
54+
token: ${{ secrets.GITHUB_TOKEN }}
55+
labels: |
56+
Status: awaiting feedback
57+
Status: close candidate
58+
Status: needs investigation
59+
Status: triage

.github/workflows/phpstan.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ jobs:
3434
# @link https://github.com/marketplace/actions/install-composer-dependencies
3535
- name: Install Composer dependencies
3636
uses: "ramsey/composer-install@v2"
37+
with:
38+
# Bust the cache at least once a month - output format: YYYY-MM.
39+
custom-cache-suffix: $(date -u "+%Y-%m")
3740

3841
- name: Run PHPStan
3942
run: phpstan analyse --configuration=phpstan.neon

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,17 @@ jobs:
117117
- name: Install Composer dependencies - normal
118118
if: ${{ matrix.php < '8.0' }}
119119
uses: "ramsey/composer-install@v2"
120+
with:
121+
# Bust the cache at least once a month - output format: YYYY-MM.
122+
custom-cache-suffix: $(date -u "+%Y-%m")
120123

121124
# For PHP 8.0+, we need to install with ignore platform reqs as PHPUnit 7 is still used.
122125
- name: Install Composer dependencies - with ignore platform
123126
if: ${{ matrix.php >= '8.0' }}
124127
uses: "ramsey/composer-install@v2"
125128
with:
126129
composer-options: --ignore-platform-reqs
130+
custom-cache-suffix: $(date -u "+%Y-%m")
127131

128132
# Note: The code style check is run multiple times against every PHP version
129133
# as it also acts as an integration test.

0 commit comments

Comments
 (0)