Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excluding takes too long #3304

Closed
JohnReeze opened this issue Aug 14, 2020 · 3 comments
Closed

Excluding takes too long #3304

JohnReeze opened this issue Aug 14, 2020 · 3 comments
Labels
wontfix Issues that became stale and were auto-closed by a bot.

Comments

@JohnReeze
Copy link
Contributor

JohnReeze commented Aug 14, 2020

I use Swiftlint for one very big project for only changed files by specyifing --use-script-input-files --force-exclude and after some checks and measurements with Time Profiler I found out that excluding paths takes more then 3-4 seconds on my machine.

I investigated that problem and found next: while excluding it finds ALL lintable files in all excluded paths from config. And then the result set of excluded swift files is subtracted from the input paths set.

I find it quiet strange algorithm, because why do we need to collect all lintable files for example in excluded Pods directory.

So, I tryed to changed it to the next exclusion algorithm:

let allPaths = paths.flatMap { $0 }
let excludedPaths = excluded.flatMap(Glob.resolveGlob).map { $0.absolutePathStandardized() }
return allPaths.filter { path in
    !excludedPaths.contains { path.hasPrefix($0) }
}

And it still excludes files, lints and works for those 3-4 seconds faster

Are there any special reasons for current exclusion algorithm? or it can be changed to something like I used?

@jpsim
Copy link
Collaborator

jpsim commented Nov 7, 2020

If you can improve the algorithm I'm all for it, although it seems like your latest attempt in #3345 is actually changing the behavior, not sure if you're expecting that to happen or not.

@stale
Copy link

stale bot commented Jan 6, 2021

This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!

@stale stale bot added the wontfix Issues that became stale and were auto-closed by a bot. label Jan 6, 2021
@stale stale bot closed this as completed Jan 13, 2021
@jpsim
Copy link
Collaborator

jpsim commented Feb 23, 2021

Try the --use-alternative-excluding flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix Issues that became stale and were auto-closed by a bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants