Skip to content

make excluded more general#5

Merged
jrmoulton merged 3 commits intojrmoulton:mainfrom
AlexErrant:excludedir
Apr 25, 2023
Merged

make excluded more general#5
jrmoulton merged 3 commits intojrmoulton:mainfrom
AlexErrant:excludedir

Conversation

@AlexErrant
Copy link
Contributor

I have search_paths = ['~']. (The wisdom of this choice is questionable, but here we are.) When I run tms config --excluded ~/.*, it expands to exclude my ~/.cache, ~/.npm, ~/.rustup, .etc, which is great. However tms takes a long time to run because it decides to still dig through my ~/.cache and the others. This PR fixes that.

As commentary, I've never written Rust before, nor any other non-GCed language, so "I have absolutely no idea what I'm doing" especially applies here. Nor do I have any experience with aho_corasick (sounds like some Jedi) - I based it off BurntSushi's answer here. I'm assuming the API changed since he wrote it in 2020 since .anchored(true) and .auto_configure(...) no longer exist.

Note that this is a breaking change.

@AlexErrant AlexErrant changed the title make excluded is more general make excluded more general Apr 24, 2023
@jrmoulton
Copy link
Owner

"I have absolutely no idea what I'm doing"

The code looks good!

This looks like a good change! Although the code shouldn't be scanning through the .cache file. The way the code is written the .cache will never be added to queue.

But this would make the exclusion process much faster! Which over a large number of folder would make a difference and I'm assuming that's where you're actually seeing the benefit.

@AlexErrant
Copy link
Contributor Author

The way the code is written the .cache will never be added to queue.

Odd, this doesn't occur on my system.

image

@jrmoulton
Copy link
Owner

Hmm strange. That's a bug then. If it's been marked as excluded then its shouldn't recurse into the folder

@jrmoulton
Copy link
Owner

I'm going to go ahead and merge this because it looks like a good change regardless of the bug. I'll open an issue for the bug.

Thanks for the PR!

@jrmoulton jrmoulton merged commit ac6084c into jrmoulton:main Apr 25, 2023
@AlexErrant
Copy link
Contributor Author

AlexErrant commented Apr 25, 2023

Ah, to be clear, I believe that my PR fixes that bug. (I wasn't sure what the original intended behavior was, so I refrained from calling it as such.)

@jrmoulton
Copy link
Owner

Ah, to be clear, I believe that my PR fixes that bug. (I wasn't sure what the original intended behavior was, so I refrained from calling it as such.)

Ahh ok. I see. No need to open an issue then :)

Thanks for the clarification!

@AlexErrant AlexErrant deleted the excludedir branch May 7, 2023 21:50
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.

2 participants