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

[Swift 4.1] Add redundant_set_access_control rule #2036

Merged
merged 2 commits into from
Apr 24, 2018
Merged

[Swift 4.1] Add redundant_set_access_control rule #2036

merged 2 commits into from
Apr 24, 2018

Conversation

marcelofabri
Copy link
Collaborator

@marcelofabri marcelofabri commented Feb 4, 2018

Fixes #1869

The more important thing here is not the rule itself, but we have to make a decision on how we're going to mark rules that won't work on older Swift compiler versions, as Swift 4.1 includes some SourceKit fixes and improvements that will provide us more information to create rules.

We also probably should hold merging this until we have CI running Swift 4.1. I just wanted to open the PR to get feedback on the minSwiftVersion approach.

I also didn't implement auto correct on purpose: I think this rule shouldn't be triggered frequently and when there're violations, the user should check whether the correct behavior would be actually use the same ACL for the setter or it was a mistake in the first place.

@SwiftLintBot
Copy link

SwiftLintBot commented Feb 4, 2018

2 Warnings
⚠️ Big PR
⚠️ This PR introduced a violation in Firefox: /Users/distiller/project/osscheck/Firefox/Client/Frontend/Login Management/LoginListViewController.swift:371:5: warning: Redundant Set Access Control Rule Violation: Property setter access level shouldn't be explicit if it's the same as the variable access level. (redundant_set_access_control)
12 Messages
📖 Linting Aerial with this PR took 0.37s vs 0.36s on master (2% slower)
📖 Linting Alamofire with this PR took 3.03s vs 3.12s on master (2% faster)
📖 Linting Firefox with this PR took 11.01s vs 10.88s on master (1% slower)
📖 Linting Kickstarter with this PR took 16.03s vs 15.73s on master (1% slower)
📖 Linting Moya with this PR took 1.85s vs 1.81s on master (2% slower)
📖 Linting Nimble with this PR took 1.49s vs 1.43s on master (4% slower)
📖 Linting Quick with this PR took 0.5s vs 0.49s on master (2% slower)
📖 Linting Realm with this PR took 3.11s vs 2.97s on master (4% slower)
📖 Linting SourceKitten with this PR took 0.94s vs 0.93s on master (1% slower)
📖 Linting Sourcery with this PR took 4.29s vs 4.35s on master (1% faster)
📖 Linting Swift with this PR took 18.33s vs 18.69s on master (1% faster)
📖 Linting WordPress with this PR took 13.8s vs 13.64s on master (1% slower)

Generated by 🚫 Danger

@codecov-io
Copy link

codecov-io commented Feb 4, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@59584f1). Click here to learn what that means.
The diff coverage is 81.81%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2036   +/-   ##
=========================================
  Coverage          ?   89.63%           
=========================================
  Files             ?      257           
  Lines             ?    14924           
  Branches          ?      973           
=========================================
  Hits              ?    13377           
  Misses            ?     1529           
  Partials          ?       18
Impacted Files Coverage Δ
Tests/SwiftLintFrameworkTests/TestHelpers.swift 77.01% <100%> (ø)
...ource/SwiftLintFramework/Models/SwiftVersion.swift 100% <100%> (ø)
...ce/SwiftLintFramework/Models/RuleDescription.swift 94.44% <100%> (ø)
Tests/SwiftLintFrameworkTests/RulesTests.swift 100% <100%> (ø)
...intFramework/Extensions/Dictionary+SwiftLint.swift 86.53% <100%> (ø)
...tLintFramework/Models/RuleList+Documentation.swift 100% <100%> (ø)
...ramework/Rules/RedundantSetAccessControlRule.swift 61.9% <61.9%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59584f1...1a9a4f7. Read the comment docs.

@marcelofabri
Copy link
Collaborator Author

This is ready for review! It looks a huge PR, but most of the changes are in Rules.md.

@marcelofabri marcelofabri merged commit b338918 into realm:master Apr 24, 2018
@marcelofabri marcelofabri deleted the redudant-acl-set branch April 24, 2018 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule request: redundant set access control
3 participants