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 file type filters #698

Merged
merged 9 commits into from
Apr 10, 2024

Conversation

mrexox
Copy link
Member

@mrexox mrexox commented Apr 9, 2024

Closes #617
Closes #76

⚡ Summary

  • Add a new option for commands to apply filters on file types (file_types)
    • Type filters are applied using AND
  • Provide some basic file types filtering
    • text
    • binary
    • executable
    • not executable
    • symlink
    • not symlink
  • Handle issues when detecting file types -> log the error and skip those files
  • Add unit tests
  • Add integrity tests
  • Add docs

Example usage

pre-commit:
  commands:
    lint:
      run: yarn lint --fix {staged_files}
      file_types: 
        - not executable
        - text

@mrexox mrexox force-pushed the feat/add-file-type-filters branch from a5ca6a4 to 1289170 Compare April 10, 2024 08:38
@mrexox mrexox force-pushed the feat/add-file-type-filters branch 2 times, most recently from ef04c8e to 2c9d2dd Compare April 10, 2024 12:20
@mrexox mrexox force-pushed the feat/add-file-type-filters branch from 2c9d2dd to 8dd5d55 Compare April 10, 2024 12:23
@mrexox mrexox marked this pull request as ready for review April 10, 2024 12:45
@mrexox mrexox merged commit 9f40122 into evilmartians:master Apr 10, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add a filter to extract text files Skip symlinks?
1 participant