Skip to content

Commit 2aba85e

Browse files
Merge pull request #36 from LukasNiessen/codex/docs-hygiene
docs: tidy examples and completed backlog items
2 parents 839ac8e + 85e41c3 commit 2aba85e

6 files changed

Lines changed: 17 additions & 17 deletions

File tree

‎BACKLOG.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This backlog collects product and maintenance ideas from project research.
1919
## P1 - Python Import Semantics
2020

2121
- Add support for namespace packages that do not contain `__init__.py`.
22-
- Detect dynamic imports such as `importlib.import_module()` and `__import__()`.
22+
- [x] Detect dynamic imports such as `importlib.import_module()` and `__import__()`.
2323
- Detect conditional imports such as `try/except ImportError`.
2424
- Add better `TYPE_CHECKING` import handling, including options to ignore, include, or report type-only imports separately.
2525
- Improve external dependency rules so users can express allowed and forbidden third-party packages at module or slice level.
@@ -30,12 +30,12 @@ This backlog collects product and maintenance ideas from project research.
3030
- Add comprehensive HTML reports with dependency graphs, metric charts, and zone visualization.
3131
- Auto-generate architecture documentation based on tests and rule rationales.
3232
- Make logged paths clickable in IDEs and common terminal integrations.
33-
- Add PlantUML or Mermaid export for discovered architecture graphs.
33+
- [x] Add PlantUML or Mermaid export for discovered architecture graphs.
3434
- Improve metric export examples and document how metric thresholds should be selected.
3535

3636
## P2 - Rule Surface
3737

38-
- Add first-class layered architecture helpers so common clean/hexagonal/layered rules require less boilerplate.
38+
- [x] Add first-class layered architecture helpers so common clean/hexagonal/layered rules require less boilerplate.
3939
- Add slice isolation helpers for bounded contexts and modular monoliths.
4040
- Add richer custom rule hooks for dependency edges, files, classes, and metrics.
4141
- Add transitive dependency checks, especially for "domain must not transitively reach infrastructure" style rules.
@@ -56,7 +56,7 @@ This backlog collects product and maintenance ideas from project research.
5656

5757
## P3 - Packaging And Docs
5858

59-
- Publish to PyPI as part of the release pipeline if this is not already automated.
59+
- [x] Publish to PyPI as part of the release pipeline if this is not already automated.
6060
- Add a Sphinx or MkDocs documentation site.
6161
- Add a complete example repository or examples folder covering pytest, unittest, PlantUML, metrics, and CI.
6262
- Add contribution guidance for new rule types and metric implementations.

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,13 +479,13 @@ from archunitpython import project_graph
479479
def test_export_dependency_graph_reports():
480480
graph = project_graph("src/requests").titled("Application Architecture")
481481

482-
graph.collapse_to_folder_depth(2).export_as_mermaid("reports/dependencies.md")
482+
graph.collapse_to_folder_depth(2).export_as_mermaid("reports/dependencies.mmd")
483483

484484
if __name__ == "__main__":
485485
test_export_dependency_graph_reports()
486486
```
487-
**Exported mermaid diagram**
488-
``` mermaid
487+
**Exported Mermaid diagram**
488+
```mermaid
489489
flowchart LR
490490
n0["__init__.py"]
491491
n1["__version__.py"]

‎src/archunitpython/files/assertion/custom_file_logic.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def gather_custom_file_violations(
7272
nodes: All projected nodes.
7373
condition: Custom function that returns True if the file passes.
7474
message: Message to include in violation.
75-
is_negated: If False (should adhere), violation when condition returns False.
76-
If True (shouldNot adhere), violation when condition returns True.
75+
is_negated: If False (positive assertion), violation when condition returns False.
76+
If True (negated assertion), violation when condition returns True.
7777
pre_filters: Filters to apply before checking the condition.
7878
7979
Returns:
@@ -90,7 +90,7 @@ def gather_custom_file_violations(
9090
result = condition(file_info)
9191

9292
if is_negated:
93-
# shouldNot: violation if condition IS True
93+
# Negated assertion: violation if condition IS True
9494
if result:
9595
violations.append(CustomFileViolation(message=message, file_info=file_info))
9696
else:

‎src/archunitpython/files/assertion/depend_on_files.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ def gather_depend_on_file_violations(
3030
edges: Projected dependency edges.
3131
subject_filters: Patterns for the source files (subject of the rule).
3232
object_filters: Patterns for the target files (dependency targets).
33-
is_negated: If False (should), files matching subject MUST depend on
33+
is_negated: If False (`should()`), files matching subject MUST depend on
3434
files matching object.
35-
If True (shouldNot), files matching subject must NOT
35+
If True (`should_not()`), files matching subject must NOT
3636
depend on files matching object.
3737
3838
Returns:
@@ -48,7 +48,7 @@ def gather_depend_on_file_violations(
4848
target_matches = all(matches_pattern(edge.target_label, f) for f in object_filters)
4949

5050
if is_negated:
51-
# shouldNot: violation if dependency EXISTS
51+
# should_not(): violation if dependency EXISTS
5252
if target_matches:
5353
violations.append(ViolatingFileDependency(dependency=edge, is_negated=True))
5454
else:

‎src/archunitpython/files/assertion/matching_files.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def gather_regex_matching_violations(
2929
Args:
3030
nodes: Files to check.
3131
check_filters: Patterns to match against.
32-
is_negated: If False (should), files MUST match all patterns.
33-
If True (shouldNot), files must NOT match any pattern.
32+
is_negated: If False (`should()`), files MUST match all patterns.
33+
If True (`should_not()`), files must NOT match any pattern.
3434
3535
Returns:
3636
List of violations.
@@ -41,7 +41,7 @@ def gather_regex_matching_violations(
4141
for filter_ in check_filters:
4242
matched = matches_pattern(node.label, filter_)
4343
if is_negated:
44-
# shouldNot: violation if file DOES match
44+
# should_not(): violation if file DOES match
4545
if matched:
4646
violations.append(
4747
ViolatingNode(

‎src/archunitpython/slices/assertion/admissible_edges.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def gather_violations(
3030
edges: list[ProjectedEdge],
3131
rules: list[Rule],
3232
) -> list[Violation]:
33-
"""Check for forbidden dependencies (used with shouldNot).
33+
"""Check for forbidden dependencies (used with `should_not()`).
3434
3535
Args:
3636
edges: Projected dependency edges between slices.

0 commit comments

Comments
 (0)