CodeDoesGood / business

CodeDoesGood organization main repo.
http://www.codedoesgood.org
36 stars 3 forks source link

Create SwiftLint file #116

Open abbeyjackson opened 7 years ago

abbeyjackson commented 7 years ago

@Pahitos how's this going?

rl-pavel commented 7 years ago

Not sure... It's hard to test all the possible combinations of code 😅 I'll commit what I've got so far soon.

GrfxGuru commented 7 years ago

@Pahitos if you need someone to try it out, I'd be happy to run some of my code through it. That should pretty much break anything ;)

abbeyjackson commented 7 years ago

@Pahitos @GrfxGuru Also I sent Pavel a message on slack about the rules and what can be changed :)

abbeyjackson commented 7 years ago

@Pahitos if this is

GrfxGuru commented 7 years ago

@Pahitos Is this complete and should be closed, or should it be in the in progress column?

dimpiax commented 7 years ago

So it's done or not? We about swiftlint for Atom?

rl-pavel commented 7 years ago

I was somehow missing these notifications, sorry about that.

The only part that I couldn't do is the 3rd and 4th point of project specific Empty Lines and Line Breaks rule:

// Some code

if foo != nil {

    // several lines of code
}

// More code

where you have to have a line break before and after the if statement and on the first line, if there are 'several lines of code'.

rl-pavel commented 7 years ago

To me personally, this seems kind of vague and IMO something like this should be up to the programmer to decide. But if someone can figure out how to make a rule for this, that'd be awesome. There's another similar rule for closures (3rd example), which is even harder to implement (maybe even impossible without SourceKitten).

dimpiax commented 7 years ago

@Pahitos could you send you lint source file?

rl-pavel commented 7 years ago

@dimpiax It's been committed to the template already: https://github.com/CodeDoesGood/iOS-Template/blob/master/iOS-Template/CodeDoesGood-iOSTemplate/.swiftlint.yml

dimpiax commented 7 years ago

@Pahitos so this is not real-time checker? just a model.

Could you implement realtime in Atom?

rl-pavel commented 7 years ago

@dimpiax not sure what you mean by implementing it in Atom 🤔 It shows the warnings in Xcode when you build the project. I was following these instructions

dimpiax commented 7 years ago

@Pahitos https://github.com/realm/SwiftLint#atom

rl-pavel commented 7 years ago

@dimpiax hmmm... Just installed this plugin and it works 🤔 What does this have to do with iOS-Template though?

dimpiax commented 7 years ago

@Pahitos Just to be sure that is works.

rl-pavel commented 7 years ago

Yup. As long as the plugin is installed, it should be all good 👍

abbeyjackson commented 7 years ago

Pavel we talked several times about the line breaks on Slack and I told you it wasn't important :) but that if the Swiftlint default is different than you need to edit the style guide to match Swiftlint. --

Sincerely,

Abbey Jackson

604-600-1450 <javascript:void(0);> https://github.com/abbeyjackson http://ca.linkedin.com/in/earthabbey

abbeyjackson commented 7 years ago

Dima Swiftlint is an add-in for Xcode that ensures every project adheres to certain code formatting guidelines and best practices. --

Sincerely,

Abbey Jackson

604-600-1450 <javascript:void(0);> https://github.com/abbeyjackson http://ca.linkedin.com/in/earthabbey

dimpiax commented 7 years ago

@abbeyjackson I am about best practice to lint in realtime.

abbeyjackson commented 7 years ago

Swiftlint will give warnings and errors in Xcode at compile time. This is a standard tool used in iOS development. --

Sincerely,

Abbey Jackson

604-600-1450 <javascript:void(0);> https://github.com/abbeyjackson http://ca.linkedin.com/in/earthabbey