Last 12 weeks · 84 commits
3 of 6 standards met
This PR refactors the directory traversal logic in WorkerState to improve readability and maintainability. Previously, the evaluation of filtering constraints (depth, patterns, extensions, size, time) was implemented as a large block of inline conditionals within the core walk loop. This change extracts that logic into a dedicated EntryFilter struct, cleanly separating the traversal mechanics from the filtering rules. All existing traversal behavior and the execution order of the filter checks are strictly preserved. Changes This PR cleans up the walk entry processing so the main loop is easier to read and reason about. Moved file filtering logic into a new helper, with separate methods for pattern, size, owner, and other checks. Added to handle conversion, broken symlink recovery, and walker errors outside of the main loop. Moved Unix-specific owner-check logic into , keeping the main path less cluttered with platform-specific conditionals.
use to inspect the insted of pattern matching on . This avoids relying on the implementation of ignore and how it organizes the error. In particular, this would allow us to handle if the IO error was wrapped in a , as would be the case if BurntSushi/ripgrep#3458 was merged. This also allows us to remove some duplicate code.
Repository: sharkdp/fd. Description: A simple, fast and user-friendly alternative to 'find' Stars: 43596, Forks: 1083. Primary language: Rust. Languages: Rust (93%), Shell (6.2%), Makefile (0.6%), Awk (0.2%). License: Apache-2.0. Topics: cli, command-line, filesystem, hacktoberfest, regex, rust, search, terminal, tool. Latest release: v10.4.2 (3mo ago). Open PRs: 51, open issues: 125. Last activity: 13h ago. Community health: 85%. Top contributors: sharkdp, tmccombs, dependabot[bot], tavianator, reima, alexmaco, jcaplan, marionebl, FallenWarrior2k, mmstick and others.