feat: add .ts_ignore pattern ignoring system (#897)

* feat: add `.ts_ignore` pattern ignoring system

* fix: add wcmatch dependency

* search: add ".TemporaryItems" to GLOBAL_IGNORE

* add `desktop.ini` and `.localized` to global ignore

* add ".fhdx" and ".ts" filetypes

* chore: remove logging statement

* chore: format with ruff

* feat: use ripgrep for scanning if available

* docs: add ignore.md

* search: remove ts_ignore filtering on queries

* feat: detect if files are added but ignored

* fix: render edges on all unlinked thumbs

* perf: don't search for cached unlinked thumbs

* fix(ui): ensure newlines in file stats

* fix: use ignore_to_glob for wcmatch

* fix(tests): remove inconsistent test

The test hinged on the timing of refresh_dir()'s yield's rather than actual values

* ui: change ignored icon and color
This commit is contained in:
Travis Abendshien
2025-08-21 15:50:59 -07:00
committed by GitHub
parent d00546d5fe
commit 0e7a2dfd3d
23 changed files with 911 additions and 87 deletions

View File

@@ -7,7 +7,7 @@ CWD = Path(__file__).parent
def test_refresh_dupe_files(library):
library.library_dir = "/tmp/"
library.library_dir = Path("/tmp/")
entry = Entry(
folder=library.folder,
path=Path("bar/foo.txt"),

View File

@@ -19,8 +19,6 @@ def test_refresh_new_files(library, exclude_mode):
library.included_files.clear()
(library.library_dir / "FOO.MD").touch()
# When
assert len(list(registry.refresh_dir(library.library_dir))) == 1
# Then
# Test if the single file was added
list(registry.refresh_dir(library.library_dir, force_internal_tools=True))
assert registry.files_not_in_library == [Path("FOO.MD")]

View File

@@ -1,12 +1,16 @@
import pytest
import structlog
from tagstudio.core.library.alchemy.enums import BrowsingState
from tagstudio.core.library.alchemy.library import Library
from tagstudio.core.query_lang.util import ParsingError
logger = structlog.get_logger()
def verify_count(lib: Library, query: str, count: int):
results = lib.search_library(BrowsingState.from_search_query(query), page_size=500)
logger.info("results", entry_ids=results.ids, count=results.total_count)
assert results.total_count == count
assert len(results.ids) == count