Skip to content

Commit

Permalink
docs: make rules documentation more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
zavoloklom committed Dec 15, 2024
1 parent 64a04a6 commit 095133e
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/rule_proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
10 changes: 5 additions & 5 deletions docs/rules/__TEMPLATE__.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```

Expand All @@ -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)
4 changes: 2 additions & 2 deletions docs/rules/no-quotes-in-volumes-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ themselves.
- **Severity:** info
- **Fixable:** true

## Problematic code example
## Problematic Code Example

```yaml
services:
Expand All @@ -23,7 +23,7 @@ services:
- "logs:/app/logs"
```
## Correct code example
## Correct Code Example
```yaml
services:
Expand Down
8 changes: 4 additions & 4 deletions docs/rules/no-version-field-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions docs/rules/require-project-name-field-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions docs/rules/require-quotes-in-ports-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -26,9 +26,10 @@ services:
- 3000
```
## Correct code example (Single Quotes)
## Correct Code Example
```yaml
# Single Quotes
services:
foo:
image: image
Expand All @@ -39,9 +40,8 @@ services:
- '3000'
```
## Correct code example (Double Quotes)
```yaml
# Double Quotes
services:
foo:
image: image
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/service-dependencies-alphabetical-order-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal content.
- **Severity:** info
- **Fixable:** true

## Problematic code example
## Problematic Code Example

```yaml
services:
Expand All @@ -35,7 +35,7 @@ services:
restart: true
```
## Correct code example
## Correct Code Example
```yaml
services:
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/service-keys-order-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ without altering their internal content.
- **Severity:** minor
- **Fixable:** true

## Problematic code example
## Problematic Code Example

```yaml
services:
Expand All @@ -27,7 +27,7 @@ services:
- "8080:8080"
```
## Correct code example
## Correct Code Example
```yaml
services:
Expand Down
10 changes: 5 additions & 5 deletions docs/rules/services-alphabetical-order-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,9 +26,9 @@ services:
image: image
```
## Correct code example
## Correct Code Example
```yml
```yaml
services:
a_service:
image: image
Expand Down
6 changes: 3 additions & 3 deletions docs/rules/top-level-properties-order-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -26,7 +26,7 @@ networks:
driver: bridge
```
## Correct code example
## Correct Code Example
```yaml
x-alpha: alpha
Expand Down

0 comments on commit 095133e

Please sign in to comment.