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

Changed repos to a specialized collection #842

Merged
merged 3 commits into from
Jul 20, 2015

Conversation

khellang
Copy link
Contributor

I didn't remove the validation, since it still gives some value in validating the owner and repo names separately.

@khellang khellang mentioned this pull request Jul 19, 2015
7 tasks
@khellang
Copy link
Contributor Author

What's up with the CI build?

@khellang khellang force-pushed the refine-search-api branch from ffd0796 to 7bd0447 Compare July 19, 2015 11:14
@shiftkey
Copy link
Member

What's up with the CI build?

It's been bumped to MSBuild 14.0 which is triggering a neat PCL/FxCop issue. Reported here

@khellang
Copy link
Contributor Author

Something like this (just the other way)? http://kristian.hellang.com/building-csharp-6-code-with-appveyor/

return GetEnumerator();
}

public void Add(string owner, string name)
Copy link
Member

Choose a reason for hiding this comment

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

Fun fact - you can also have Add(string nameWithOwner) here and both sorts will happily work with the collection initializer syntax.

@haacked should we support both? I still like the succinctness of writing them inline rather than splitting them out...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually had both in there, but decided to delete the overload. I guess it doesn't hurt to have it in, since we still do the same, full, validation 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a commit with the single string overloads, you can just strip them out if you decide you don't want both.

@shiftkey
Copy link
Member

@khellang nah, I wanted to stick with v12 for the moment.

I fought a bunch with the toolchain today, couldn't find a way out. It's a minor thing (I don't need to run FxCop on the PCL build as the code is shared) but an annoyance nonetheless.

@khellang
Copy link
Contributor Author

I'm not really sure if this builds, because I get all sorts of errors in VS 2015. I had hoped the CI build would tell me, but no luck there either 😛

@shiftkey
Copy link
Member

I had hoped the CI build would tell me, but no luck there either

i got you bb. Once @haacked has had a chance to chime in I'll test things on VS2015 proper.

@@ -337,4 +336,74 @@ public enum IssueTypeQualifier
[Parameter(Value = "issue")]
Issue
}

public class RepositoryCollection : IEnumerable<string>
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the repository list will always be a finite collection, should this be an IReadOnlyCollection<string>? And could it not simply inherit a concrete class at that point?

Copy link
Member

Choose a reason for hiding this comment

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

👍 to more specialized collection

Not sure if the PCL library might get in the way of using a concrete class here though...

Copy link
Contributor

Choose a reason for hiding this comment

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

Well there's List that'll work. 😛 Also, it looks like this is supposed to be a mutable collection right now, so maybe List would make more sense than ReadOnlyCollection<T>. Or we could go the immutable route and have Add always return a new collection.

I just think having this implement IEnumerable<T> is not right. At minimum, ICollection<T> would make more sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only reason it implements IEnumerable<string> is because it's needed for collection initializers to work. I had originally implemented ICollection<string>, but landed on IEnumerable in the original implementation because it didn't allow simple strings.

@haacked
Copy link
Contributor

haacked commented Jul 20, 2015

👍 on this. Is our CI having an issue?

@shiftkey
Copy link
Member

@haacked yeah, it's a VS2015 issue (Code Analysis yay) which we got accidentally upgraded to a few days ago details here.

I'll address it in #835 which is the base branch for this PR.

shiftkey added a commit that referenced this pull request Jul 20, 2015
Changed repos to a specialized collection
@shiftkey shiftkey merged commit c8bee54 into octokit:refine-search-api Jul 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants