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

Ignore .build folders by default #5604

Open
a7ex opened this issue May 25, 2024 · 1 comment
Open

Ignore .build folders by default #5604

a7ex opened this issue May 25, 2024 · 1 comment

Comments

@a7ex
Copy link

a7ex commented May 25, 2024

New Issue Checklist

New rule request

Since compiling with swift by default compiles into the hidden folder ".build" and there are checkouts of swift packages contained in the .build folder, wouldn't it be a good idea, if SwiftLint skips sich a .build folder by default?

We had a case, where an unexperienced user must have called swift build at some point in the - otherwise - Xcode project folder. It contained local swift packages and he wondered, why the build was failing with errors, when others could compile just fine.
It turned out the errors were generated in the .build folders.
Of course we found the issue and it was easily resolved, but it brought up the question to me: Should swiftlint really descend into these folders?
1.) They are most of the times "gitignored" and such can lead to different behaviour on different machines.
2.) There is no point really into descending into those "DerivedData" folders with their checkout Swift Packages, is it?

Therefore I think that rule should be opt-out.

@SimplyDanny
Copy link
Collaborator

While .build would be a good candidate to be ignored by default, I'm actually not inclined to hard-code certain folders into SwiftLint and maintain them. Other build tools have other working folders SwiftLint could ignore as well. On the other hand, users might use these folders as part of their projects not knowing (and not caring) that some build tools conventionally use them.

That said, it's very easy to specify explicit includes and excludes in the configuration. That would be the recommended way,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants