Skip to content

Commit

Permalink
fix various typos and grammar mistakes that the new resharper catches…
Browse files Browse the repository at this point in the history
…, it's getting pretty good at grammar
  • Loading branch information
adelikat committed Jan 14, 2024
1 parent d6e61a5 commit cbc9f6f
Show file tree
Hide file tree
Showing 52 changed files with 99 additions and 97 deletions.
2 changes: 1 addition & 1 deletion TASVideos.Api/Controllers/PublicationsController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* General API TODOs:
* Field selection is purely post processing and returns distinct objects,
* Field selection is purely post-processing and returns distinct objects,
* so the record count might be less than the requested count
* how do we document this? or do we want to try to do dynamic queryable field selection?
*/
Expand Down
2 changes: 1 addition & 1 deletion TASVideos.Api/Filters/RequirePermission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public RequirePermissionAttribute(bool matchAny, params PermissionTo[] requiredP
}

/// <summary>
/// Gets a value indicating whether or not to allow the user as long as only one permission is available,
/// Gets a value indicating whether to allow the user as long as only one permission is available,
/// else all declared permissions are required
/// </summary>
public bool MatchAny { get; }
Expand Down
4 changes: 2 additions & 2 deletions TASVideos.Api/Requests/PublicationsRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public class PublicationsRequest : ApiRequest, IPublicationTokens
public string? AuthorIds { get; init; }

/// <summary>
/// Gets a value indicating whether or not to show obsoleted in addition to current movies.
/// Gets a value indicating whether to show obsoleted in addition to current movies.
/// </summary>
public bool ShowObsoleted { get; init; }

/// <summary>
/// Gets a value indicating whether or not to only show obsoleted movies (and exclude current)
/// Gets a value indicating whether to only show obsoleted movies (and exclude current)
/// </summary>
public bool OnlyObsoleted { get; init; }

Expand Down
2 changes: 1 addition & 1 deletion TASVideos.Api/Responses/GamesResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace TASVideos.Api.Responses;

/// <summary>
/// Represents a game returned by the games endpoint.
/// Represents a game returned by the Games endpoint.
/// </summary>
public class GamesResponse
{
Expand Down
2 changes: 1 addition & 1 deletion TASVideos.Api/Responses/PublicationsResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace TASVideos.Api.Responses;

/// <summary>
/// Represents a publication returned by the publications endpoint.
/// Represents a publication returned by the Publications endpoint.
/// </summary>
public class PublicationsResponse
{
Expand Down
2 changes: 1 addition & 1 deletion TASVideos.Core/Data/DbInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private static async Task SampleStrategy(DbContext context)
}
}

// Adds optional sample data for testing purposes (would not be apart of a production release)
// Adds optional sample data for testing purposes (would not be a part of a production release)
private static async Task GenerateDevSampleData(DbContext context)
{
var sql = await GetSampleDataScript();
Expand Down
2 changes: 1 addition & 1 deletion TASVideos.Core/Extensions/WikiHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public static bool IsGameResourcesPage(string? pageName)
}

/// <summary>
/// Fixes Internal system page links to be their public counter parts ex: InternalSystem/SubmissionContent/S4084 to 4084S.
/// Fixes Internal system page links to be their public counterparts ex: InternalSystem/SubmissionContent/S4084 to 4084S.
/// </summary>
public static string ProcessLink(string link)
{
Expand Down
6 changes: 3 additions & 3 deletions TASVideos.Core/Paging/ISortable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface ISortable
public static class SortableExtensions
{
/// <summary>
/// Returns whether or not the given parameter is specified.
/// Returns whether the given parameter is specified.
/// </summary>
public static bool IsSortingParam(this ISortable? sortable, string? param)
{
Expand All @@ -42,7 +42,7 @@ public static bool IsSortingParam(this ISortable? sortable, string? param)
}

/// <summary>
/// Returns whether or not the given parameter is specified and
/// Returns whether the given parameter is specified and
/// is specified as a descending sort.
/// </summary>
public static bool IsDescending(this ISortable? sortable, string? param)
Expand All @@ -68,7 +68,7 @@ public static bool IsDescending(this ISortable? sortable, string? param)
}

/// <summary>
/// Returns whether or not the requested sort is valid based on the destination response
/// Returns whether the requested sort is valid based on the destination response
/// The sorting is valid if all parameters match properties in the response, and that
/// those properties are declared as sortable.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion TASVideos.Core/Paging/PageOf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public PageOf(IEnumerable<T> items)
}

/// <summary>
/// Represents all of the data necessary to create a paged query.
/// Represents all the data necessary to create a paged query.
/// </summary>
public class PagingModel : ISortable, IPageable
{
Expand Down
4 changes: 2 additions & 2 deletions TASVideos.Core/Services/Email/Email.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace TASVideos.Core.Services.Email;

/// <summary>
/// Represents an email that can be send to an <see cref="IEmailSender"/>
/// Represents an email that can be sent to an <see cref="IEmailSender"/>
/// </summary>
public interface IEmail
{
Expand All @@ -21,7 +21,7 @@ public interface IEmail
string Message { get; }

/// <summary>
/// Gets a value indicating whether or not the <see cref="Message" /> contains HTML content
/// Gets a value indicating whether the <see cref="Message" /> contains HTML content
/// </summary>
bool ContainsHtml { get; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace TASVideos.Core.Services.ExternalMediaPublisher;

/// <summary>
/// Provides a mechanism for sending posts to a variety of external resources
/// Such as IRC, Discord, Twitter, etc via a collection of
/// Such as IRC, Discord, Twitter, etc. via a collection of
/// <see cref="IPostDistributor"/> instances that will deliver posts to specific resources.
/// </summary>
public class ExternalMediaPublisher // DI as a singleton, pass in a hardcoded list of IMessagingProvider implementations, config drive which implementations to use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

/// <summary>
/// Receives an <see cref="IPostable"/> and distributes it
/// to a specific media such as IRC, Discord, etc
/// to a specific media such as IRC, Discord, etc.
/// Distributors are managed by the <seealso cref="ExternalMediaPublisher"/>
/// </summary>
public interface IPostDistributor
{
/// <summary>
/// Gets all of the post types that this distributor will respond to, if a type is not here it will not send messages of that type
/// Gets all the post types that this distributor will respond to, if a type is not here it will not send messages of that type
/// </summary>
IEnumerable<PostType> Types { get; }

Expand Down
2 changes: 1 addition & 1 deletion TASVideos.Core/Services/ExternalMediaPublisher/Post.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface IPostable
string Title { get; }

/// <summary>
/// Gets the post title with markdown formatting.
/// Gets the post title with Markdown formatting.
/// Optionally may include "{0}" to be replaced with the <see cref="Link"/>.
/// </summary>
string FormattedTitle { get; }
Expand Down
2 changes: 1 addition & 1 deletion TASVideos.Core/Services/IUserFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public interface IUserFiles
Task<int> StorageUsed(int userId);

/// <summary>
/// Calculates whether or not the given file will exceed the maximum limit for the user
/// Calculates whether the given file will exceed the maximum limit for the user
/// </summary>
Task<bool> SpaceAvailable(int userId, long fileLength);

Expand Down
2 changes: 1 addition & 1 deletion TASVideos.Core/Services/IpBanService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace TASVideos.Core.Services;
public interface IIpBanService
{
/// <summary>
/// Returns a value indicating whether or not the ip address is currently banned.
/// Returns a value indicating whether the ip address is currently banned.
/// </summary>
ValueTask<bool> IsBanned(IPAddress? ipAddress);

Expand Down
8 changes: 4 additions & 4 deletions TASVideos.Core/Services/QueueService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ IEnumerable<SubmissionStatus> AvailableStatuses(SubmissionStatus currentStatus,
int HoursRemainingForJudging(ISubmissionDisplay submission);

/// <summary>
/// Returns whether or not a submission can be delete, does not affect the submission
/// Returns whether a submission can be deleted, does not affect the submission
/// </summary>
Task<DeleteSubmissionResult> CanDeleteSubmission(int submissionId);

Expand All @@ -32,7 +32,7 @@ IEnumerable<SubmissionStatus> AvailableStatuses(SubmissionStatus currentStatus,
Task<DeleteSubmissionResult> DeleteSubmission(int submissionId);

/// <summary>
/// Returns whether or not a publication can be unpublished, does not affect the publication
/// Returns whether a publication can be unpublished, does not affect the publication
/// </summary>
Task<UnpublishResult> CanUnpublish(int publicationId);

Expand All @@ -49,7 +49,7 @@ IEnumerable<SubmissionStatus> AvailableStatuses(SubmissionStatus currentStatus,

/// <summary>
/// Obsoletes a publication with the existing publication.
/// In addition, it marks and syncs the obsoleted youtube videos
/// In addition, it marks and syncs the obsoleted YouTube videos
/// </summary>
/// <param name="publicationToObsolete">The movie to obsolete</param>
/// <param name="obsoletingPublicationId">The movie that obsoletes it</param>
Expand Down Expand Up @@ -346,7 +346,7 @@ public async Task<UnpublishResult> Unpublish(int publicationId)

foreach (var obsoletedPub in obsoletedPubsWithYoutube)
{
// Re-query to get all of the includes
// Re-query to get all the includes
// We can afford these extra trips, compared to the massive query it would be
// for a single trip
var queriedPub = await _db.Publications
Expand Down
8 changes: 4 additions & 4 deletions TASVideos.Core/Services/TASVideoAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public async Task PostSubmissionPublished(int submissionId, int publicationId)
{
var topic = await _db.ForumTopics.SingleOrDefaultAsync(f => f.SubmissionId == submissionId);

// We intentionally silently fail here.
// Otherwise we would leave publication in a partial state
// We intentionally silently fail here,
// otherwise we would leave publication in a partial state
// which would be worse than a missing forum post
if (topic is not null)
{
Expand Down Expand Up @@ -115,8 +115,8 @@ public async Task PostSubmissionUnpublished(int submissionId)
{
var topic = await _db.ForumTopics.SingleOrDefaultAsync(f => f.SubmissionId == submissionId);

// We intentionally silently fail here.
// Otherwise we would leave publication in a partial state
// We intentionally silently fail here,
// otherwise we would leave publication in a partial state
// which would be worse than a missing forum post
if (topic is not null)
{
Expand Down
4 changes: 2 additions & 2 deletions TASVideos.Core/Services/TASVideosGrue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public async Task RejectAndMove(int submissionId)
{
var topic = await _db.ForumTopics.SingleOrDefaultAsync(f => f.SubmissionId == submissionId);

// We intentionally silently fail here.
// Otherwise we would leave submission rejection in a partial state
// We intentionally silently fail here,
// otherwise we would leave submission rejection in a partial state
// which would be worse than a missing forum post
if (topic is not null)
{
Expand Down
4 changes: 2 additions & 2 deletions TASVideos.Core/Services/TopicWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ public async Task UnwatchTopic(int topicId, int userId)
// Do nothing
// 1) if a watch is already removed, we are done
// 2) if a watch was updated (for instance, someone posted in the topic),
// there isn't much we can do other than reload the page anyway with an error
// there isn't much we can do other than reload the page anyway with an error.
// An error would only be modestly helpful anyway, and wouldn't save clicks
// However, this would be an nice to have one day
// However, this would be a nice to have one day
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions TASVideos.Core/Services/UserManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public UserManager(
_wikiPages = wikiPages;
}

// Clears the user claims, and adds a distinct list of user permissions
// Clears the user claims, and adds a distinct list of user permissions,
// so they can be stored and retrieved from their cookie
public async Task<IEnumerable<Claim>> AddUserPermissionsToClaims(User user)
{
Expand Down Expand Up @@ -81,7 +81,7 @@ public async Task<IReadOnlyCollection<PermissionTo>> GetUserPermissionsById(int
}

/// <summary>
/// Returns the the number of unread <see cref="PrivateMessage"/>
/// Returns the number of unread <see cref="PrivateMessage"/>
/// for the given <see cref="User" />
/// </summary>
public async ValueTask<int> GetUnreadMessageCount(int userId)
Expand Down Expand Up @@ -307,7 +307,7 @@ public async Task AddStandardRoles(int userId)
return null;
}

// If it is the recipient and the message is not deleted
// If it is the recipient and the message are not deleted
if (!pm.ReadOn.HasValue && pm.ToUserId == userId)
{
pm.ReadOn = DateTime.UtcNow;
Expand All @@ -333,7 +333,7 @@ public async Task AddStandardRoles(int userId)
/// <summary>
/// Assigns any roles to the user that have an auto-assign post count
/// property, that the user does not already have. Note that the role
/// won't assigned if the user already has all permissions assigned to that role
/// won't be assigned if the user already has all permissions assigned to that role
/// </summary>
public async Task AssignAutoAssignableRolesByPost(int userId)
{
Expand All @@ -357,7 +357,7 @@ public async Task AssignAutoAssignableRolesByPost(int userId)
.Select(rp => rp.PermissionId)
.ToList();

// If the new role has any permission the user does not have
// If the new role has any permissions that the user does not have,
// then assign the role. Indirectly this also ensures that
// the user will not already have the role
if (newRolePermissions.Any(p => !userPermissions.Contains(p)))
Expand All @@ -384,7 +384,7 @@ public async Task AssignAutoAssignableRolesByPost(int userId)

/// <summary>
/// Assigns any roles to the user that have auto-assign publication set to true,
/// that the user does not already have. Note that the role won't assigned
/// that the user does not already have. Note that the role won't be assigned
/// if the user already has all permissions assigned to that role
/// </summary>
public async Task AssignAutoAssignableRolesByPublication(IEnumerable<int> userIds, string publicationTitle)
Expand Down Expand Up @@ -417,7 +417,7 @@ public async Task AssignAutoAssignableRolesByPublication(IEnumerable<int> userId
.Select(rp => rp.PermissionId)
.ToList();

// If the new role has any permission the user does not have
// If the new role has any permission that the user does not have,
// then assign the role. Indirectly this also ensures that
// the user will not already have the role
if (newRolePermissions.Any(p => !userPermissions.Contains(p)))
Expand Down
Loading

0 comments on commit cbc9f6f

Please sign in to comment.