Skip to content

Commit f5b1414

Browse files
committed
Merge branch '4.x' of https://github.com/filips123/PHP_CodeSniffer_New into short-type-hints
2 parents 87a6ef3 + 8b1c267 commit f5b1414

File tree

2,193 files changed

+136635
-68450
lines changed

Some content is hidden

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

2,193 files changed

+136635
-68450
lines changed

.cspell.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"dictionaries": ["php"],
44
"allowCompoundWords": true,
55
"ignorePaths": [
6-
"src/Standards/*/Tests/*/*.{inc,js,css}",
7-
"src/Standards/*/Tests/*/*.{inc,js,css}.fixed"
6+
"src/Standards/*/Tests/*/*.inc",
7+
"src/Standards/*/Tests/*/*.inc.fixed"
88
],
99
"ignoreRegExpList": ["email", "^\\s+\\*\\s+@(author|copyright)\\s+.*$"],
1010
"words": [
@@ -28,9 +28,7 @@
2828
"dnumber",
2929
"docblock",
3030
"encapsed",
31-
"gjslint",
3231
"groupid",
33-
"gsjlint",
3432
"hashbang",
3533
"heredoc",
3634
"hgblame",
@@ -43,6 +41,7 @@
4341
"mins",
4442
"nekudotayim",
4543
"nowdoc",
44+
"numeronym",
4645
"paamayim",
4746
"pcre",
4847
"php's",

.gitattributes

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,38 @@
1-
.travis.yml export-ignore
2-
package.xml export-ignore
3-
phpunit.xml.dist export-ignore
4-
php5-testingConfig.ini export-ignore
5-
php7-testingConfig.ini export-ignore
1+
#
2+
# Exclude these files from release archives.
3+
# This will also make them unavailable when using Composer with `--prefer-dist`.
4+
# If you develop for this repo using Composer, use `--prefer-source`.
5+
# https://www.reddit.com/r/PHP/comments/2jzp6k/i_dont_need_your_tests_in_my_production/
6+
# https://blog.madewithlove.be/post/gitattributes/
7+
#
8+
.github/ export-ignore
9+
scripts/ export-ignore
10+
src/Standards/**/Tests/ export-ignore
11+
tests/Core/**/ export-ignore
12+
tests/EndToEndBash/**/ export-ignore
13+
.cspell.json export-ignore
14+
.gitattributes export-ignore
15+
.gitignore export-ignore
16+
.markdownlint-cli2.yaml export-ignore
17+
.remarkignore export-ignore
18+
.remarkrc export-ignore
19+
.shellcheckrc export-ignore
20+
.yamllint.yml export-ignore
21+
CHANGELOG-0.x.md export-ignore
22+
CHANGELOG-1.x.md export-ignore
23+
CHANGELOG-2.x.md export-ignore
24+
phpcs.xml.dist export-ignore
25+
phpstan.neon.dist export-ignore
26+
phpunit.xml.dist export-ignore
27+
phpunit-lte9.xml.dist export-ignore
28+
tests/Core/AbstractWriterTestCase.php export-ignore
29+
tests/Core/ErrorSuppressionTest.php export-ignore
30+
tests/Core/StatusWriterTestHelper.php export-ignore
631

32+
#
733
# Declare files that should always have CRLF line endings on checkout.
34+
#
835
*WinTest.inc text eol=crlf
936
*WinTest.php text eol=crlf
37+
src/Standards/Generic/Tests/Files/LineEndingsUnitTest*.inc text eol=crlf
38+
tests/Core/Fixer/Fixtures/GenerateDiffTest-WindowsLineEndings.inc text eol=crlf

.github/CONTRIBUTING.md

Lines changed: 484 additions & 0 deletions
Large diffs are not rendered by default.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,70 @@
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`, `PEAR`, `PSR1`,
14+
`PSR2`, `PSR12`, `Squiz` or `Zend`, the error is likely coming from an
15+
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
22+
1123
A clear and concise description of what the bug is.
1224

13-
**Code sample**
25+
### Code sample
1426
```php
15-
echo "A short code snippet that can be used to reproduce the bug";
27+
echo 'A short code snippet that can be used to reproduce the bug.';
28+
echo 'Do NOT paste screenshots of code!";
1629
```
1730

18-
**Custom ruleset**
31+
### Custom ruleset
1932
```xml
2033
<?xml version="1.0"?>
2134
<ruleset name="My Custom Standard">
22-
<description>If you are using a custom ruleset, please enter it here.</description>
35+
<description>If you are using a custom ruleset, please enter the relevant part here.</description>
2336
</ruleset>
2437
```
2538

26-
**To reproduce**
39+
### To reproduce
2740
Steps to reproduce the behavior:
2841
1. Create a file called `test.php` with the code sample above...
2942
2. Run `phpcs test.php ...`
3043
3. See error message displayed
31-
```
44+
```text
3245
PHPCS output here
3346
```
3447

35-
**Expected behavior**
48+
## Expected behavior
49+
3650
A clear and concise description of what you expected to happen.
3751

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]
52+
## Versions (please complete the following information)
53+
54+
| | |
55+
|-----------------------------|---------------------------------------------------------------------------- |
56+
| Operating System | (e.g., Windows 10, MacOS 10.15) |
57+
| PHP version | (e.g., 7.2, 8.1) |
58+
| PHP_CodeSniffer version | (e.g., 3.13.4, 4.x) |
59+
| Standard | (e.g., PSR2, PSR12, Squiz, custom) |
60+
| Install type | (e.g. Composer (global/local), PHAR, git clone, other (please expand)) |
61+
62+
## Additional context
4363

