We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Docs: Add details for using profiles
##### Summary

As content moves through the automation content creation pipeline, various linting rules that are developed against may or may not apply depending on where the content is being executed.  

For example, in development, as a content creator, there should be the ability to create some rules and quickly validate them utilising ansible-lint locally.  Then in the first test run, an ansible-lint profile should allow the executor from ignoring the rules to ensure that the content itself runs as desired.

Update documentation to provide context for using profiles in a more progressive (step-by-step) way with additional context that addresses motivation.

##### Issue Type

- Bug Report (Docs)

##### Ansible and Ansible Lint details

N/A

##### OS / ENVIRONMENT

Fedora 36

##### STEPS TO REPRODUCE

N/A

##### Desired Behavior

N/A

##### Actual Behavior

N/A


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/ansiblelint/generate_docs.py`
Content:
```
1 """Utils to generate rules documentation."""
2 import logging
3 from pathlib import Path
4 from typing import Iterable
5 
6 from rich import box
7 
8 # Remove this compatibility try-catch block once we drop support for rich < 10.7.0
9 try:
10     from rich.console import group
11 except ImportError:
12     from rich.console import render_group as group  # type: ignore
13 
14 from rich.markdown import Markdown
15 from rich.table import Table
16 
17 from ansiblelint.config import PROFILES
18 from ansiblelint.constants import RULE_DOC_URL
19 from ansiblelint.rules import RulesCollection
20 
21 DOC_HEADER = """
22 # Default Rules
23 
24 (lint_default_rules)=
25 
26 Below you can see the list of default rules Ansible Lint use to evaluate playbooks and roles:
27 
28 """
29 
30 _logger = logging.getLogger(__name__)
31 
32 
33 def rules_as_docs(rules: RulesCollection) -> str:
34     """Dump documentation files for all rules, returns only confirmation message.
35 
36     That is internally used for building documentation and the API can change
37     at any time.
38     """
39     result = ""
40     dump_path = Path(".") / "docs" / "rules"
41     if not dump_path.exists():
42         raise RuntimeError(f"Failed to find {dump_path} folder for dumping rules.")
43 
44     with open(dump_path / ".." / "profiles.md", "w", encoding="utf-8") as f:
45         f.write(profiles_as_md(header=True, docs_url="rules/"))
46 
47     for rule in rules.alphabetical():
48         result = ""
49         with open(dump_path / f"{rule.id}.md", "w", encoding="utf-8") as f:
50             # because title == rule.id we get the desired labels for free
51             # and we do not have to insert `(target_header)=`
52             title = f"{rule.id}"
53 
54             if rule.help:
55                 if not rule.help.startswith(f"# {rule.id}"):
56                     raise RuntimeError(
57                         f"Rule {rule.__class__} markdown help does not start with `# {rule.id}` header.\n{rule.help}"
58                     )
59                 result = result[1:]
60                 result += f"{rule.help}"
61             else:
62                 description = rule.description
63                 if rule.link:
64                     description += f" [more]({rule.link})"
65 
66                 result += f"# {title}\n\n**{rule.shortdesc}**\n\n{description}"
67             f.write(result)
68 
69     return "All markdown files for rules were dumped!"
70 
71 
72 def rules_as_str(rules: RulesCollection) -> str:
73     """Return rules as string."""
74     return "\n".join([str(rule) for rule in rules.alphabetical()])
75 
76 
77 def rules_as_md(rules: RulesCollection) -> str:
78     """Return md documentation for a list of rules."""
79     result = DOC_HEADER
80 
81     for rule in rules.alphabetical():
82 
83         # because title == rule.id we get the desired labels for free
84         # and we do not have to insert `(target_header)=`
85         title = f"{rule.id}"
86 
87         if rule.help:
88             if not rule.help.startswith(f"# {rule.id}"):
89                 raise RuntimeError(
90                     f"Rule {rule.__class__} markdown help does not start with `# {rule.id}` header.\n{rule.help}"
91                 )
92             result += f"\n\n{rule.help}"
93         else:
94             description = rule.description
95             if rule.link:
96                 description += f" [more]({rule.link})"
97 
98             result += f"\n\n## {title}\n\n**{rule.shortdesc}**\n\n{description}"
99 
100     return result
101 
102 
103 @group()
104 def rules_as_rich(rules: RulesCollection) -> Iterable[Table]:
105     """Print documentation for a list of rules, returns empty string."""
106     width = max(16, *[len(rule.id) for rule in rules])
107     for rule in rules.alphabetical():
108         table = Table(show_header=True, header_style="title", box=box.MINIMAL)
109         table.add_column(rule.id, style="dim", width=width)
110         table.add_column(Markdown(rule.shortdesc))
111 
112         description = rule.help or rule.description
113         if rule.link:
114             description += f" [(more)]({rule.link})"
115         table.add_row("description", Markdown(description))
116         if rule.version_added:
117             table.add_row("version_added", rule.version_added)
118         if rule.tags:
119             table.add_row("tags", ", ".join(rule.tags))
120         if rule.severity:
121             table.add_row("severity", rule.severity)
122         yield table
123 
124 
125 def profiles_as_md(header: bool = False, docs_url: str = RULE_DOC_URL) -> str:
126     """Return markdown representation of supported profiles."""
127     result = ""
128 
129     if header:
130         result += """<!---
131 Do not manually edit, generated from generate_docs.py
132 -->
133 # Profiles
134 
135 One of the best ways to run `ansible-lint` is by specifying which rule profile
136 you want to use. These profiles stack on top of each other, allowing you to
137 gradually raise the quality bar.
138 
139 To run it with the most strict profile just type `ansible-lint --profile=production`.
140 
141 If you want to consult the list of rules from each profile, type
142 `ansible-lint -P`. For your convenience, we also list the same output below.
143 
144 The rules that have a `*` suffix, are not implemented yet but we documented
145 them with links to their issues.
146 
147 ```{note}
148 Special rule tags such `opt-in` and `experimental` are automatically removed
149 when a rule is included in a profile, directly or indirectly. This means that
150 they will always execute once included.
151 ```
152 
153 """
154 
155     for name, profile in PROFILES.items():
156         extends = ""
157         if profile.get("extends", None):
158             extends = (
159                 f" It extends [{profile['extends']}](#{profile['extends']}) profile."
160             )
161         result += f"## {name}\n\n{profile['description']}{extends}\n"
162         for rule, rule_data in profile["rules"].items():
163             if "[" in rule:
164                 url = f"{docs_url}{rule.split('[')[0]}/"
165             else:
166                 url = f"{docs_url}{rule}/"
167             if not rule_data:
168                 result += f"- [{rule}]({url})\n"
169             else:
170                 result += f"- [{rule}]({rule_data['url']})\n"
171 
172         result += "\n"
173     return result
174 
175 
176 def profiles_as_rich() -> Markdown:
177     """Return rich representation of supported profiles."""
178     return Markdown(profiles_as_md())
179
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/ansiblelint/generate_docs.py b/src/ansiblelint/generate_docs.py
--- a/src/ansiblelint/generate_docs.py
+++ b/src/ansiblelint/generate_docs.py
@@ -132,22 +132,10 @@
 -->
 # Profiles
 
-One of the best ways to run `ansible-lint` is by specifying which rule profile
-you want to use. These profiles stack on top of each other, allowing you to
-gradually raise the quality bar.
-
-To run it with the most strict profile just type `ansible-lint --profile=production`.
-
-If you want to consult the list of rules from each profile, type
-`ansible-lint -P`. For your convenience, we also list the same output below.
-
-The rules that have a `*` suffix, are not implemented yet but we documented
-them with links to their issues.
+Ansible-lint profiles gradually increase the strictness of rules as your Ansible content lifecycle.
 
 ```{note}
-Special rule tags such `opt-in` and `experimental` are automatically removed
-when a rule is included in a profile, directly or indirectly. This means that
-they will always execute once included.
+Rules with `*` in the suffix are not yet implemented but are documented with linked GitHub issues.
 ```
 
 """

{"golden_diff": "diff --git a/src/ansiblelint/generate_docs.py b/src/ansiblelint/generate_docs.py\n--- a/src/ansiblelint/generate_docs.py\n+++ b/src/ansiblelint/generate_docs.py\n@@ -132,22 +132,10 @@\n -->\n # Profiles\n \n-One of the best ways to run `ansible-lint` is by specifying which rule profile\n-you want to use. These profiles stack on top of each other, allowing you to\n-gradually raise the quality bar.\n-\n-To run it with the most strict profile just type `ansible-lint --profile=production`.\n-\n-If you want to consult the list of rules from each profile, type\n-`ansible-lint -P`. For your convenience, we also list the same output below.\n-\n-The rules that have a `*` suffix, are not implemented yet but we documented\n-them with links to their issues.\n+Ansible-lint profiles gradually increase the strictness of rules as your Ansible content lifecycle.\n \n ```{note}\n-Special rule tags such `opt-in` and `experimental` are automatically removed\n-when a rule is included in a profile, directly or indirectly. This means that\n-they will always execute once included.\n+Rules with `*` in the suffix are not yet implemented but are documented with linked GitHub issues.\n ```\n \n \"\"\"\n", "issue": "Docs: Add details for using profiles\n##### Summary\r\n\r\nAs content moves through the automation content creation pipeline, various linting rules that are developed against may or may not apply depending on where the content is being executed.  \r\n\r\nFor example, in development, as a content creator, there should be the ability to create some rules and quickly validate them utilising ansible-lint locally.  Then in the first test run, an ansible-lint profile should allow the executor from ignoring the rules to ensure that the content itself runs as desired.\r\n\r\nUpdate documentation to provide context for using profiles in a more progressive (step-by-step) way with additional context that addresses motivation.\r\n\r\n##### Issue Type\r\n\r\n- Bug Report (Docs)\r\n\r\n##### Ansible and Ansible Lint details\r\n\r\nN/A\r\n\r\n##### OS / ENVIRONMENT\r\n\r\nFedora 36\r\n\r\n##### STEPS TO REPRODUCE\r\n\r\nN/A\r\n\r\n##### Desired Behavior\r\n\r\nN/A\r\n\r\n##### Actual Behavior\r\n\r\nN/A\r\n\n", "before_files": [{"content": "\"\"\"Utils to generate rules documentation.\"\"\"\nimport logging\nfrom pathlib import Path\nfrom typing import Iterable\n\nfrom rich import box\n\n# Remove this compatibility try-catch block once we drop support for rich < 10.7.0\ntry:\n    from rich.console import group\nexcept ImportError:\n    from rich.console import render_group as group  # type: ignore\n\nfrom rich.markdown import Markdown\nfrom rich.table import Table\n\nfrom ansiblelint.config import PROFILES\nfrom ansiblelint.constants import RULE_DOC_URL\nfrom ansiblelint.rules import RulesCollection\n\nDOC_HEADER = \"\"\"\n# Default Rules\n\n(lint_default_rules)=\n\nBelow you can see the list of default rules Ansible Lint use to evaluate playbooks and roles:\n\n\"\"\"\n\n_logger = logging.getLogger(__name__)\n\n\ndef rules_as_docs(rules: RulesCollection) -> str:\n    \"\"\"Dump documentation files for all rules, returns only confirmation message.\n\n    That is internally used for building documentation and the API can change\n    at any time.\n    \"\"\"\n    result = \"\"\n    dump_path = Path(\".\") / \"docs\" / \"rules\"\n    if not dump_path.exists():\n        raise RuntimeError(f\"Failed to find {dump_path} folder for dumping rules.\")\n\n    with open(dump_path / \"..\" / \"profiles.md\", \"w\", encoding=\"utf-8\") as f:\n        f.write(profiles_as_md(header=True, docs_url=\"rules/\"))\n\n    for rule in rules.alphabetical():\n        result = \"\"\n        with open(dump_path / f\"{rule.id}.md\", \"w\", encoding=\"utf-8\") as f:\n            # because title == rule.id we get the desired labels for free\n            # and we do not have to insert `(target_header)=`\n            title = f\"{rule.id}\"\n\n            if rule.help:\n                if not rule.help.startswith(f\"# {rule.id}\"):\n                    raise RuntimeError(\n                        f\"Rule {rule.__class__} markdown help does not start with `# {rule.id}` header.\\n{rule.help}\"\n                    )\n                result = result[1:]\n                result += f\"{rule.help}\"\n            else:\n                description = rule.description\n                if rule.link:\n                    description += f\" [more]({rule.link})\"\n\n                result += f\"# {title}\\n\\n**{rule.shortdesc}**\\n\\n{description}\"\n            f.write(result)\n\n    return \"All markdown files for rules were dumped!\"\n\n\ndef rules_as_str(rules: RulesCollection) -> str:\n    \"\"\"Return rules as string.\"\"\"\n    return \"\\n\".join([str(rule) for rule in rules.alphabetical()])\n\n\ndef rules_as_md(rules: RulesCollection) -> str:\n    \"\"\"Return md documentation for a list of rules.\"\"\"\n    result = DOC_HEADER\n\n    for rule in rules.alphabetical():\n\n        # because title == rule.id we get the desired labels for free\n        # and we do not have to insert `(target_header)=`\n        title = f\"{rule.id}\"\n\n        if rule.help:\n            if not rule.help.startswith(f\"# {rule.id}\"):\n                raise RuntimeError(\n                    f\"Rule {rule.__class__} markdown help does not start with `# {rule.id}` header.\\n{rule.help}\"\n                )\n            result += f\"\\n\\n{rule.help}\"\n        else:\n            description = rule.description\n            if rule.link:\n                description += f\" [more]({rule.link})\"\n\n            result += f\"\\n\\n## {title}\\n\\n**{rule.shortdesc}**\\n\\n{description}\"\n\n    return result\n\n\n@group()\ndef rules_as_rich(rules: RulesCollection) -> Iterable[Table]:\n    \"\"\"Print documentation for a list of rules, returns empty string.\"\"\"\n    width = max(16, *[len(rule.id) for rule in rules])\n    for rule in rules.alphabetical():\n        table = Table(show_header=True, header_style=\"title\", box=box.MINIMAL)\n        table.add_column(rule.id, style=\"dim\", width=width)\n        table.add_column(Markdown(rule.shortdesc))\n\n        description = rule.help or rule.description\n        if rule.link:\n            description += f\" [(more)]({rule.link})\"\n        table.add_row(\"description\", Markdown(description))\n        if rule.version_added:\n            table.add_row(\"version_added\", rule.version_added)\n        if rule.tags:\n            table.add_row(\"tags\", \", \".join(rule.tags))\n        if rule.severity:\n            table.add_row(\"severity\", rule.severity)\n        yield table\n\n\ndef profiles_as_md(header: bool = False, docs_url: str = RULE_DOC_URL) -> str:\n    \"\"\"Return markdown representation of supported profiles.\"\"\"\n    result = \"\"\n\n    if header:\n        result += \"\"\"<!---\nDo not manually edit, generated from generate_docs.py\n-->\n# Profiles\n\nOne of the best ways to run `ansible-lint` is by specifying which rule profile\nyou want to use. These profiles stack on top of each other, allowing you to\ngradually raise the quality bar.\n\nTo run it with the most strict profile just type `ansible-lint --profile=production`.\n\nIf you want to consult the list of rules from each profile, type\n`ansible-lint -P`. For your convenience, we also list the same output below.\n\nThe rules that have a `*` suffix, are not implemented yet but we documented\nthem with links to their issues.\n\n```{note}\nSpecial rule tags such `opt-in` and `experimental` are automatically removed\nwhen a rule is included in a profile, directly or indirectly. This means that\nthey will always execute once included.\n```\n\n\"\"\"\n\n    for name, profile in PROFILES.items():\n        extends = \"\"\n        if profile.get(\"extends\", None):\n            extends = (\n                f\" It extends [{profile['extends']}](#{profile['extends']}) profile.\"\n            )\n        result += f\"## {name}\\n\\n{profile['description']}{extends}\\n\"\n        for rule, rule_data in profile[\"rules\"].items():\n            if \"[\" in rule:\n                url = f\"{docs_url}{rule.split('[')[0]}/\"\n            else:\n                url = f\"{docs_url}{rule}/\"\n            if not rule_data:\n                result += f\"- [{rule}]({url})\\n\"\n            else:\n                result += f\"- [{rule}]({rule_data['url']})\\n\"\n\n        result += \"\\n\"\n    return result\n\n\ndef profiles_as_rich() -> Markdown:\n    \"\"\"Return rich representation of supported profiles.\"\"\"\n    return Markdown(profiles_as_md())\n", "path": "src/ansiblelint/generate_docs.py"}], "after_files": [{"content": "\"\"\"Utils to generate rules documentation.\"\"\"\nimport logging\nfrom pathlib import Path\nfrom typing import Iterable\n\nfrom rich import box\n\n# Remove this compatibility try-catch block once we drop support for rich < 10.7.0\ntry:\n    from rich.console import group\nexcept ImportError:\n    from rich.console import render_group as group  # type: ignore\n\nfrom rich.markdown import Markdown\nfrom rich.table import Table\n\nfrom ansiblelint.config import PROFILES\nfrom ansiblelint.constants import RULE_DOC_URL\nfrom ansiblelint.rules import RulesCollection\n\nDOC_HEADER = \"\"\"\n# Default Rules\n\n(lint_default_rules)=\n\nBelow you can see the list of default rules Ansible Lint use to evaluate playbooks and roles:\n\n\"\"\"\n\n_logger = logging.getLogger(__name__)\n\n\ndef rules_as_docs(rules: RulesCollection) -> str:\n    \"\"\"Dump documentation files for all rules, returns only confirmation message.\n\n    That is internally used for building documentation and the API can change\n    at any time.\n    \"\"\"\n    result = \"\"\n    dump_path = Path(\".\") / \"docs\" / \"rules\"\n    if not dump_path.exists():\n        raise RuntimeError(f\"Failed to find {dump_path} folder for dumping rules.\")\n\n    with open(dump_path / \"..\" / \"profiles.md\", \"w\", encoding=\"utf-8\") as f:\n        f.write(profiles_as_md(header=True, docs_url=\"rules/\"))\n\n    for rule in rules.alphabetical():\n        result = \"\"\n        with open(dump_path / f\"{rule.id}.md\", \"w\", encoding=\"utf-8\") as f:\n            # because title == rule.id we get the desired labels for free\n            # and we do not have to insert `(target_header)=`\n            title = f\"{rule.id}\"\n\n            if rule.help:\n                if not rule.help.startswith(f\"# {rule.id}\"):\n                    raise RuntimeError(\n                        f\"Rule {rule.__class__} markdown help does not start with `# {rule.id}` header.\\n{rule.help}\"\n                    )\n                result = result[1:]\n                result += f\"{rule.help}\"\n            else:\n                description = rule.description\n                if rule.link:\n                    description += f\" [more]({rule.link})\"\n\n                result += f\"# {title}\\n\\n**{rule.shortdesc}**\\n\\n{description}\"\n            f.write(result)\n\n    return \"All markdown files for rules were dumped!\"\n\n\ndef rules_as_str(rules: RulesCollection) -> str:\n    \"\"\"Return rules as string.\"\"\"\n    return \"\\n\".join([str(rule) for rule in rules.alphabetical()])\n\n\ndef rules_as_md(rules: RulesCollection) -> str:\n    \"\"\"Return md documentation for a list of rules.\"\"\"\n    result = DOC_HEADER\n\n    for rule in rules.alphabetical():\n\n        # because title == rule.id we get the desired labels for free\n        # and we do not have to insert `(target_header)=`\n        title = f\"{rule.id}\"\n\n        if rule.help:\n            if not rule.help.startswith(f\"# {rule.id}\"):\n                raise RuntimeError(\n                    f\"Rule {rule.__class__} markdown help does not start with `# {rule.id}` header.\\n{rule.help}\"\n                )\n            result += f\"\\n\\n{rule.help}\"\n        else:\n            description = rule.description\n            if rule.link:\n                description += f\" [more]({rule.link})\"\n\n            result += f\"\\n\\n## {title}\\n\\n**{rule.shortdesc}**\\n\\n{description}\"\n\n    return result\n\n\n@group()\ndef rules_as_rich(rules: RulesCollection) -> Iterable[Table]:\n    \"\"\"Print documentation for a list of rules, returns empty string.\"\"\"\n    width = max(16, *[len(rule.id) for rule in rules])\n    for rule in rules.alphabetical():\n        table = Table(show_header=True, header_style=\"title\", box=box.MINIMAL)\n        table.add_column(rule.id, style=\"dim\", width=width)\n        table.add_column(Markdown(rule.shortdesc))\n\n        description = rule.help or rule.description\n        if rule.link:\n            description += f\" [(more)]({rule.link})\"\n        table.add_row(\"description\", Markdown(description))\n        if rule.version_added:\n            table.add_row(\"version_added\", rule.version_added)\n        if rule.tags:\n            table.add_row(\"tags\", \", \".join(rule.tags))\n        if rule.severity:\n            table.add_row(\"severity\", rule.severity)\n        yield table\n\n\ndef profiles_as_md(header: bool = False, docs_url: str = RULE_DOC_URL) -> str:\n    \"\"\"Return markdown representation of supported profiles.\"\"\"\n    result = \"\"\n\n    if header:\n        result += \"\"\"<!---\nDo not manually edit, generated from generate_docs.py\n-->\n# Profiles\n\nAnsible-lint profiles gradually increase the strictness of rules as your Ansible content lifecycle.\n\n```{note}\nRules with `*` in the suffix are not yet implemented but are documented with linked GitHub issues.\n```\n\n\"\"\"\n\n    for name, profile in PROFILES.items():\n        extends = \"\"\n        if profile.get(\"extends\", None):\n            extends = (\n                f\" It extends [{profile['extends']}](#{profile['extends']}) profile.\"\n            )\n        result += f\"## {name}\\n\\n{profile['description']}{extends}\\n\"\n        for rule, rule_data in profile[\"rules\"].items():\n            if \"[\" in rule:\n                url = f\"{docs_url}{rule.split('[')[0]}/\"\n            else:\n                url = f\"{docs_url}{rule}/\"\n            if not rule_data:\n                result += f\"- [{rule}]({url})\\n\"\n            else:\n                result += f\"- [{rule}]({rule_data['url']})\\n\"\n\n        result += \"\\n\"\n    return result\n\n\ndef profiles_as_rich() -> Markdown:\n    \"\"\"Return rich representation of supported profiles.\"\"\"\n    return Markdown(profiles_as_md())\n", "path": "src/ansiblelint/generate_docs.py"}]}