Skip to content

Commit

Permalink
Merge pull request #807 from octokit/codeformatter
Browse files Browse the repository at this point in the history
added a tailored CodeFormatter to Octokit
  • Loading branch information
shiftkey committed Nov 4, 2015
2 parents 7ec44d1 + 80719c0 commit f0111aa
Show file tree
Hide file tree
Showing 202 changed files with 461 additions and 438 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ packaging/
tools/FAKE.Core
tools/SourceLink.Fake
tools/xunit.runner.console
tools/Octokit.CodeFormatter
*.ncrunch*
*.GhostDoc.xml

Expand Down
2 changes: 1 addition & 1 deletion Octokit.Reactive/Clients/IObservableCommitsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public interface IObservableCommitsClient
/// <param name="name">The name of the repository</param>
/// <param name="commit">The commit to create</param>
/// <returns></returns>
IObservable<Commit> Create(string owner, string name, NewCommit commit);
IObservable<Commit> Create(string owner, string name, NewCommit commit);
}
}
2 changes: 1 addition & 1 deletion Octokit.Reactive/Clients/IObservableOrganizationsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public interface IObservableOrganizationsClient
/// Returns a client to manage members of an organization.
/// </summary>
IObservableOrganizationMembersClient Member { get; }

/// <summary>
/// Returns a client to manage teams for an organization.
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion Octokit.Reactive/Clients/IObservablePullRequestsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,5 @@ public interface IObservablePullRequestsClient
/// <param name="number">The pull request number</param>
/// <returns>A collection of <see cref="PullRequestFile"/> results</returns>
IObservable<PullRequestFile> Files(string owner, string name, int number);

}
}
4 changes: 2 additions & 2 deletions Octokit.Reactive/Clients/IObservableRepositoriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public interface IObservableRepositoriesClient
/// <remarks>Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required.</remarks>
/// <returns>An <see cref="IObservable{Unit}"/> for the operation</returns>
IObservable<Unit> Delete(string owner, string name);

/// <summary>
/// Retrieves the <see cref="Repository"/> for the specified owner and name.
/// </summary>
Expand Down Expand Up @@ -154,7 +154,7 @@ public interface IObservableRepositoriesClient
/// </summary>
/// <remarks>See <a href="http://developer.github.com/v3/repos/forks/">Forks API documentation</a> for more information.</remarks>
IObservableRepositoryForksClient Forks { get; }

/// <summary>
/// Client for GitHub's Repository Contents API.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Octokit.Reactive/Clients/IObservableWatchedClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public interface IObservableWatchedClient
/// <param name="owner">The owner of the repository to unstar</param>
/// <param name="name">The name of the repository to unstar</param>
/// <returns>A <c>bool</c> representing the success of the operation</returns>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="Unwatch",
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Unwatch",
Justification = "Unwatch is consistent with the GitHub website")]
IObservable<bool> UnwatchRepo(string owner, string name);
}
Expand Down
2 changes: 1 addition & 1 deletion Octokit.Reactive/Clients/ObservableAuthorizationsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Octokit.Reactive
public class ObservableAuthorizationsClient : IObservableAuthorizationsClient
{
readonly IAuthorizationsClient _client;
readonly IConnection _connection;
readonly IConnection _connection;

public ObservableAuthorizationsClient(IGitHubClient client)
{
Expand Down
2 changes: 1 addition & 1 deletion Octokit.Reactive/Clients/ObservableCommitsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public IObservable<Commit> Get(string owner, string name, string reference)
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");

return _client.Get(owner, name, reference).ToObservable();
return _client.Get(owner, name, reference).ToObservable();
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Octokit.Reactive/Clients/ObservableGistsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Octokit.Reactive
{
public class ObservableGistsClient : IObservableGistsClient
public class ObservableGistsClient : IObservableGistsClient
{
readonly IGistsClient _client;
readonly IConnection _connection;
Expand Down
2 changes: 1 addition & 1 deletion Octokit.Reactive/Clients/ObservableMergingClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Octokit.Reactive
public class ObservableMergingClient : IObservableMergingClient
{
readonly IMergingClient _client;

public ObservableMergingClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");
Expand Down
1 change: 0 additions & 1 deletion Octokit.Reactive/Clients/ObservableNotificationsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public IObservable<Unit> MarkAsRead()
public IObservable<Unit> MarkAsRead(MarkAsReadRequest markAsReadRequest)
{
return _notificationsClient.MarkAsRead(markAsReadRequest).ToObservable();

}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public IObservable<User> GetAll(string org)
public IObservable<User> GetAll(string org, OrganizationMembersFilter filter)
{
Ensure.ArgumentNotNullOrEmptyString(org, "org");

return _connection.GetAndFlattenAllPages<User>(ApiUrls.Members(org, filter));
}

Expand Down
2 changes: 1 addition & 1 deletion Octokit.Reactive/Clients/ObservableOrganizationsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public ObservableOrganizationsClient(IGitHubClient client)

Member = new ObservableOrganizationMembersClient(client);
Team = new ObservableTeamsClient(client);

_client = client.Organization;
_connection = client.Connection;
}
Expand Down
4 changes: 2 additions & 2 deletions Octokit.Reactive/Clients/ObservablePullRequestsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public IObservable<PullRequest> Update(string owner, string name, int number, Pu
/// <param name="number">The pull request number</param>
/// <param name="mergePullRequest">A <see cref="MergePullRequest"/> instance describing a pull request merge</param>
/// <returns>A <see cref="PullRequestMerge"/> result</returns>
public IObservable<PullRequestMerge> Merge(string owner, string name, int number, MergePullRequest mergePullRequest)
public IObservable<PullRequestMerge> Merge(string owner, string name, int number, MergePullRequest mergePullRequest)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Expand All @@ -134,7 +134,7 @@ public IObservable<PullRequestMerge> Merge(string owner, string name, int number
/// <param name="name">The name of the repository</param>
/// <param name="number">The pull request number</param>
/// <returns>A <see cref="bool"/> result - true if the pull request has been merged, false otherwise</returns>
public IObservable<bool> Merged(string owner, string name, int number)
public IObservable<bool> Merged(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Expand Down
6 changes: 3 additions & 3 deletions Octokit.Reactive/Clients/ObservableRepositoriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ObservableRepositoriesClient : IObservableRepositoriesClient
public ObservableRepositoriesClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");

_client = client.Repository;
_connection = client.Connection;
CommitStatus = new ObservableCommitStatusClient(client);
Expand Down Expand Up @@ -288,7 +288,7 @@ public IObservable<RepositoryContributor> GetAllContributors(string owner, strin
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");

var endpoint = ApiUrls.RepositoryContributors(owner, name);
var parameters = new Dictionary<string, string>();
if (includeAnonymous)
Expand Down Expand Up @@ -330,7 +330,7 @@ public IObservable<Team> GetAllTeams(string owner, string name)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");

var endpoint = ApiUrls.RepositoryTeams(owner, name);
return _connection.GetAndFlattenAllPages<Team>(endpoint);
}
Expand Down
2 changes: 1 addition & 1 deletion Octokit.Reactive/Clients/ObservableSshKeysClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ObservableSshKeysClient : IObservableSshKeysClient
public ObservableSshKeysClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");

_client = client.SshKey;
_connection = client.Connection;
}
Expand Down
1 change: 0 additions & 1 deletion Octokit.Reactive/Clients/ObservableTreesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace Octokit.Reactive
{

public class ObservableTreesClient : IObservableTreesClient
{
readonly ITreesClient _client;
Expand Down
2 changes: 1 addition & 1 deletion Octokit.Reactive/Helpers/ObservableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal static IObservable<TSource> Expand<TSource>(
var outGate = new object();
var q = new Queue<IObservable<TSource>>();
var m = new SerialDisposable();
var d = new CompositeDisposable {m};
var d = new CompositeDisposable { m };
var activeCount = 0;
var isAcquired = false;

Expand Down
2 changes: 1 addition & 1 deletion Octokit.Reactive/ObservableGitHubClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public IConnection Connection
/// </summary>
/// <returns><seealso cref="ApiInfo"/> representing the information returned as part of an Api call</returns>
public ApiInfo GetLastApiInfo()
{
{
return _gitHubClient.Connection.GetLastApiInfo();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ namespace Octokit.Tests.Conventions
public class InterfaceHasAdditionalMethodsException : Exception
{
public InterfaceHasAdditionalMethodsException(Type type, IEnumerable<string> methodsMissingOnReactiveClient)
: base(CreateMessage(type, methodsMissingOnReactiveClient)) { }
: base(CreateMessage(type, methodsMissingOnReactiveClient))
{ }

public InterfaceHasAdditionalMethodsException(Type type, IEnumerable<string> methodsMissingOnReactiveClient, Exception innerException)
: base(CreateMessage(type, methodsMissingOnReactiveClient), innerException) { }
: base(CreateMessage(type, methodsMissingOnReactiveClient), innerException)
{ }

protected InterfaceHasAdditionalMethodsException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
: base(info, context)
{ }

static string CreateMessage(Type type, IEnumerable<string> methods)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ namespace Octokit.Tests.Conventions
public class InterfaceMethodsMismatchException : Exception
{
public InterfaceMethodsMismatchException(Type observableType, Type clientInterface)
: base(CreateMessage(observableType, clientInterface)) { }
: base(CreateMessage(observableType, clientInterface))
{ }

public InterfaceMethodsMismatchException(Type type,Type clientInterface, Exception innerException)
: base(CreateMessage(type, clientInterface), innerException) { }
public InterfaceMethodsMismatchException(Type type, Type clientInterface, Exception innerException)
: base(CreateMessage(type, clientInterface), innerException)
{ }

protected InterfaceMethodsMismatchException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
: base(info, context)
{ }

static string Format(ParameterInfo parameterInfo)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ namespace Octokit.Tests.Conventions
public class InterfaceMissingMethodsException : Exception
{
public InterfaceMissingMethodsException(Type type, IEnumerable<string> methodsMissingOnReactiveClient)
: base(CreateMessage(type, methodsMissingOnReactiveClient)) { }
: base(CreateMessage(type, methodsMissingOnReactiveClient))
{ }

public InterfaceMissingMethodsException(Type type, IEnumerable<string> methodsMissingOnReactiveClient, Exception innerException)
: base(CreateMessage(type, methodsMissingOnReactiveClient), innerException) { }
: base(CreateMessage(type, methodsMissingOnReactiveClient), innerException)
{ }

protected InterfaceMissingMethodsException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
: base(info, context)
{ }

static string CreateMessage(Type type, IEnumerable<string> methods)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ public class InterfaceNotFoundException : Exception
public InterfaceNotFoundException() { }

public InterfaceNotFoundException(string type)
: base(CreateMessage(type)) { }
: base(CreateMessage(type))
{ }

public InterfaceNotFoundException(string type, Exception innerException)
: base(CreateMessage(type), innerException) { }
: base(CreateMessage(type), innerException)
{ }

protected InterfaceNotFoundException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
: base(info, context)
{ }

static string CreateMessage(string type)
{
return String.Format("Could not find the interface {0}. Add this to the Octokit.Reactive project", type);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ namespace Octokit.Tests.Conventions
public class InvalidDebuggerDisplayAttributeValueException : Exception
{
public InvalidDebuggerDisplayAttributeValueException(Type modelType, string value)
: base (CreateMessage(modelType, value)) { }
: base(CreateMessage(modelType, value))
{ }

static string CreateMessage(Type modelType, string value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ namespace Octokit.Tests.Conventions
public class InvalidDebuggerDisplayReturnType : Exception
{
public InvalidDebuggerDisplayReturnType(Type modelType, Type propertyType)
: base (CreateMessage(modelType, propertyType)) { }
: base(CreateMessage(modelType, propertyType))
{ }

static string CreateMessage(Type modelType, Type propertyType)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Octokit.Tests.Conventions
public class MissingDebuggerDisplayAttributeException : Exception
{
public MissingDebuggerDisplayAttributeException(Type modelType)
: base (string.Format("Model type '{0}' is missing the DebuggerDisplayAttribute.", modelType.FullName)) { }
: base(string.Format("Model type '{0}' is missing the DebuggerDisplayAttribute.", modelType.FullName))
{ }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Octokit.Tests.Conventions
public class MissingDebuggerDisplayPropertyException : Exception
{
public MissingDebuggerDisplayPropertyException(Type modelType)
: base (string.Format("Model type '{0}' is missing the DebuggerDisplay property.", modelType.FullName)) { }
: base(string.Format("Model type '{0}' is missing the DebuggerDisplay property.", modelType.FullName))
{ }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ namespace Octokit.Tests.Conventions
public class MutableModelPropertiesException : Exception
{
public MutableModelPropertiesException(Type modelType, IEnumerable<PropertyInfo> mutableProperties)
: base (CreateMessage(modelType, mutableProperties)) { }
: base(CreateMessage(modelType, mutableProperties))
{ }

static string CreateMessage(Type modelType, IEnumerable<PropertyInfo> mutableProperties)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ namespace Octokit.Tests.Conventions
public class PaginationGetAllMethodNameMismatchException : Exception
{
public PaginationGetAllMethodNameMismatchException(Type type, IEnumerable<MethodInfo> methods)
: base(CreateMessage(type, methods)) { }
: base(CreateMessage(type, methods))
{ }

static string CreateMessage(Type type, IEnumerable<MethodInfo> methods)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ namespace Octokit.Tests.Conventions
public class ParameterCountMismatchException : Exception
{
public ParameterCountMismatchException(MethodInfo method, IEnumerable<ParameterInfo> expected, IEnumerable<ParameterInfo> actual)
: base(CreateMessage(method, expected, actual)) { }
: base(CreateMessage(method, expected, actual))
{ }

public ParameterCountMismatchException(MethodInfo method, IEnumerable<ParameterInfo> expected, IEnumerable<ParameterInfo> actual, Exception innerException)
: base(CreateMessage(method, expected, actual), innerException) { }
: base(CreateMessage(method, expected, actual), innerException)
{ }

protected ParameterCountMismatchException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
: base(info, context)
{ }

static string CreateMethodSignature(IEnumerable<ParameterInfo> parameters)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ namespace Octokit.Tests.Conventions
public class ParameterMismatchException : Exception
{
public ParameterMismatchException(MethodInfo method, int position, ParameterInfo expected, ParameterInfo actual)
: base(CreateMessage(method, position, expected, actual)) { }
: base(CreateMessage(method, position, expected, actual))
{ }

public ParameterMismatchException(MethodInfo method, int position, ParameterInfo expected, ParameterInfo actual, Exception innerException)
: base(CreateMessage(method, position, expected, actual), innerException) { }
: base(CreateMessage(method, position, expected, actual), innerException)
{ }

protected ParameterMismatchException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
: base(info, context)
{ }

static string CreateParameterSignature(ParameterInfo parameter)
{
Expand Down
Loading

0 comments on commit f0111aa

Please sign in to comment.