44-
**Additional context**
4564
Add any other context about the problem here.
65+
66+
## Please confirm
67+
68+
- [ ] I have searched the issue list and am not opening a duplicate issue.
69+
- [ ] I have read the [Contribution Guidelines](https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/HEAD/.github/CONTRIBUTING.md) and this is not a [support question](https://github.com/PHPCSStandards/PHP_CodeSniffer/discussions).
70+
- [ ] I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
71+
- [ ] I have verified the issue still exists in the `4.x` branch of PHP_CodeSniffer.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Community Support
4+
url: https://github.com/PHPCSStandards/PHP_CodeSniffer/discussions?discussions_q=-category%3AAnnouncements
5+
about: Support questions belong in Discussions, not in the issue tracker.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Feature request
3+
about: I have a suggestion (and may want to implement it).
4+
title: ''
5+
labels: ['Status: triage', 'Type: enhancement']
6+
assignees: ''
7+
8+
---
9+
10+
## Is your feature request related to a problem?
11+
<!-- Please provide a clear and concise description of what the feature is which you'd like to see implemented. -->
12+
13+
## Describe the solution you'd like
14+
<!--
15+
A clear and concise description of what you want to happen.
16+
17+
Please include some code samples of what should be flagged and preferably also some
18+
code samples of what should *not* be flagged.
19+
-->
20+
21+
## Additional context (optional)
22+
<!-- Add any other context or screenshots about the feature request here. -->
23+
24+
- [ ] I have read the [Contribution Guidelines](https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/HEAD/.github/CONTRIBUTING.md) and this is not a [support question](https://github.com/PHPCSStandards/PHP_CodeSniffer/discussions).
25+
- [ ] I intend to create a pull request to implement this feature.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Checklists for branch management of majors
2+
3+
Note: these lists may be incomplete and should be regarded as a starting point to be updated/enhanced each time new insights present themselves.
4+
5+
6+
## Stop support for old major
7+
8+
- [ ] Remove "old major" from workflows in the **oldest major still supported**.
9+
I.e. when support for 3.x will be stopped, `3.x` should be removed from the workflows in the `4.x` branch (not from the 3.x branch).
10+
- [ ] Update target branch in the `.github/dependabot.yml` file in the **oldest major still supported** to be that oldest major.
11+
- [ ] Update target branch (`BASE`) in the `.github/workflows/happy-new-year.yml` file in the **oldest major still supported** to be that oldest major.
12+
13+
14+
## Start branch for next major
15+
16+
- [ ] Add "next major" to workflows in the **oldest major still supported**.
17+
I.e. when a new 5.x branch will be created while 3.x still has minimal support, this change should be made in the `3.x` branch (otherwise in the 4.x branch).
18+
- [ ] Create x.x branch.
19+
20+
In the new branch:
21+
- [ ] Change `Config::VERSION` to next major version number.
22+
- [ ] Change `Config::STABILITY` to `alpha`.
23+
- [ ] Create CHANGELOG-x.x.md file for the new major.
24+
- [ ] Add CHANGELOG for the _major before last_ to the `.gitattributes` `export-ignore`s.
25+
- [ ] Update branch references for the badges in the README.
26+
- [ ] Update installation instructions (`^4.0`) in the README.
27+
- [ ] Update branch reference/instructions in the issue and PR templates.
28+
- [ ] Update branch reference in the `bug_report.md` issue template.
29+
- [ ] Update branch reference in the `CONTRIBUTING` file ("Getting Started" section).
30+
=> For the previous four items, see 1433a86bd4bd3480048d485983e7f16f8e8ec981 as an example.
31+
- [ ] If the next major includes a PHP version drop, that should be the one of the first commits
32+
Example: a7a27b9413106cf4bf10514d6ce93658899ec279
33+
Also update relevant files from 19724954edc7997125040fbf84eddffca99d674f

.github/community-cc-list.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# PHP_CodeSniffer Community CC List
2+
3+
<!--
4+
This list will be used on select tickets to ping the wider PHP_CodeSniffer community for input.
5+
6+
If you want to be on this list, feel free to submit a PR to add yourself.
7+
If you want to be removed from the list, dito, submit a PR to remove yourself and it will be merged without questions.
8+
9+
PRs adding/removing other people to/from the list will only be merged if the people being added/removed leave a comment on the PR consenting to it.
10+
11+
When updating the list, please list GitHub handles in alphabetical order.
12+
13+
For more context, see https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/227
14+
-->
15+
16+
/cc @asispts @dingo-d @fredden @GaryJones @greg0ire @kukulich @michalbundyra @Ocramius @sirbrillig @stronk7 @weierophinney @wimg

.github/dependabot.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Dependabot configuration.
2+
#
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
# Handle updates for the default branch.
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "cron"
13+
cronjob: "10 22 5,20 * *" # At 22:10, every 5th and 20th day of the month.
14+
target-branch: "3.x"
15+
open-pull-requests-limit: 5
16+
commit-message:
17+
prefix: "GH Actions:"
18+
labels:
19+
- "Type: chores/QA"
20+
groups:
21+
action-runners:
22+
applies-to: version-updates
23+
update-types:
24+
- "minor"
25+
- "patch"
26+
27+
# Handle updates for the orphan gh-pages branch.
28+
- package-ecosystem: "github-actions"
29+
directory: "/"
30+
schedule:
31+
interval: "cron"
32+
cronjob: "10 22 5,20 * *" # At 22:10, every 5th and 20th day of the month.
33+
target-branch: "gh-pages"
34+
open-pull-requests-limit: 5
35+
commit-message:
36+
prefix: "GH Pages/Actions:"
37+
labels:
38+
- "Type: chores/QA"
39+
groups:
40+
action-runners:
41+
applies-to: version-updates
42+
update-types:
43+
- "minor"
44+
- "patch"

.github/labeler.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
version: 1
2+
appendOnly: true
3+
labels:
4+
- label: "Status: triage"
5+
draft: false
6+
author-can-merge: false
7+
8+
- label: "Core Component: Config & CLI options"
9+
draft: false
10+
files:
11+
- "src/Config.php$"
12+
- label: "Core Component: Ruleset"
13+
draft: false
14+
files:
15+
- "src/Ruleset.php$"
16+
- label: "Core Component: File"
17+
draft: false
18+
files:
19+
- "src/Files/.*"
20+
- label: "Core Component: Fixer"
21+
draft: false
22+
files:
23+
- "src/Fixer.php$"
24+
- label: "Core Component: Generators"
25+
draft: false
26+
files:
27+
- "src/Generators/.*"
28+
- label: "Core Component: Reports"
29+
draft: false
30+
files:
31+
- "src/Reports/.*"
32+
- label: "Core Component: Tokenizer"
33+
draft: false
34+
files:
35+
- "src/Tokenizers/.*"
36+
- label: "Core Component: Utils"
37+
draft: false
38+
files:
39+
- "src/Util/.*"
40+
41+
- label: "Focus: Comments/Docblocks"
42+
draft: false
43+
files:
44+
- "src/Standards/.*/Sniffs/Commenting/"
45+
- label: "Focus: Fixer Conflicts"
46+
draft: false
47+
body: ".* fixer conflict.*"
48+
49+
- label: "Standard: Generic"
50+
draft: false
51+
files:
52+
- "src/Standards/Generic/(Docs|Sniffs)/.*"
53+
- label: "Standard: PEAR"
54+
draft: false
55+
files:
56+
- "src/Standards/PEAR/(Docs|Sniffs)/.*"
57+
- label: "Standard: PSR1"
58+
draft: false
59+
files:
60+
- "src/Standards/PSR1/(Docs|Sniffs)/.*"
61+
- label: "Standard: PSR2"
62+
draft: false
63+
files:
64+
- "src/Standards/PSR2/(Docs|Sniffs)/.*"
65+
- label: "Standard: PSR12"
66+
draft: false
67+
files:
68+
- "src/Standards/PSR12/(Docs|Sniffs)/.*"
69+
- label: "Standard: Squiz"
70+
draft: false
71+
files:
72+
- "src/Standards/Squiz/(Docs|Sniffs)/.*"
73+
- label: "Standard: Zend"
74+
draft: false
75+
files:
76+
- "src/Standards/Zend/(Docs|Sniffs)/.*"
77+
78+
- label: "Type: breaking change"
79+
draft: false
80+
body: '[Xx]\] Breaking change'
81+
- label: "Type: bug"
82+
draft: false
83+
body: '[Xx]\] Bug fix'
84+
- label: "Type: enhancement"
85+
draft: false
86+
body: '[Xx]\] New feature'
87+
- label: "Type: documentation"
88+
draft: false
89+
body: '[Xx]\] Documentation improvement'
90+
- label: "Type: documentation"
91+
draft: false
92+
files:
93+
- 'src/Standards/.*/Docs/[A-Za-z0-9-]*/.*Standard.xml$'
94+
- label: "Type: documentation"
95+
draft: false
96+
files:
97+
- "*.md$"

0 commit comments

Comments
 (0)