Skip to content

Commit 3b4a5a2

Browse files
committed
Always have filenames in backticks
1 parent bed8857 commit 3b4a5a2

5 files changed

+6
-6
lines changed

wiki/Annotated-Ruleset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PHP_CodeSniffer allows developers to design their own coding standards by creating a simple ruleset XML file that both pulls in sniffs from existing standards and customises them for the developer's needs. This XML file can be named anything you like, as long as it has an `xml` extension and complies to the ruleset.xml format. The file can be stored anywhere, making it perfect for placing under version control with a project's source code and unit tests.
1+
PHP_CodeSniffer allows developers to design their own coding standards by creating a simple ruleset XML file that both pulls in sniffs from existing standards and customises them for the developer's needs. This XML file can be named anything you like, as long as it has an `xml` extension and complies to the `ruleset.xml` format. The file can be stored anywhere, making it perfect for placing under version control with a project's source code and unit tests.
22

33
Once created, a ruleset file can be used with the `--standard` command line argument. In the following example, PHP_CodeSniffer will use the coding standard defined in a custom ruleset file called `custom_ruleset.xml`:
44

wiki/Coding-Standard-Tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The content of the `ruleset.xml` file should, at a minimum, be the following:
4444
```
4545

4646
> [!NOTE]
47-
> The ruleset.xml can be left quite small, as it is in this example coding standard. For information about the other features that the `ruleset.xml` provides, see the [[Annotated ruleset]].
47+
> The `ruleset.xml` can be left quite small, as it is in this example coding standard. For information about the other features that the `ruleset.xml` provides, see the [[Annotated ruleset]].
4848
4949
## Creating the Sniff
5050

wiki/Customisable-Sniff-Properties.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The behaviour of some sniffs can be changed by setting certain sniff properties in your ruleset.xml file. This page lists the sniff properties that are available for customisation. For properties that were added after ruleset support was introduced in version 1.3.0, the first stable version that made the property available is listed.
1+
The behaviour of some sniffs can be changed by setting certain sniff properties in your `ruleset.xml` file. This page lists the sniff properties that are available for customisation. For properties that were added after ruleset support was introduced in version 1.3.0, the first stable version that made the property available is listed.
22

33
For more information about changing sniff behaviour by customising your ruleset, see the [[Annotated ruleset]].
44

wiki/Version-3.0-Upgrade-Guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PHP_CodeSniffer version 3 contains a large number of core changes and breaks backwards compatibility for all custom sniffs and reports. The aim of this guide is to help developers upgrade their custom sniffs, unit tests, and reports from PHP_CodeSniffer version 2 to version 3.
22

33
> [!NOTE]
4-
> If you only use the built-in coding standards, or you have a custom ruleset.xml file that only makes use of the sniffs and reports distributed with PHP_CodeSniffer, you do not need to make any changes to begin using PHP_CodeSniffer version 3.
4+
> If you only use the built-in coding standards, or you have a custom `ruleset.xml` file that only makes use of the sniffs and reports distributed with PHP_CodeSniffer, you do not need to make any changes to begin using PHP_CodeSniffer version 3.
55
66
***
77

@@ -19,7 +19,7 @@ All sniffs must now be namespaced.
1919
> [!NOTE]
2020
> It doesn't matter what namespace you use for your sniffs as long as the last part of the namespace is in the format `StandardName\Sniffs\Category` as this is used to determine the sniff code. The examples below use a very minimal namespace but you can prefix it with whatever makes sense for your project. If you aren't sure what namespace to use, try using the example format.
2121
>
22-
> If you decide to use a more complex prefix, or your prefix does not match the name of the directory containing your ruleset.xml file, you need to define the prefix in the ruleset tag of your ruleset.xml file. For example, if your namespace format for sniffs is `MyProject\CS\StandardName\Sniffs\Category`, set the namespace to `MyProject\CS\StandardName` (everything up to `\Sniffs\`). The ruleset tag would look like this: `<ruleset name="Custom Standard" namespace="MyProject\CS\StandardName">`
22+
> If you decide to use a more complex prefix, or your prefix does not match the name of the directory containing your `ruleset.xml` file, you need to define the prefix in the ruleset tag of your `ruleset.xml` file. For example, if your namespace format for sniffs is `MyProject\CS\StandardName\Sniffs\Category`, set the namespace to `MyProject\CS\StandardName` (everything up to `\Sniffs\`). The ruleset tag would look like this: `<ruleset name="Custom Standard" namespace="MyProject\CS\StandardName">`
2323
2424
Internal namespace changes to core classes require changes to all sniff class definitions. The old definition looked like this:
2525
```php

wiki/Version-4.0-Developer-Upgrade-Guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ If your userbase is known to often combine multiple external standards, making t
4343
The vast majority of the below upgrade tasks will need to be executed in both cases, but there are some upgrade tasks which can only be executed once support for PHP_CodeSniffer 3.x is being dropped.
4444

4545

46-
## Upgrading the ruleset.xml file
46+
## Upgrading the `ruleset.xml` file
4747

4848
See the [[Upgrade Guide for Ruleset Maintainers and End-Users|Version 4.0 User Upgrade Guide]] for everything you need to know about upgrading the `ruleset.xml` file.
4949

0 commit comments

Comments
 (0)