Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add .ts_ignore pattern ignoring system #897

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

CyanVoxel
Copy link
Member

@CyanVoxel CyanVoxel commented Mar 30, 2025

Summary

Replaces the existing "File Extension List" inclusion/exclusion system with a more comprehensive ".gitignore" style pattern ignoring system. The built-in GLOBAL_IGNORE_SET has also been replaced with this same pattern-matching system, both for directory scanning and query filtering. This PR also adds the ability for TagStudio to traverse symlinks (not tested on Windows) and Unix hidden folders. I was originally planning on those changes to be in a separate PR, but most of the code overlapped with these changes and ended up amounting to a couple of flags passed to the wcmatch glob function.

How to Use

  1. Create a .ts_ignore text file located directly inside the .TagStudio folder of one of your libraries (library can be open!)
  2. Use .gitignore-style pattern formats to exclude files and folders, with each pattern being on a new line.
  3. Save the file and refresh your TagStudio directories and/or search to test the patterns. The file can be edited live, with changes reflected in subsequent searches and scans.

Example .ts_ignore file:

# TagStudio .ts_ignore file.

# Code
__pycache__
.pytest_cache
.venv
.vs

# Projects
Minecraft/**/Metadata
Minecraft/Website
!Minecraft/Website/*.png
!Minecraft/Website/*.css

# Documents
*.doc
*.docx
*.ppt
*.pptx
*.xls
*.xlsx

TODO

  • Remove extension list feature, generate .ts_ignore file from existing configurations
  • Add frontend .ts_ignore editor
  • Add documentation
  • Add tests
  • Test for character escaping

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

Closes #14, Closes #624.

@CyanVoxel CyanVoxel added Type: Enhancement New feature or request TagStudio: Library Relating to the TagStudio library system Priority: Medium An issue that shouldn't be be saved for last Type: File System File system interactions TagStudio: Search The TagStudio search engine labels Mar 30, 2025
@CyanVoxel CyanVoxel moved this to 🚧 In progress in TagStudio Development Mar 30, 2025
@CyanVoxel CyanVoxel added this to the Alpha v9.5.3 milestone Mar 30, 2025
@CyanVoxel CyanVoxel force-pushed the ts-ignore branch 3 times, most recently from c3ed430 to c713184 Compare March 31, 2025 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium An issue that shouldn't be be saved for last TagStudio: Library Relating to the TagStudio library system TagStudio: Search The TagStudio search engine Type: Enhancement New feature or request Type: File System File system interactions
Projects
Status: 🚧 In progress
Development

Successfully merging this pull request may close these issues.

[Feature Request]: GitIngnore style exclusion Ignore folders and file patterns
1 participant