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

Adds closure_body_length opt-in rule #2342

Merged
merged 2 commits into from
Aug 9, 2018

Conversation

ornithocoder
Copy link
Contributor

because closure bodies should not span too many lines.

because closure bodies should not span too many lines. Implements realm#52.
Requires Swift 4.2.
@SwiftLintBot
Copy link

SwiftLintBot commented Aug 6, 2018

1 Warning
⚠️ Big PR
12 Messages
📖 Linting Aerial with this PR took 0.5s vs 0.4s on master (24% slower)
📖 Linting Alamofire with this PR took 3.46s vs 3.49s on master (0% faster)
📖 Linting Firefox with this PR took 14.24s vs 13.76s on master (3% slower)
📖 Linting Kickstarter with this PR took 22.32s vs 22.23s on master (0% slower)
📖 Linting Moya with this PR took 2.31s vs 2.43s on master (4% faster)
📖 Linting Nimble with this PR took 2.27s vs 2.35s on master (3% faster)
📖 Linting Quick with this PR took 0.55s vs 0.75s on master (26% faster)
📖 Linting Realm with this PR took 4.05s vs 3.94s on master (2% slower)
📖 Linting SourceKitten with this PR took 1.23s vs 1.37s on master (10% faster)
📖 Linting Sourcery with this PR took 5.38s vs 5.38s on master (0% slower)
📖 Linting Swift with this PR took 35.79s vs 29.59s on master (20% slower)
📖 Linting WordPress with this PR took 20.54s vs 18.95s on master (8% slower)

Generated by 🚫 Danger

@codecov-io
Copy link

codecov-io commented Aug 6, 2018

Codecov Report

Merging #2342 into master will decrease coverage by 0.13%.
The diff coverage is 59.67%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2342      +/-   ##
==========================================
- Coverage   92.01%   91.88%   -0.14%     
==========================================
  Files         302      304       +2     
  Lines       15192    15255      +63     
==========================================
+ Hits        13979    14017      +38     
- Misses       1213     1238      +25
Impacted Files Coverage Δ
...tFrameworkTests/AutomaticRuleTests.generated.swift 100% <100%> (ø) ⬆️
.../Rules/Metrics/ClosureBodyLengthRuleExamples.swift 100% <100%> (ø)
...ramework/Rules/Metrics/ClosureBodyLengthRule.swift 3.84% <3.84%> (ø)
...nfigurations/MultilineArgumentsConfiguration.swift 60% <0%> (-1.77%) ⬇️
Source/SwiftLintFramework/Models/Command.swift 97.4% <0%> (-1.3%) ⬇️
Tests/SwiftLintFrameworkTests/TestHelpers.swift 78.89% <0%> (+0.5%) ⬆️
...tFramework/Rules/Lint/ValidIBInspectableRule.swift 100% <0%> (+1.36%) ⬆️

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 1f9a001...08fb641. Read the comment docs.

CHANGELOG.md Outdated
@@ -9,6 +9,11 @@
* Improve performance of `line_length` rule.
[Marcelo Fabri](https://github.com/marcelofabri)

* Add `closure_body_length` rule to enforce the maximum number
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please mention that the rule is opt-in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course :-) Sorry about that.

explaining closure_body_length is a opt-in rule.
@marcelofabri marcelofabri merged commit 5c9b6b9 into realm:master Aug 9, 2018
@marcelofabri
Copy link
Collaborator

Thanks @ornithocoder 🎉

@Jeehut Jeehut mentioned this pull request Sep 6, 2018
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.

4 participants