Skip to content

Commit 4792db1

Browse files
committed
Wiki: always have filenames in backticks
Hoping I've caught them all, but not claiming completeness.
1 parent 0c1daa9 commit 4792db1

5 files changed

+9
-9
lines changed

wiki/Annotated-Ruleset.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

3-
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:
3+
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

55
```bash
66
$ phpcs --standard=/path/to/custom_ruleset.xml test.php
@@ -14,7 +14,7 @@ For projects, it is recommended to use one of the `.dist` filenames.
1414

1515
## The Annotated Sample File
1616

17-
The following sample file documents the ruleset.xml format and shows you the complete range of features that the format supports. The file is designed for documentation purposes only and is not a working coding standard.
17+
The following sample file documents the `ruleset.xml` format and shows you the complete range of features that the format supports. The file is designed for documentation purposes only and is not a working coding standard.
1818

1919
```xml
2020
<?xml version="1.0"?>
@@ -446,7 +446,7 @@ Setting the `phpcs-only` attribute to `true` will only apply the rule when the `
446446

447447
Setting the `phpcbf-only` attribute to `true` will only apply the rule when the `phpcbf` tool is fixing a file. The rule will not be applied while the file is being checked with the `phpcs` tool.
448448

449-
The following sample file shows a ruleset.xml file that makes use of selective rules. The file is designed for documentation purposes only and is not a working coding standard.
449+
The following sample file shows a `ruleset.xml` file that makes use of selective rules. The file is designed for documentation purposes only and is not a working coding standard.
450450

451451
```xml
452452
<?xml version="1.0"?>

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](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/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](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/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](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/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](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Version-4.0-User-Upgrade-Guide) for everything you need to know about upgrading the `ruleset.xml` file.
4949

0 commit comments

Comments
 (0)