@@ -11,15 +11,15 @@ Thank you for your interest in contributing to PHP_CodeSniffer!
11
11
* [ Contributing Without Writing Code] ( #contributing-without-writing-code )
12
12
* [ Bug Triage] ( #bug-triage )
13
13
* [ Testing Open Pull Requests] ( #testing-open-pull-requests )
14
- * [ Writing sniff documentation ] ( #writing-sniff-documentation )
15
- * [ Other tasks ] ( #other-tasks )
14
+ * [ Writing Sniff Documentation ] ( #writing-sniff-documentation )
15
+ * [ Other Tasks ] ( #other-tasks )
16
16
* [ Contributing With Code] ( #contributing-with-code )
17
17
* [ Requesting/Submitting New Features] ( #requestingsubmitting-new-features )
18
18
* [ Finding Something to Work on] ( #finding-something-to-work-on )
19
- * [ Getting started ] ( #getting-started )
20
- * [ While working on a patch ] ( #while-working-on-a-patch )
21
- * [ Writing tests ] ( #writing-tests )
22
- * [ Submitting your pull request ] ( #submitting-your-pull-request )
19
+ * [ Getting Started ] ( #getting-started )
20
+ * [ While Working on a Patch ] ( #while-working-on-a-patch )
21
+ * [ Writing Tests ] ( #writing-tests )
22
+ * [ Submitting Your Pull Request ] ( #submitting-your-pull-request )
23
23
* [ Licensing] ( #licensing )
24
24
25
25
@@ -71,7 +71,7 @@ This includes checking whether the bug is something which should be fixed in **_
71
71
To find bugs which need triage, look for issues and PRs with the
72
72
[ "Status: triage"] ( https://github.com/PHPCSStandards/PHP_CodeSniffer/labels/Status%3A%20triage ) label.
73
73
74
- #### Typical bug triage tasks
74
+ #### Typical Bug Triage Tasks
75
75
* Verify whether the bug is reproducible with the given information.
76
76
* Ask for additional information if it is not.
77
77
* If you find the issue is reported to the wrong repo, ask the reporter to report it to the correct external standard repo
@@ -95,15 +95,15 @@ To get access to a PHPCS version which includes the patch from a pull request, y
95
95
The PHAR files can be found on the summary page of the test workflow run for the PR.
96
96
If the workflow has not been run (yet), the PHAR artifact may not be available (yet).
97
97
98
- #### Typical test tasks
98
+ #### Typical Test Tasks
99
99
* Verify that the patch solves the originally reported problem.
100
100
* Verify that the tests added in the PR fail without the fix and pass with the fix.
101
101
* For a fix for false negatives: verify that the correct error message(s) are thrown by the patched code.
102
102
* Run the patched PHPCS version against real codebases to see if the fix creates any side effects
103
103
(new false positives/false negatives).
104
104
105
105
106
- ### Writing sniff documentation
106
+ ### Writing Sniff Documentation
107
107
108
108
Sniffs in PHP_CodeSniffer should preferably be accompanied by documentation. There is currently still a lot of
109
109
[ documentation missing] ( https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/148 ) .
@@ -152,11 +152,11 @@ phpcs --standard=StandardName --generator=Text --sniffs=StandardName.Category.Sn
152
152
Kind request to add only one new XML file per PR to make the PR easier to review.
153
153
154
154
155
- ### Other tasks
155
+ ### Other Tasks
156
156
157
157
There are also tasks looking for contributions, which don't necessarily fall into the above categories.
158
158
159
- #### Issues marked with "Status: waiting for opinions"
159
+ #### Issues Marked with "Status: waiting for opinions"
160
160
161
161
Proposals for new features, proposals for (structural) changes to PHP_CodeSniffer itself or to the contributor workflow,
162
162
will initially be marked with the
@@ -180,7 +180,7 @@ will be pinged (cc-ed) to gather their thoughts on the topic.
180
180
> on the PR consenting to it.
181
181
182
182
183
- #### Issues marked with "Status: needs investigation"
183
+ #### Issues Marked with "Status: needs investigation"
184
184
185
185
Sometimes an issue has been identified, but it has not yet been pinpointed what the exact cause of the problem is.
186
186
@@ -191,7 +191,7 @@ Issues like these will be marked with the
191
191
[ "Status: needs investigation"] ( https://github.com/PHPCSStandards/PHP_CodeSniffer/labels/Status%3A%20needs%20investigation )
192
192
and investigating those can be a good way to learn more about the source code of PHP_CodeSniffer.
193
193
194
- #### Issues marked with "Status: help wanted"
194
+ #### Issues Marked with "Status: help wanted"
195
195
196
196
If you don't know where to start, have a browse through issues marked with the
197
197
[ "Status: help wanted"] ( https://github.com/PHPCSStandards/PHP_CodeSniffer/labels/Status%3A%20help%20wanted ) and/or the
@@ -240,15 +240,15 @@ When in doubt how to proceed with a ticket, feel free to leave a comment with sp
240
240
(if still needed after you have read the rest of the contributing guide).
241
241
242
242
243
- ### Getting started
243
+ ### Getting Started
244
244
245
245
1 . Fork/clone the repository.
246
246
2 . Run ` composer install ` .
247
247
3 . Create a new branch off the ` master ` branch to hold your patch.
248
248
If there is an open issue associated with your patch, including the issue number in the branch name is good practice.
249
249
250
250
251
- ### While working on a patch
251
+ ### While Working on a Patch
252
252
253
253
Please make sure your code conforms to the PHPCS coding standard, is covered by tests and that all the PHP_CodeSniffer
254
254
unit tests still pass.
@@ -268,7 +268,7 @@ To help you with this, a number of convenience scripts are available:
268
268
N.B.: You can ignore any skipped tests as these are for external tools.
269
269
270
270
271
- ### Writing tests
271
+ ### Writing Tests
272
272
273
273
Tests for the PHP_CodeSniffer engine can be found in the ` tests/Core ` directory.
274
274
Tests for individual sniffs can be found in the ` src/Standards/[StandardName]/Tests/[Category]/ ` directory.
@@ -287,7 +287,7 @@ For example, for the sniff named `Generic.NamingConventions.ConstructorName`:
287
287
Only lines on which errors/warnings are expected need to be included in the lists. All other lines will automatically
288
288
be set to expect no errors and no warnings.
289
289
290
- #### Multiple test case files
290
+ #### Multiple Test Case Files
291
291
292
292
At times, one test _ case_ file is not enough, for instance when the sniff needs to behave differently depending on whether code
293
293
is namespaced or not, or when a sniff needs to check something at the top of a file.
@@ -303,7 +303,7 @@ sequentially like `src/Standards/Generic/Tests/NamingConventions/ConstructorName
303
303
The ` getErrorList() ` and the ` getWarningList() ` methods will receive an optional ` $testFile='' ` parameter with the file name
304
304
of the file being scanned - ` ConstructorNameUnitTest.2.inc ` - and should return the appropriate array for each file.
305
305
306
- #### Testing fixers
306
+ #### Testing Fixers
307
307
308
308
If a sniff contains errors/warnings which can be auto-fixed, these fixers should also be tested.
309
309
@@ -315,7 +315,7 @@ as it is expected to be after the fixer has run.
315
315
316
316
The test framework will compare the actual fixes made with the expected fixes and will fail the tests if these don't match.
317
317
318
- #### Tests related to parse errors/live coding
318
+ #### Tests Related to Parse Errors/Live Coding
319
319
320
320
PHP_CodeSniffer can be, and is, regularly used during live coding via an IDE integration.
321
321
340
340
```
341
341
342
342
343
- ### Submitting your pull request
343
+ ### Submitting Your Pull Request
344
344
345
345
Some guidelines for submitting pull requests (PRs) and improving the chance that your PR will be merged:
346
346
* Please keep your PR as small as possible, but no smaller than that.
@@ -356,7 +356,7 @@ Some guidelines for submitting pull requests (PRs) and improving the chance that
356
356
Your time is valuable, and we appreciate your willingness to spend it on this project.
357
357
However, the maintainers time is also valuable and often, more scarce, so please be considerate of that.
358
358
359
- #### Some git best practices
359
+ #### Some Git Best Practices
360
360
361
361
While not strictly required, it is greatly appreciated if you comply with the following git best practices:
362
362
@@ -383,16 +383,16 @@ While not strictly required, it is greatly appreciated if you comply with the fo
383
383
If your PR has not been reviewed yet, feel free to rebase at will.
384
384
Once a PR is under review, consult with the reviewer about rebasing the PR.
385
385
386
- #### Final words
386
+ #### Final Words
387
387
388
- ##### Do not violate copyright
388
+ ##### Do Not Violate Copyright
389
389
390
390
Only submit a PR with your own original code. Do NOT submit a PR containing code which you have largely copied from
391
391
an externally available sniff, unless you wrote said sniff yourself.
392
392
Open source does not mean that copyright does not apply.
393
393
Copyright infringements will not be tolerated and can lead to you being banned from the repo.
394
394
395
- ##### Do not submit AI generated PRs
395
+ ##### Do Not Submit AI Generated PRs
396
396
397
397
The same goes for (largely) AI-generated PRs. These are not welcome as they will be based on copyrighted code from others
398
398
without accreditation and without taking the license of the original code into account, let alone getting permission
0 commit comments