Skip to content

Commit

Permalink
Rename --ignore-patterns to --ignore, refs #1
Browse files Browse the repository at this point in the history
I did this by hand, did not use Claude for once.
  • Loading branch information
simonw committed Apr 8, 2024
1 parent f8af0fa commit 4407ac5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion files_to_prompt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ def process_path(
help="Ignore .gitignore files and include all files",
)
@click.option(
"--ignore-patterns",
"ignore_patterns",
"--ignore",
multiple=True,
default=[],
help="List of patterns to ignore",
Expand Down
6 changes: 2 additions & 4 deletions tests/test_files_to_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,13 @@ def test_ignore_patterns(tmpdir):
with open("test_dir/file_to_include.txt", "w") as f:
f.write("This file should be included")

result = runner.invoke(cli, ["test_dir", "--ignore-patterns", "*.txt"])
result = runner.invoke(cli, ["test_dir", "--ignore", "*.txt"])
assert result.exit_code == 0
assert "test_dir/file_to_ignore.txt" not in result.output
assert "This file should be ignored due to ignore patterns" not in result.output
assert "test_dir/file_to_include.txt" not in result.output

result = runner.invoke(
cli, ["test_dir", "--ignore-patterns", "file_to_ignore.*"]
)
result = runner.invoke(cli, ["test_dir", "--ignore", "file_to_ignore.*"])
assert result.exit_code == 0
assert "test_dir/file_to_ignore.txt" not in result.output
assert "This file should be ignored due to ignore patterns" not in result.output
Expand Down

0 comments on commit 4407ac5

Please sign in to comment.