-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix for erroneous linting on 0.21.0.rc1 #1130
Conversation
…ssors to test against
Thanks! Can you add a test case that would fail without your patch? This to ensure we never regress on this again. |
Ruby is not exactly my first language. Can you point me to a commit with a simple change like mine that contains another test so I can learn how to set things up? And... how do I run the test suite? |
The tests for the validator that we have are here. After setting up the dev env as described here, you should be able to run just that test with: Looking at the existing specs, though, I don’t see an easy example to re-use, as the spec that’s used has no dependencies itself. I guess you could create a podspec in memory, serialise it as YAML to a tempfile, and then run the validator against it like the other specs do. @irrationalfab Were you planning on doing something different with the validator specs or do you have a better suggestion for @HBehrens ? |
@alloy I tried to pin down the issue for @HBehrens: it only occures if
I'm going to figure out how to test this now. |
Then, most pods that depend on |
Good catch so this basically assumed one target for the hole project and didn't take into account the Pod targets. Note thought that the original check looks incomplete. It should check every spec (including any eventual subspec) of the Pod. It could be implemented like: file_accessors = installer.aggregate_targets.first.pod_targets.map { |target| target.file_accessors }.flatten
@file_accessors = file_accessors.select { |accessor| accessor.spec.root.name == spec.root.name } Regarding the tests, those appear to be outdated and precedent to the validator partial (and incomplete) refactor of 0.17. There should be no need to serialize the spec and so an instance can be created and just passed. A starting point could be: it "is robust against deps" do
spec = Specification.new
spec.name = 'testPod'
spec.dependency 'otherPod'
validator = Validator.new(pod)
validator.validate
validator.validated?.should.be.true
end |
Since the Validator complained about an undefined realpath when creating just a Spec instance (crashing with an Exception, different issue) I now followed some of the other tests and used the |
…mer'` - let spec in "validates a podspec with dependencies" validate - fixed a bug in `write_podspec`
fix for erroneous linting on 0.21.0.rc1
Thanks! |
👍 |
Linting the apparently valid podspec Transit 0.0.2 fails on 0.21.0.rc1 and hinders publishing the spec since travis aborts the build consequently.
The output
is caused by and empty
@file_accessor
instance variable in the validator sinceinstall_pod
expects a specific order when buildingfile_accessors
:At least in my case, the desired target (Pods-Transit) cames last not first. Building
file_accessors
as combined list of allfiles_accessors
of every target seems to solve this.