Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ As of now, the library implements a subset of ripgrep's functionality. The main
3. `globs`: File patterns to include or exclude
4. `sort`: Sort mode for search results
5. `max_count`: Maximum number of matches to show
6. `case_sensitive`: Control case sensitivity
7. `smart_case`: Enable smart case matching
8. `no_ignore`: Disable gitignore/ignore file handling
9. `hidden`: Search hidden files and directories

## Implemented Flags

Expand All @@ -89,6 +93,12 @@ The following is a checklist of ripgrep flags that have been implemented in this
- [x] `separator_field_match`: (Optional) Separator between fields in matching lines
- [x] `separator_context`: (Optional) Separator between context lines
- [x] `-U, --multiline`: Enable matching across multiple lines
- [x] `-i, --ignore-case`: Case insensitive search (via `case_sensitive=False`)
- [x] `-s, --case-sensitive`: Case sensitive search (via `case_sensitive=True`)
- [x] `-S, --smart-case`: Smart case search (via `smart_case=True`)
- [x] `--no-ignore`: Don't respect ignore files (via `no_ignore=True`)
- [x] `--hidden`: Search hidden files and directories (via `hidden=True`)
- [x] `--json`: Output results in JSON Lines format (via `json=True`)

The following flags from ripgrep are not yet implemented in this wrapper:

Expand All @@ -99,22 +109,18 @@ The following flags from ripgrep are not yet implemented in this wrapper:
- [ ] `--dfa-size-limit`: Limit for regex DFA size
- [ ] `-E, --encoding`: Specify the text encoding of files to search
- [ ] `-F, --fixed-strings`: Treat patterns as literal strings
- [ ] `-i, --ignore-case`: Case insensitive search
- [ ] `-v, --invert-match`: Invert matching
- [ ] `-n, --line-number`: Show line numbers
- [ ] `-x, --line-regexp`: Only show matches surrounded by line boundaries
- [ ] `-M, --max-columns`: Don't print lines longer than this limit
- [ ] `--mmap`: Memory map searched files when possible
- [ ] `--no-ignore`: Don't respect ignore files
- [ ] `--no-unicode`: Disable Unicode-aware search
- [ ] `-0, --null`: Print NUL byte after file names
- [ ] `-o, --only-matching`: Print only matched parts of a line
- [ ] `--passthru`: Print both matching and non-matching lines
- [ ] `-P, --pcre2`: Use the PCRE2 regex engine
- [ ] `-p, --pretty`: Alias for --color=always --heading -n
- [ ] `-r, --replace`: Replace matches with the given text
- [ ] `-S, --smart-case`: Smart case search
- [ ] `-s, --case-sensitive`: Case sensitive search
- [ ] `--stats`: Print statistics about the search
- [ ] `-a, --text`: Search binary files as if they were text
- [ ] `-t, --type`: Only search files matching TYPE
Expand Down
10 changes: 10 additions & 0 deletions python_ripgrep/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ def search(
max_count: int | None = None,
line_number: bool | None = None,
multiline: bool | None = None,
case_sensitive: bool | None = None,
smart_case: bool | None = None,
no_ignore: bool | None = None,
hidden: bool | None = None,
json: bool | None = None,
) -> list[str]: ...
def files(
patterns: list[str],
Expand All @@ -41,4 +46,9 @@ def files(
max_count: int | None = None,
line_number: bool | None = None,
multiline: bool | None = None,
case_sensitive: bool | None = None,
smart_case: bool | None = None,
no_ignore: bool | None = None,
hidden: bool | None = None,
json: bool | None = None,
) -> list[str]: ...
Loading