Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

closure_spacing accepts empty bodies with a space #879

Merged
merged 1 commit into from
Nov 25, 2016
Merged

closure_spacing accepts empty bodies with a space #879

merged 1 commit into from
Nov 25, 2016

Conversation

marcelofabri
Copy link
Collaborator

Fixes #875

let content = file.contents.substring($0.location + 1, length: $0.length - 2)
if content.isEmpty { return false } // case when {} is not a closure
if content.isEmpty || content == " " {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is kind of ugly, but I didn't want to make multiple spaces valid, only {} and { }

@codecov-io
Copy link

codecov-io commented Nov 16, 2016

Current coverage is 85.96% (diff: 100%)

Merging #879 into master will increase coverage by <.01%

@@             master       #879   diff @@
==========================================
  Files           112        112          
  Lines          4908       4910     +2   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           4219       4221     +2   
  Misses          689        689          
  Partials          0          0          

Powered by Codecov. Last update 3ce57ba...4ed50c2

@jpsim jpsim merged commit ad019af into realm:master Nov 25, 2016
@marcelofabri marcelofabri deleted the closure_spacing_empty_body branch November 25, 2016 22:19
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants