Skip to content

Commit 06628f4

Browse files
committed
rename to rewrite-keys
1 parent 3c03550 commit 06628f4

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/idom/__main__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import click
22

33
import idom
4-
from idom._console.rewrite_key_declarations import rewrite_key_declarations
4+
from idom._console.rewrite_keys import rewrite_keys
55

66

77
@click.group()
@@ -10,7 +10,7 @@ def app() -> None:
1010
pass
1111

1212

13-
app.add_command(rewrite_key_declarations)
13+
app.add_command(rewrite_keys)
1414

1515

1616
if __name__ == "__main__":

src/idom/_console/rewrite_key_declarations.py renamed to src/idom/_console/rewrite_keys.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
@click.command()
2323
@click.argument("paths", nargs=-1, type=click.Path(exists=True))
24-
def rewrite_key_declarations(paths: list[str]) -> None:
24+
def rewrite_keys(paths: list[str]) -> None:
2525
"""Rewrite files under the given paths using the new html element API.
2626
2727
The old API required users to pass a dictionary of attributes to html element

tests/test__console/test_rewrite_key_declarations.py renamed to tests/test__console/test_rewrite_keys.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
import pytest
66
from click.testing import CliRunner
77

8-
from idom._console.rewrite_key_declarations import (
9-
generate_rewrite,
10-
rewrite_key_declarations,
11-
)
8+
from idom._console.rewrite_keys import generate_rewrite, rewrite_keys
129

1310

1411
if sys.version_info < (3, 9):
@@ -21,7 +18,7 @@ def test_rewrite_key_declarations(tmp_path):
2118
tempfile: Path = tmp_path / "temp.py"
2219
tempfile.write_text("html.div(key='test')")
2320
result = runner.invoke(
24-
rewrite_key_declarations,
21+
rewrite_keys,
2522
args=[str(tmp_path)],
2623
catch_exceptions=False,
2724
)
@@ -34,7 +31,7 @@ def test_rewrite_key_declarations_no_files():
3431
runner = CliRunner()
3532

3633
result = runner.invoke(
37-
rewrite_key_declarations,
34+
rewrite_keys,
3835
args=["directory-does-no-exist"],
3936
catch_exceptions=False,
4037
)

0 commit comments

Comments
 (0)