Skip to content

MRVA: Fix grammar in pop-up message#1416

Merged
shati-patel merged 3 commits intomainfrom
shati-patel/minor-grammar-fix
Jul 1, 2022
Merged

MRVA: Fix grammar in pop-up message#1416
shati-patel merged 3 commits intomainfrom
shati-patel/minor-grammar-fix

Conversation

@shati-patel
Copy link
Copy Markdown
Contributor

Very minor, but the message Successfully scheduled runs on 1 repositories. has been bugging me for a while 😅

Just a bit of minor polish to pluralize (and singularize?) "repositories" appropriately! Happy to change if there are nicer ways of doing this 😀

(Also fixes 2 unrelated typos while I'm here)

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@shati-patel shati-patel requested review from a team as code owners June 30, 2022 11:39
);
});

it('should parse a successful response with only one repo', () => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I could have edited an existing test instead of adding a new one, but I liked the idea of just testing this one specific thing 🧪 (Happy either way though!)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's ok. Testing one thing at a time is good testing practice 👍

Copy link
Copy Markdown
Contributor

@robertbrignull robertbrignull left a comment

Choose a reason for hiding this comment

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

The number of typos 🙈

Changes LGTM

Could go further if you wanted to and apply the same change to the ${invalid_repositories.length} repositories were invalid and similar code just a few lines below. Maybe the code to make the "N repositor(y/ies)" message could be a reusable method. Also happy to go with this change and look at the other bits later if that's easier.

Copy link
Copy Markdown
Contributor

@robertbrignull robertbrignull left a comment

Choose a reason for hiding this comment

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

LGTM 👍 🚢 🇮🇹

Up to you if you want to get a second opinion, since I helped write one of the commits 🤷

logMessage += `:${eol}${cutoff_repositories.join(', ')}`;
if (cutoff_repositories_count !== cutoff_repositories.length) {
logMessage += `${eol}...${eol}And ${cutoff_repositories_count - cutoff_repositories.length} more repositrories.`;
logMessage += `${eol}...${eol}And ${cutoff_repositories_count - cutoff_repositories.length} more repositories.`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is right, please check my syntax (both English and Typescript).

Suggested change
logMessage += `${eol}...${eol}And ${cutoff_repositories_count - cutoff_repositories.length} more repositories.`;
const moreRepositories = cutoff_repositories_count - cutoff_repositories.length;
logMessage += `${eol}...${eol}And ${moreRepositories} more ${pluralizeRepositories(moreRepositories)}.`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good point, although this could print 42 more 42 repositories if we're not careful. Perhaps something like

Suggested change
logMessage += `${eol}...${eol}And ${cutoff_repositories_count - cutoff_repositories.length} more repositories.`;
const moreRepositories = cutoff_repositories_count - cutoff_repositories.length;
logMessage += `${eol}...${eol}And another ${pluralizeRepositories(moreRepositories)}.`;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good spot, thanks both! Updated in latest commit 🦒

Copy link
Copy Markdown
Contributor

@robertbrignull robertbrignull left a comment

Choose a reason for hiding this comment

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

Thanks for updating again 🥇

@shati-patel shati-patel merged commit b311991 into main Jul 1, 2022
@shati-patel shati-patel deleted the shati-patel/minor-grammar-fix branch July 1, 2022 11:43
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