[Linter] check frameworks attribute for invalid frameworks #66

Closed
kylef opened this Issue Mar 21, 2014 · 10 comments

3 participants

@kylef

As seen in Marxon13/Specs@8ca38c4

  • frameworks
  • weak_frameworks
  • libraries

A simple regex rule for detecting invalid names, such as with , and spaces etc.

@kylef kylef added the enhancement label Mar 21, 2014
@kylef kylef referenced this issue in CocoaPods/Specs Mar 21, 2014
Merged

Fixed error in pod spec #9489

@fabiopelosin fabiopelosin changed the title from Linter should check frameworks for invalid frameworks to [Linter] check frameworks attribute for invalid frameworks Mar 31, 2014
@fabiopelosin
CocoaPods member

This issue can be implemented by improving this two methods to check against a regex.

@squarefrog

I would love to have a go at this, but I'm struggling to find the spec where these methods are tested. Can anyone point me in the right direction?

@fabiopelosin
CocoaPods member

Hi @squarefrog... great to hear that!

The specs are here (by convention we name the test file like TESTED_CLASS_spec.rb and use the the same tree of the lib/cocoapods-core dir in the spec dir).

@squarefrog

Thanks! I'll start on this tomorrow. I'll just add a simple regex to look for any non-alphanumeric. If this needs to change down the line (support symbols?), it should be easy to add new rules.

@fabiopelosin
CocoaPods member

Sounds great!

@squarefrog

Couldn't sleep ;)

Frameworks
AddressBook.framework
AddressBook!
AddressBook

Libraries
MyLibrary.a
MyLibrary.dylib
libMyLibrary
MyLibrary
Mylib2

Strikethroughs are strings filtered out by the validation.

@fabiopelosin
CocoaPods member

@squarefrog in case any is missing... the tests of your patch should include all the cases that you presented above in #66 (comment)

@squarefrog

Sure I can do that. Is there a way to check for passing cases? For example:

  it 'checks that acceptable frameworks do not raise messages' do
    @spec.frameworks = %w(MyLibrary Mylib2)
    message_should_not_include('framework', 'name')
  end

I know message_should_not_include does not exist but is there something similar.

@fabiopelosin
CocoaPods member

You can create any function that would helpful as showcased in this spec

@squarefrog

OK I'll see what I can come up with this weekend!

@fabiopelosin fabiopelosin closed this in #96 Apr 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment