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

Add include/exclude extensions options #262

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KendallHarterAtWork
Copy link
Collaborator

Summary

If merged this pull request will add options for having lists of file extensions to include and exclude. This resolves #239.

Proposed changes

Adds includeFileExts and excludeFileExts options to the configuration file which are lists of file extensions to forcibly include/exclude.

Comment on lines +434 to +437
if not entry.includeFileExts:
entry.includeFileExts = []
if not entry.excludeFileExts:
entry.excludeFileExts = []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was debating if the check should happen in surfactant/filetypeid/id_extension.py -- but I think this is the only place that makes sense, since it needs to be able to exclude files by extension even if they were identified by something like magic bytes.

We could perhaps expand Exts to Extensions, though Ext is a common enough abbreviation.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only other thought I have about this is should we add a core config setting that lets a user set a default list of include/exclude file exts?

@nightlark nightlark added the enhancement New feature or request label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add file extension identification config options
2 participants