Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Improve file enumeration in generate subcommand #229

Merged
merged 6 commits into from
Mar 29, 2021

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Mar 25, 2021

This PR makes a few small changes to improve the ergonomics and performance of the generate subcommand:

First, we pass .isDirectoryKey into the includingPropertiesForKeys argument when constructing a file enumerator. I haven't profiled this, but it should be faster for the file manager to pick this up during enumeration rather than fetching it in the loop on-demand.

Second, we pass .skipsHiddenFiles and .skipsPackageDescendants as enumeration options. Among other things, this prevents cloned dependencies in .swiftpm from being pulled in when passing the current directory (.) as an input argument.

Third, we tell the file enumerator to skip the top-level Tests/ directory. In the future, we may replace this with code that parses the Package.swift manifest file and identifies the source files directly.

Sources/SwiftDoc/Module.swift Outdated Show resolved Hide resolved
Changelog.md Show resolved Hide resolved
@mattt mattt merged commit 5738c2a into master Mar 29, 2021
@mattt mattt deleted the smarter-file-enumeration branch March 29, 2021 12:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants