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

Add isNotEmpty extension #3387

Merged
merged 1 commit into from
Nov 7, 2020
Merged

Add isNotEmpty extension #3387

merged 1 commit into from
Nov 7, 2020

Conversation

PaulTaykalo
Copy link
Collaborator

@PaulTaykalo PaulTaykalo commented Oct 19, 2020

From one point of view, this is a simple sugar-like extension.

Pros:

  • Some expressions that are using isEmpty calls will look like a natural language
  • No going back and forth when parsing some complex conditional expressions

Cons:

  • Some linting rules for the framework itself can break
  • There's no lining rule that will force this usage later.

@PaulTaykalo PaulTaykalo added the discussion Topics that cannot be categorized as bugs or enhancements yet. They require further discussions. label Oct 19, 2020
@PaulTaykalo PaulTaykalo added enhancement Ideas for improvements of existing features and rules. and removed enhancement Ideas for improvements of existing features and rules. labels Oct 19, 2020
@SwiftLintBot
Copy link

SwiftLintBot commented Oct 19, 2020

2 Warnings
⚠️ Please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.
⚠️ This PR may need tests.
12 Messages
📖 Linting Aerial with this PR took 1.94s vs 1.98s on master (2% faster)
📖 Linting Alamofire with this PR took 2.75s vs 2.76s on master (0% faster)
📖 Linting Firefox with this PR took 9.36s vs 9.38s on master (0% faster)
📖 Linting Kickstarter with this PR took 15.52s vs 15.58s on master (0% faster)
📖 Linting Moya with this PR took 1.33s vs 1.36s on master (2% faster)
📖 Linting Nimble with this PR took 1.37s vs 1.36s on master (0% slower)
📖 Linting Quick with this PR took 0.61s vs 0.68s on master (10% faster)
📖 Linting Realm with this PR took 4.52s vs 4.5s on master (0% slower)
📖 Linting SourceKitten with this PR took 1.02s vs 1.07s on master (4% faster)
📖 Linting Sourcery with this PR took 7.3s vs 7.32s on master (0% faster)
📖 Linting Swift with this PR took 11.01s vs 11.06s on master (0% faster)
📖 Linting WordPress with this PR took 17.63s vs 17.65s on master (0% faster)

Here's an example of your CHANGELOG entry:

* Add `isNotEmpty` extension.  
  [PaulTaykalo](https://github.com/PaulTaykalo)
  [#issue_number](https://github.com/realm/SwiftLint/issues/issue_number)

note: There are two invisible spaces after the entry's text.

Generated by 🚫 Danger

@codecov-io
Copy link

codecov-io commented Oct 19, 2020

Codecov Report

Merging #3387 into master will decrease coverage by 0.00%.
The diff coverage is 95.32%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3387      +/-   ##
==========================================
- Coverage   90.50%   90.49%   -0.01%     
==========================================
  Files         420      420              
  Lines       20552    20555       +3     
==========================================
+ Hits        18601    18602       +1     
- Misses       1951     1953       +2     
Impacted Files Coverage Δ
...intFramework/Documentation/RuleDocumentation.swift 0.00% <0.00%> (ø)
Source/SwiftLintFramework/Models/LinterCache.swift 63.29% <0.00%> (ø)
...onfigurations/UnusedDeclarationConfiguration.swift 13.63% <0.00%> (ø)
...wiftLintFramework/Extensions/Array+SwiftLint.swift 100.00% <100.00%> (ø)
...ntFramework/Extensions/Configuration+Parsing.swift 93.75% <100.00%> (ø)
...LintFramework/Extensions/SwiftLintFile+Regex.swift 96.74% <100.00%> (-0.47%) ⬇️
Source/SwiftLintFramework/Models/Command.swift 97.43% <100.00%> (ø)
...urce/SwiftLintFramework/Models/Configuration.swift 83.53% <100.00%> (ø)
Source/SwiftLintFramework/Models/Linter.swift 84.93% <100.00%> (ø)
Source/SwiftLintFramework/Protocols/Rule.swift 64.83% <100.00%> (ø)
... and 59 more

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 662db7b...d735693. Read the comment docs.

@PaulTaykalo PaulTaykalo added the hacktoberfest-accepted Pull requests accepted as valid Hacktoberfest contributions. label Oct 31, 2020
@jpsim jpsim force-pushed the sugar/add-is-not-empty-extension branch from d735693 to fb0b6c2 Compare November 7, 2020 23:42
@jpsim
Copy link
Collaborator

jpsim commented Nov 7, 2020

Thanks!

@jpsim jpsim merged commit 693ee2c into master Nov 7, 2020
@jpsim jpsim deleted the sugar/add-is-not-empty-extension branch November 7, 2020 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Topics that cannot be categorized as bugs or enhancements yet. They require further discussions. hacktoberfest-accepted Pull requests accepted as valid Hacktoberfest contributions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants