Skip to content

Commit 7493fba

Browse files
authored
docs: usage-focused command help texts (#18)
Add help text for command groups ----------------------------------- * dependencies * voldemort * expensive-loop Improve help text for `create` commands ----------------------------------------- Create rule with <x> template => Create rule to <achieve a goal> how => what Fix README -------------- fix: order of paragraphs in the README version 0.6.1
1 parent 588a62d commit 7493fba

File tree

9 files changed

+43
-20
lines changed

9 files changed

+43
-20
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.6.1] - 2023-03-05
11+
12+
### Added
13+
14+
* Help for command groups.
15+
16+
### Updated
17+
18+
* Help for `create` commands: more usage-focused
19+
20+
### Fixed
21+
22+
* README: order of paragraphs
23+
1024
## [0.6.0] - 2023-02-16
1125

1226
### Added

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,6 @@ Loops often cause performance problems. Especially, if they execute expensive op
142142
sourcery-rules expensive-loop create
143143
```
144144

145-
## Using the Generated Rules
146-
147-
The generated rules can be used by Sourcery to review your project.
148-
If you copy the generated rules into your project's `.sourcery.yaml`, Sourcery will use them automatically.
149-
150-
All the generated rules have the tag `architecture`. Once you've copied them to your `.sourcery.yaml`, you can run them with:
151-
152-
```
153-
sourcery review --enable architecture .
154-
```
155-
156145
You'll be prompted to provide:
157146

158147
* the fully qualified name of the function that shouldn't be called in loops
@@ -163,3 +152,14 @@ You'll be prompted to provide:
163152

164153
* for `for` loops
165154
* for `while` loops
155+
156+
## Using the Generated Rules
157+
158+
The generated rules can be used by Sourcery to review your project.
159+
If you copy the generated rules into your project's `.sourcery.yaml`, Sourcery will use them automatically.
160+
161+
All the generated rules have the tag `architecture`. Once you've copied them to your `.sourcery.yaml`, you can run them with:
162+
163+
```
164+
sourcery review --enable architecture .
165+
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "sourcery-rules-generator"
3-
version = "0.6.0"
3+
version = "0.6.1"
44
description = "Generate architecture rules for Python projects."
55
license = "MIT"
66
authors = ["reka <[email protected]>"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.6.0"
1+
__version__ = "0.6.1"

sourcery_rules_generator/cli/cli.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@
1212
from sourcery_rules_generator import __version__
1313

1414
app = typer.Typer(rich_markup_mode="markdown")
15-
app.add_typer(dependencies_cli.app, name="dependencies")
16-
app.add_typer(voldemort_cli.app, name="voldemort")
17-
app.add_typer(expensive_loop_cli.app, name="expensive-loop")
15+
app.add_typer(
16+
dependencies_cli.app, name="dependencies", help="Detect not allowed imports."
17+
)
18+
app.add_typer(voldemort_cli.app, name="voldemort", help="Detect deny-listed words.")
19+
app.add_typer(
20+
expensive_loop_cli.app,
21+
name="expensive-loop",
22+
help="Detect expensive calls in loops.",
23+
)
1824

1925

2026
@app.callback(invoke_without_command=True)

sourcery_rules_generator/cli/dependencies_cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ def create(
5656
help='Display less info about the "Dependencies" template.',
5757
),
5858
):
59-
"""Create a new Sourcery dependency rule."""
59+
"""Create rules to check the dependencies between packages of a project.
60+
61+
Create rules to verify that internal and external packages are imported only by the allowed parts of a project.
62+
"""
6063
interactive = sys.stdin.isatty() and interactive_flag
6164
stderr_console = Console(stderr=True)
6265
if interactive and not quiet:

sourcery_rules_generator/cli/expensive_loop_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def create(
5050
help='Display less info about the "Expensive Loop" template.',
5151
),
5252
):
53-
"""Create a new Sourcery Expensive Loop rule."""
53+
"""Create a rule to detect an expensive call in a loop."""
5454
interactive = sys.stdin.isatty() and interactive_flag
5555
stderr_console = Console(stderr=True)
5656
if interactive and not quiet:

sourcery_rules_generator/cli/voldemort_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def create(
5050
help='Display less info about the "Voldemort" template.',
5151
),
5252
):
53-
"""Create a new Sourcery Voldemort rule."""
53+
"""Create a rule to flag a deny-listed word."""
5454
interactive = sys.stdin.isatty() and interactive_flag
5555
stderr_console = Console(stderr=True)
5656
if interactive and not quiet:

tests/test_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
def test_version():
5-
assert __version__ == "0.6.0"
5+
assert __version__ == "0.6.1"

0 commit comments

Comments
 (0)