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

[Linter] check frameworks attribute for invalid frameworks #66

Closed
3 tasks
kylef opened this issue Mar 21, 2014 · 10 comments · Fixed by #96
Closed
3 tasks

[Linter] check frameworks attribute for invalid frameworks #66

kylef opened this issue Mar 21, 2014 · 10 comments · Fixed by #96

Comments

@kylef
Copy link
Contributor

kylef commented Mar 21, 2014

As seen in https://github.com/Marxon13/Specs/commit/8ca38c40a2c8db87ce97b944417425623d18a737

  • frameworks
  • weak_frameworks
  • libraries

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

@fabiopelosin fabiopelosin changed the title Linter should check frameworks for invalid frameworks [Linter] check frameworks attribute for invalid frameworks Mar 31, 2014
@fabiopelosin
Copy link
Member

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

@squarefrog
Copy link
Contributor

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
Copy link
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
Copy link
Contributor

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
Copy link
Member

Sounds great!

@squarefrog
Copy link
Contributor

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
Copy link
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
Copy link
Contributor

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
Copy link
Member

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

@squarefrog
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants