From d83b58fd9d893ad7a8de6490018d8096c0cedf84 Mon Sep 17 00:00:00 2001 From: Geert Eltink Date: Sat, 15 May 2021 10:59:32 +0200 Subject: [PATCH] docs: fix markdown formatting Signed-off-by: Geert Eltink --- docs/book/v1/intro.md | 5 +++++ docs/book/v1/ruleset.md | 15 ++++++++++----- docs/book/v2/coding-style-guide.md | 17 +++++++++-------- docs/book/v2/intro.md | 29 +++++++++++++++++------------ 4 files changed, 41 insertions(+), 25 deletions(-) diff --git a/docs/book/v1/intro.md b/docs/book/v1/intro.md index 9b03b3d..cc7646e 100644 --- a/docs/book/v1/intro.md +++ b/docs/book/v1/intro.md @@ -3,11 +3,13 @@ ## Installation 1. Install the module via Composer by running: + ```bash $ composer require --dev laminas/laminas-coding-standard ``` 2. Add Composer scripts into your `composer.json`: + ```json "scripts": { "cs-check": "phpcs", @@ -16,6 +18,7 @@ ``` 3. Create file `phpcs.xml` on base path of your repository with content: + ```xml @@ -34,11 +37,13 @@ For a reference please see: https://github.com/squizlabs/PHP_CodeSniffer/wiki/An ## Usage * To run checks only: + ```bash $ composer cs-check ``` * To automatically fix many CS issues: + ```bash $ composer cs-fix ``` diff --git a/docs/book/v1/ruleset.md b/docs/book/v1/ruleset.md index 0e39c37..012ef6e 100644 --- a/docs/book/v1/ruleset.md +++ b/docs/book/v1/ruleset.md @@ -1,16 +1,21 @@ # Ruleset ## Use PSR-2 coding standard as a base -*PSR2* + +Rule: *PSR2* ## Disallow long array syntax -*Generic.Arrays.DisallowLongArraySyntax* + +Rule: *Generic.Arrays.DisallowLongArraySyntax* ## Force whitespace after `!` -*Generic.Formatting.SpaceAfterNot* + +Rule: *Generic.Formatting.SpaceAfterNot* ## Forbid spaces before semicolon `;` -*Squiz.WhiteSpace.SemicolonSpacing* + +Rule: *Squiz.WhiteSpace.SemicolonSpacing* ## Forbid superfluous whitespaces -*Squiz.WhiteSpace.SuperfluousWhitespace, Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines* + +Rule: *Squiz.WhiteSpace.SuperfluousWhitespace, Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines* diff --git a/docs/book/v2/coding-style-guide.md b/docs/book/v2/coding-style-guide.md index 2e6f5c7..9e6480c 100644 --- a/docs/book/v2/coding-style-guide.md +++ b/docs/book/v2/coding-style-guide.md @@ -257,14 +257,14 @@ each of the blocks below MUST be separated by a single blank line, and MUST NOT a blank line. Each block MUST be in the order listed below, although blocks that are not relevant may be omitted. -* Opening ` - + - + - + config src test - + @@ -62,12 +65,14 @@ the ["Annotated Ruleset" of PHP_CodeSniffer](https://github.com/squizlabs/PHP_Co ## Usage -* To run checks only: +- To run checks only: + ```bash $ composer cs-check ``` -* To automatically fix many CS issues: +- To automatically fix many CS issues: + ```bash $ composer cs-fix ``` @@ -109,7 +114,7 @@ $xmlPackage->send(); > should always be based on the develop branch and queued for the next major > release, unless considered a bugfix for existing rules. -If you want to test changes against Laminas components or your own projects, install your forked +If you want to test changes against Laminas components or your own projects, install your forked laminas-coding-standard globally with Composer: ```bash @@ -124,7 +129,7 @@ $ phpcs -sp --standard=LaminasCodingStandard src test **Make sure you remove the global installation after testing from your global `composer.json` file!** -Documentation can be previewed locally by installing [MkDocs](https://www.mkdocs.org/#installation) and run +Documentation can be previewed locally by installing [MkDocs](https://www.mkdocs.org/#installation) and run `mkdocs serve`. This will start a server where you can read the docs. ## Reference