Skip to content

Commit d6738d6

Browse files
committed
Housekeeping
1 parent 78e83a4 commit d6738d6

2 files changed

Lines changed: 27 additions & 12 deletions

File tree

.isort.cfg

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[settings]
2+
combine_as_imports=true
3+
force_alphabetical_sort_within_sections=true
4+
from_first=true
5+
honor_noqa=true
6+
indent=' '
7+
line_length=120
8+
lines_after_imports=1
9+
lines_between_types=0
10+
multi_line_output=4
11+
no_sections=true
12+
skip=__init__.py
13+
use_parentheses=true
14+
overwrite_in_place=true
15+
# line_ending='\n'

astToolkit/_toolThen.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
import ast
55

66
class Then:
7-
"""Action functions for AST node transformations in the antecedent-action pattern.
8-
9-
(AI generated docstring)
10-
11-
Provides action functions that serve as consequents in the antecedent-action pattern, working with visitor classes like
12-
`NodeTourist` and `NodeChanger` as the `doThat` parameter. Each method returns a function that performs a specific operation
13-
on AST nodes identified by predicate functions from classes like `IfThis` or `Be`.
14-
15-
The action functions fall into five categories: collection operations for gathering nodes, identity operations for extraction
16-
without modification, insertion operations for adding nodes relative to existing ones, removal operations for deletion, and
17-
replacement operations for substitution. These actions enable precise AST transformations while maintaining the composable
18-
nature of the toolkit's architecture.
7+
"""Apply an action to a `node`, especially in the antecedent-action pattern of `NodeTourist` and `NodeChanger`.
8+
9+
Keep the `node`:
10+
- `appendTo()` a list your provide.
11+
- `extractIt()` as a return value.
12+
- `updateKeyValueIn()` a dictionary you provide.
13+
14+
Change the `node`:
15+
- `insertThisAbove()` the `node`.
16+
- `insertThisBelow()` the `node`.
17+
- `removeIt()`.
18+
- `replaceWith()` an `ast.AST` or appropriate `object`.
1919
2020
"""
2121

0 commit comments

Comments
 (0)