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

Exclude Pods and Carthage directories by default #2319

Closed
2 tasks done
robmaceachern opened this issue Jul 25, 2018 · 5 comments
Closed
2 tasks done

Exclude Pods and Carthage directories by default #2319

robmaceachern opened this issue Jul 25, 2018 · 5 comments
Labels
wontfix Issues that became stale and were auto-closed by a bot.

Comments

@robmaceachern
Copy link

New Issue Checklist

Enhancement Request

I think that the Pods and Carthage directories should be excluded from SwiftLint by default.

Flagging linter warnings/errors on dependencies isn't a very useful or commonly needed feature. Most sample .swiftlint.yml files that I've seen manually exclude these directories (examples: 0, 1, 2). This should be a built-in default which can be overridden with included if needed for some reason.

At least with Cocoapods, excluding the Pods directory by default would simplify the initial integration of SwiftLint into the project. Currently, the initial setup goes something like:

  • Add pod 'SwiftLint'
  • Add the "${PODS_ROOT}/SwiftLint/swiftlint" to a build phase
  • Build project, which fails due to third party linter violations
  • Google "swiftlint config sample"
  • Add .swiftlint.yml and excluded: - Pods

It also makes running an initial or one-off autocorrect more cumbersome than it needs to be.

Related to #1637. This was mentioned also in #6 but the issue was closed with the addition of the exclusion options to .swiftlint.yml.

Environment

  • SwiftLint version (run swiftlint version to be sure)? 0.26.0
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? Cocoapods
@realm-probot realm-probot bot added the O:User label Jul 25, 2018
@fabb
Copy link
Contributor

fabb commented Aug 10, 2018

Maybe rather create a swiftlint init command (similar to pod init) that creates a default .swiftlint.yml configuration file that already includes excluded: - Pods?

@sindresorhus
Copy link

@fabb It's easy enough to add it manually. The point here is to reduce boilerplate and optimize for the common case.

@robmaceachern
Copy link
Author

@fabb I think some kind of command that generates a .swiftlint.yml could be useful, particularly if there was some way it could make discovering opt-in rules better. I still think the Pods exclusion should be a SwiftLint default though :)

@fabb
Copy link
Contributor

fabb commented Aug 14, 2018

I‘m not against it, just wanted to point out a possible alternative.

@stale
Copy link

stale bot commented Nov 8, 2020

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 Nov 8, 2020
@stale stale bot closed this as completed Nov 15, 2020
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

No branches or pull requests

4 participants