Skip to content

Commit 583f8ba

Browse files
committed
CS/markdownlint: code blocks should always specify language
When the code block contains plain text, use `text`.
1 parent f607f53 commit 583f8ba

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

wiki/About-Standards-for-PHP_CodeSniffer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Once you have a good name:
7676
```
7777

7878
If your chosen standard name is `MyCompanyStandard`, the directory structure would now look like this:
79-
```
79+
```text
8080
- MyCompanyStandard (directory)
8181
- ruleset.xml (file)
8282
```
@@ -124,7 +124,7 @@ Sniffs need to follow strict directory layout and naming conventions to allow fo
124124
A sniff MUST belong to a standard and MUST be in a category.
125125

126126
The directory structure MUST be as follows:
127-
```
127+
```text
128128
[StandardName]/Sniffs/[CategoryName]/
129129
```
130130

wiki/Fixing-Errors-Automatically.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ patching file /path/to/code/file.php
5454
5555
## Using the PHP Code Beautifier and Fixer
5656
To automatically fix as many sniff violations as possible, use the `phpcbf` command in place of the `phpcs` command. While most of the PHPCS command line arguments can be used by PHPCBF, some are specific to reporting and will be ignored. Running PHPCBF with the `-h` or `--help` command line arguments will print a list of commands that PHPCBF will respond to. The output of `phpcbf -h` is shown below.
57-
```
57+
```text
5858
Usage:
5959
phpcbf [options] <file|directory>
6060

wiki/Usage.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
Running PHP_CodeSniffer with the `-h` or `--help` command line arguments will print a list of commands that PHP_CodeSniffer will respond to. The output of `phpcs -h` is shown below.
1515

16-
```
16+
```text
1717
Usage:
1818
phpcs [options] <file|directory>
1919
@@ -138,7 +138,7 @@ $ phpcs /path/to/code/myfile.inc /path/to/code/my_dir
138138

139139
After PHP_CodeSniffer has finished processing your files, you will get an error report. The report lists both errors and warnings for all files that violated the coding standard. The output looks like this:
140140

141-
```
141+
```bash
142142
$ phpcs /path/to/code/myfile.php
143143

144144
FILE: /path/to/code/myfile.php
@@ -157,7 +157,7 @@ FOUND 5 ERROR(S) AND 1 WARNING(S) AFFECTING 5 LINE(S)
157157

158158
If you don't want warnings included in the output, specify the `-n` command line argument.
159159

160-
```
160+
```bash
161161
$ phpcs -n /path/to/code/myfile.php
162162

163163
FILE: /path/to/code/myfile.php
@@ -179,7 +179,7 @@ FOUND 5 ERROR(S) AFFECTING 5 LINE(S)
179179

180180
By default, PHP_CodeSniffer will print a complete list of all errors and warnings it finds. This list can become quite long, especially when checking a large number of files at once. To print a summary report that only shows the number of errors and warnings for each file, use the `--report=summary` command line argument. The output will look like this:
181181

182-
```
182+
```bash
183183
$ phpcs --report=summary /path/to/code
184184

185185
PHP CODE SNIFFER REPORT SUMMARY
@@ -196,7 +196,7 @@ A TOTAL OF 6 ERROR(S) AND 3 WARNING(S) WERE FOUND IN 3 FILE(S)
196196

197197
As with the full report, you can suppress the printing of warnings with the `-n` command line argument.
198198

199-
```
199+
```bash
200200
$ phpcs -n --report=summary /path/to/code
201201

202202
PHP CODE SNIFFER REPORT SUMMARY
@@ -220,7 +220,7 @@ By default, PHP_CodeSniffer will run quietly, only printing the report of errors
220220
To enable progress reporting, use the `-p` command line argument.
221221
With progress output enabled, PHP_CodeSniffer will print a single-character status for each file being checked, like so:
222222

223-
```
223+
```bash
224224
$ phpcs /path/to/code/CodeSniffer -p
225225

226226
...S........W.........S..................................... 60 / 110 (54%)
@@ -245,7 +245,7 @@ Legend for the progress indicators:
245245
246246
With verbose output enabled, PHP_CodeSniffer will print the file that it is checking, show you how many tokens and lines the file contains, and let you know how long it took to process. The output will look like this:
247247

248-
```
248+
```bash
249249
$ phpcs /path/to/code/CodeSniffer -v
250250

251251
Registering sniffs in PEAR standard... DONE (28 sniffs registered)
@@ -292,7 +292,7 @@ $ phpcs --standard=PEAR,Squiz,/path/to/MyStandard /path/to/code/myfile.inc
292292

293293
PHP_CodeSniffer can print you a list of the coding standards that are installed so that you can correctly specify a coding standard to use for testing. You can print this list by specifying the `-i` command line argument.
294294

295-
```
295+
```bash
296296
$ phpcs -i
297297
The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz and Zend
298298
```
@@ -304,7 +304,7 @@ The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz and
304304

305305
PHP_CodeSniffer can print you a list of the sniffs that a coding standard includes by specifying the `-e` command line argument along with the `--standard` argument. This allows you to see what checks will be applied when you use a given standard.
306306

307-
```
307+
```bash
308308
$ phpcs --standard=PSR1 -e
309309

310310
The PSR1 standard contains 8 sniffs

wiki/Version-1.3.0-Upgrade-Guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ PHP_CodeSniffer version 1.3.0 contains an important backwards compatibility brea
44
> If you have not created your own coding standard, you do not need to follow this guide. Users of PHP_CodeSniffer that use one of the built-in standards can continue to check their code as normal.
55
66
This guide assumes your coding standard has the following directory structure:
7-
```
7+
```text
88
MyStandard
99
|_ MyStandardCodingStandard.php
1010
|_ Sniffs
@@ -18,7 +18,7 @@ The only thing we need to do to upgrade a custom coding standard is convert the
1818
### The Basics
1919

2020
The first thing you need to do is create a `ruleset.xml` file directly under your top-level directory. The name of the file must be `ruleset.xml`:
21-
```
21+
```bash
2222
touch MyStandard/ruleset.xml
2323
```
2424

@@ -63,7 +63,7 @@ These rules would be replicated in a `ruleset.xml` file like this:
6363
```
6464

6565
The two changes here are the use of the `rule` tag to include sniffs and standards, and also the way we reference an individual sniff. Instead of specifying the path to the sniff we instead specify the internal code that PHP_CodeSniffer gives it, which is based on the path. It's actually a pretty easy conversion. Just just drop the `Sniffs` directory, convert the slashes to periods and remove `Sniff.php` from the end. Here are some more examples to make sure it is clear.
66-
```
66+
```text
6767
BEFORE: Generic/Sniffs/VersionControl/SubversionPropertiesSniff.php
6868
AFTER: Generic.VersionControl.SubversionProperties
6969

0 commit comments

Comments
 (0)