Repository navigation
Develop - #1
Merged
Merged
Develop#1
Conversation
Replay rewrites in graph order against a live namespace to catch collisions that the application order would cause, fold case on case-insensitive volumes, and reject output that resolves to a skip-name.
…ation to occur after validity checks
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.
This pull request introduces several improvements and stricter validation to the
prouterrouting system, with a focus on robust error handling, collision detection, and clearer documentation. The most significant changes include stricter validation of route patterns, a new case-insensitive collision check for filesystems, improved error messages and exception types, and comprehensive tests for edge cases.Major improvements and validation changes:
Stricter validation and error handling:
ValueErrortoFileNotFoundErrorandFileExistsErrorrespectively, providing more precise error reporting. [1] [2] [3]Pathobjects, raising clear exceptions for violations.Filesystem collision detection:
_detect_case_insensitivemethod to determine if the underlying filesystem is case-insensitive (e.g., APFS, HFS+, NTFS), and replayed all planned renames in order to catch any namespace collisions, including those caused by case-only differences. [1] [2]Save operation validation:
savemethod now raises exceptions if called before building the graph, if routes are undefined, or if required files already exist, making the workflow safer and more predictable. [1] [2]Documentation and configuration:
Improved documentation and usage examples:
README.mdto clarify that the tool never modifies the filesystem, expanded explanations for route patterns, handler constraints, and error cases. [1] [2]Pattern configuration:
pyproject.tomlfor use in shredguard pattern matching.Testing:
GraphBuilder:tests/test_graph_builder.pycovers initialization, route addition, collision detection, handler constraints, ambiguous matches, and save logic, ensuring all edge cases and error conditions are exercised.