Skip to content

Commit

Permalink
Fix renaming in function definition
Browse files Browse the repository at this point in the history
  • Loading branch information
kam193 committed Oct 13, 2024
1 parent ea1476a commit aab4320
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ASTGrep/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ AL_SERVICE_NAME=ASTGrep
test-dependencies:
pip install tox
sudo apt-get install -y libfuzzy-dev

test-quick:
WORK_DIR=$$(pwd) tox -c ../tox.ini -- -m 'not slow'
2 changes: 2 additions & 0 deletions ASTGrep/rules/templates/python-rename-identifier.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ rule:
has:
stopBy: end
pattern: {{RENAMED}}
- inside:
kind: function_definition
fix: {{ORIGINAL}}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ script.something("aaaa")
invoke("aaaa")

def aaa():
invoke("aaaa")
invoke("aaaa")

def script(other: str):
pass
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ bitcoin.core.script.something("aaaa")
something("aaaa")

def aaa():
something("aaaa")
something("aaaa")

def script(other: str):
pass

0 comments on commit aab4320

Please sign in to comment.