From 095133e8b3691e887ee1790ad8ec07bba6afdbe3 Mon Sep 17 00:00:00 2001 From: Sergey Kupletsky Date: Sat, 14 Dec 2024 14:33:07 +0100 Subject: [PATCH] docs: make rules documentation more consistent --- .github/ISSUE_TEMPLATE/rule_proposal.md | 4 ++-- docs/rules/__TEMPLATE__.md | 10 +++++----- docs/rules/no-quotes-in-volumes-rule.md | 4 ++-- docs/rules/no-version-field-rule.md | 8 ++++---- docs/rules/require-project-name-field-rule.md | 8 ++++---- docs/rules/require-quotes-in-ports-rule.md | 8 ++++---- .../service-dependencies-alphabetical-order-rule.md | 4 ++-- docs/rules/service-keys-order-rule.md | 4 ++-- docs/rules/services-alphabetical-order-rule.md | 10 +++++----- docs/rules/top-level-properties-order-rule.md | 6 +++--- 10 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/rule_proposal.md b/.github/ISSUE_TEMPLATE/rule_proposal.md index 1aed181..fab7c93 100644 --- a/.github/ISSUE_TEMPLATE/rule_proposal.md +++ b/.github/ISSUE_TEMPLATE/rule_proposal.md @@ -12,11 +12,11 @@ assignees: - **Severity: (warning|error)** - **Fixable: (yes|no)** -## Problematic code example +## Problematic Code Example Provide an example of code that would trigger this rule. -## Correct code example +## Correct Code Example Provide an example of the code that would pass the rule. diff --git a/docs/rules/__TEMPLATE__.md b/docs/rules/__TEMPLATE__.md index 3ad52a8..7521ca2 100644 --- a/docs/rules/__TEMPLATE__.md +++ b/docs/rules/__TEMPLATE__.md @@ -8,15 +8,15 @@ Short rule description. - **Severity:** - **Fixable:** -## Problematic code example +## Problematic Code Example -```yml +```yaml ``` -## Correct code example +## Correct Code Example -```yml +```yaml ``` @@ -36,4 +36,4 @@ This rule was introduced in [v1.0.0](https://github.com/zavoloklom/docker-compos ## References -Links +- [Reference link](https://example.com) diff --git a/docs/rules/no-quotes-in-volumes-rule.md b/docs/rules/no-quotes-in-volumes-rule.md index dc93781..de5ec5a 100644 --- a/docs/rules/no-quotes-in-volumes-rule.md +++ b/docs/rules/no-quotes-in-volumes-rule.md @@ -12,7 +12,7 @@ themselves. - **Severity:** info - **Fixable:** true -## Problematic code example +## Problematic Code Example ```yaml services: @@ -23,7 +23,7 @@ services: - "logs:/app/logs" ``` -## Correct code example +## Correct Code Example ```yaml services: diff --git a/docs/rules/no-version-field-rule.md b/docs/rules/no-version-field-rule.md index 34c3c6e..0194dc9 100644 --- a/docs/rules/no-version-field-rule.md +++ b/docs/rules/no-version-field-rule.md @@ -9,18 +9,18 @@ the "version" field is removed, promoting consistency and modern practices in Do - **Severity:** minor - **Fixable:** true -## Problematic code example +## Problematic Code Example -```yml +```yaml version: '3.8' services: web: image: image ``` -## Correct code example +## Correct Code Example -```yml +```yaml services: web: image: image diff --git a/docs/rules/require-project-name-field-rule.md b/docs/rules/require-project-name-field-rule.md index 19d01ff..f3c58fd 100644 --- a/docs/rules/require-project-name-field-rule.md +++ b/docs/rules/require-project-name-field-rule.md @@ -9,18 +9,18 @@ The "name" field should be present in the Docker Compose file. This rule enforce - **Severity:** minor - **Fixable:** false -## Problematic code example +## Problematic Code Example -```yml +```yaml services: foo: image: image command: echo "I'm running ${COMPOSE_PROJECT_NAME}" ``` -## Correct code example +## Correct Code Example -```yml +```yaml name: myapp services: diff --git a/docs/rules/require-quotes-in-ports-rule.md b/docs/rules/require-quotes-in-ports-rule.md index e199fc3..98df1ac 100644 --- a/docs/rules/require-quotes-in-ports-rule.md +++ b/docs/rules/require-quotes-in-ports-rule.md @@ -13,7 +13,7 @@ ports themselves. The type of quotes (single or double) can be configured via th - **Severity:** minor - **Fixable:** true -## Problematic code example +## Problematic Code Example ```yaml services: @@ -26,9 +26,10 @@ services: - 3000 ``` -## Correct code example (Single Quotes) +## Correct Code Example ```yaml +# Single Quotes services: foo: image: image @@ -39,9 +40,8 @@ services: - '3000' ``` -## Correct code example (Double Quotes) - ```yaml +# Double Quotes services: foo: image: image diff --git a/docs/rules/service-dependencies-alphabetical-order-rule.md b/docs/rules/service-dependencies-alphabetical-order-rule.md index 5f2cd82..82161fd 100644 --- a/docs/rules/service-dependencies-alphabetical-order-rule.md +++ b/docs/rules/service-dependencies-alphabetical-order-rule.md @@ -12,7 +12,7 @@ internal content. - **Severity:** info - **Fixable:** true -## Problematic code example +## Problematic Code Example ```yaml services: @@ -35,7 +35,7 @@ services: restart: true ``` -## Correct code example +## Correct Code Example ```yaml services: diff --git a/docs/rules/service-keys-order-rule.md b/docs/rules/service-keys-order-rule.md index 6bf2078..5241445 100644 --- a/docs/rules/service-keys-order-rule.md +++ b/docs/rules/service-keys-order-rule.md @@ -12,7 +12,7 @@ without altering their internal content. - **Severity:** minor - **Fixable:** true -## Problematic code example +## Problematic Code Example ```yaml services: @@ -27,7 +27,7 @@ services: - "8080:8080" ``` -## Correct code example +## Correct Code Example ```yaml services: diff --git a/docs/rules/services-alphabetical-order-rule.md b/docs/rules/services-alphabetical-order-rule.md index 2f77ad9..bad0eb4 100644 --- a/docs/rules/services-alphabetical-order-rule.md +++ b/docs/rules/services-alphabetical-order-rule.md @@ -7,14 +7,14 @@ This rule is fixable. The linter can automatically reorder services in alphabeti internal structure or content. - **Rule Name:** services-alphabetical-order -- **Type:** error +- **Type:** warning - **Category:** style - **Severity:** minor - **Fixable:** true -## Problematic code example +## Problematic Code Example -```yml +```yaml services: d_service: image: image @@ -26,9 +26,9 @@ services: image: image ``` -## Correct code example +## Correct Code Example -```yml +```yaml services: a_service: image: image diff --git a/docs/rules/top-level-properties-order-rule.md b/docs/rules/top-level-properties-order-rule.md index f172383..7c36f4a 100644 --- a/docs/rules/top-level-properties-order-rule.md +++ b/docs/rules/top-level-properties-order-rule.md @@ -7,12 +7,12 @@ This rule is fixable. The linter can automatically reorder the top-level propert without altering their internal content. - **Rule Name:** top-level-properties-order -- **Type:** error +- **Type:** warning - **Category:** style - **Severity:** major - **Fixable:** true -## Problematic code example +## Problematic Code Example ```yaml services: @@ -26,7 +26,7 @@ networks: driver: bridge ``` -## Correct code example +## Correct Code Example ```yaml x-alpha: alpha