Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for sndhdr audio file tests and enhances text type detection with dynamic checks for version 2.0.0b5. The changes include significant refactoring of internal functions from private (underscore-prefixed) to public names, new scanner implementations, and improved test coverage.
Key Changes:
- Added new
sndhdr_scannerfor audio file detection - Enhanced text scanner with CSV detection and format-specific checks
- Improved Python scanner with better code pattern recognition
- Added JSON array support to json_scanner
- Refactored internal functions to use public naming
- Added new test cases for audio formats and dynamic text types
Reviewed changes
Copilot reviewed 13 out of 28 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test_scanners.py | Added sndhdr scanner tests and updated text scanner assertions to use lowercase text type names |
| test/test_main.py | Removed deprecated imghdr compatibility tests |
| test/test_common_extensions.py | Updated function calls to match renamed public API |
| test/resources/system/test_list.json | Added test JSON file with array structure |
| test/resources/audio/*.mp3 | Added MP3 test files for audio detection |
| test/resources/audio/test.sndr | Added SNDR format test file |
| test/resources/audio/test.opus | Added Opus format test file |
| pyproject.toml | Disabled black and flake8 linting in favor of Ruff |
| puremagic/scanners/text_scanner.py | Major refactoring with CSV detection and dynamic format checks |
| puremagic/scanners/sndhdr_scanner.py | New scanner for audio formats |
| puremagic/scanners/python_scanner.py | Enhanced Python code detection with keyword/pattern matching |
| puremagic/scanners/json_scanner.py | Added support for JSON arrays |
| puremagic/main.py | Version bump, function renames, new scanner integration, error type changes |
| CHANGELOG.md | Updated with issue #85 reference |
| .gitignore | Added VS Code exclusions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sndhdr.what()andsndhdr.whathdr()#85 Version 2.0 Goals #70 Variant field in magic.json? #69 Some common filetypes are not detected #12 Integrate advanced file scanning techniques #3