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

[Rule Request] Deployment Target rule #2589

marcelofabri opened this Issue Jan 25, 2019 · 0 comments


None yet
1 participant
Copy link

marcelofabri commented Jan 25, 2019

New Issue Checklist

New rule request

This rule will require a configuration to work.

  1. Why should this rule be added? Share links to existing discussion about what
    the community thinks about this.

When bumping the deployment target of an app, it's common to leave unneeded code behind.

  1. Provide several examples of what would and wouldn't trigger violations.
// would trigger
if #available(iOS 8.0, *) {            

@available(iOS 8.0, *) 
class A {}

// would not trigger
if #available(iOS 12.0, *) {            

@available(iOS 12.0, *) 
class A {}
  1. Should the rule be configurable, if so what parameters should be configurable?

Yes! ios_deployment_target and macos_deployment_target.

  1. Should the rule be opt-in or enabled by default? Why?
    See for guidelines on when to mark a rule as opt-in.

This could go either way, because the rule shouldn't trigger if ios_deployment_target and macos_deployment_target are not set.

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Jan 25, 2019

sjavora added a commit to sjavora/SwiftLint that referenced this issue Mar 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.