Skip to content

Skip symlinks when scanning files and directories#24

Merged
AzisK merged 1 commit intomainfrom
Skip-scanning-symlinks
Nov 30, 2025
Merged

Skip symlinks when scanning files and directories#24
AzisK merged 1 commit intomainfrom
Skip-scanning-symlinks

Conversation

@AzisK
Copy link
Copy Markdown
Owner

@AzisK AzisK commented Nov 29, 2025

Added a check to skip symbolic links during file scanning to prevent double counting and potential infinite loops.

Added a check to skip symbolic links during file scanning to prevent double counting and potential infinite loops.
@github-actions
Copy link
Copy Markdown

⸜(。˃ ᵕ ˂ )⸝♡ Thank you for opening this Pull Request, AzisK!

( ˶°ㅁ°) !! It's Trivia Time!

Here are 3 trivia questions to keep you entertained while CI runs.
(Feel free to demonstrate your knowledge and reply!)

🧩 Q1: What is the weight of a Gold Bar in Fallout: New Vegas?

A) 30 Pounds
B) 40 Pounds
C) 32.50 Pounds
D) 35 Pounds

🧩 Q2: If someone said "you are olid", what would they mean?

A) You are out of shape/weak.
B) Your appearance is repulsive.
C) You are incomprehensible/an idiot.
D) You smell extremely unpleasant.

🧩 Q3: What is the name given to layer 4 of the Open Systems Interconnection (ISO) model?

A) Transport
B) Session
C) Data link
D) Network

You got this! Remember, every bug is just a feature in disguise.

@github-actions
Copy link
Copy Markdown

This pull request is concise, and it introduces a critical enhancement to the existing code by handling symbolic links correctly to prevent double counting and infinite loops during file and directory scans. Let's dive into the review:

Positives and Applause:

  1. Correctness and Clarity: The addition of the check is a simple, precise, and elegant solution to the problem described in the PR. It directly addresses the issue while integrating smoothly into the existing codebase. Great job!

  2. Pragmatic Approach: By using from Python's module, you have leveraged a clean and readable approach to ensure this check is handled effectively without adding unnecessary complexity. Kudos for choosing the right method here!

  3. Preventing Issues: The change reflects that you clearly identified a potential source of bugs (double counting and infinite loops due to symlinks) and acted upon that with a targeted fix. This indicates your proactive and preventative approach to software quality. Well done!

  4. Conciseness: The change is minimal, addressing a specific problem without introducing unnecessary lines of code or convoluted logic. This keeps things maintainable. Well-executed!


Suggestions for Improvement:

  1. Unit Tests:

    • Although the code change is straightforward, it would benefit from targeted unit tests or additional test cases, especially since handling symbolic links could have system-dependent quirks.
    • Consider adding:
      • A symlink test case in the test suite to confirm that symlinks are skipped.
      • A test that verifies normal (non-symlink) files are still processed correctly.
    • If applicable, add tests for scenarios where symlinks may point to directories or files not accessible due to permissions.
  2. Logging or Debugging Visibility:

    • Including logging to inform the user or developer that a symlink was found and skipped could provide more visibility during execution. Something like:

    • This could help in debugging scenarios without impacting performance much because debug logging is conditionally enabled.

  3. Updating Function/Code Comments:

    • Update any associated comments or documentation to indicate that symlinks are now explicitly skipped during the file scan. This will strengthen understanding for future maintainers revisiting this code.
  4. Consistency Check for File Scanning:

    • If symbolic links to directories (rather than files) may also arise during scanning (e.g., in if is not explicitly set), ensure consistency by reviewing any related code paths. You may want to call out that your solution skips only file symlinks—not symlinked directories—if that's intentional.

Summary:

This is an excellent pull request! The code change is clear, concise, and effectively solves the outlined problem. The use of Python's 's is a great choice for readability and maintainability.

To take this new functionality a step further, consider the suggestions related to testing, logging, and documentation updates, which will ensure robustness, transparency, and clarity for future collaborators.

Awesome work—keep it up! The care you’ve shown in identifying and handling edge cases, such as symlinks, adds immense quality to the project, making it more reliable for end users. Stellar effort! 🚀

@github-actions
Copy link
Copy Markdown

🎉 All tests passed! Here's a dog for you! 🐶

Dog

@AzisK AzisK merged commit 9be8c62 into main Nov 30, 2025
34 checks passed
@AzisK AzisK deleted the Skip-scanning-symlinks branch January 11, 2026 12:40
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.

1 participant