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

try to sort all posted checks #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Borda
Copy link
Member

@Borda Borda commented Aug 7, 2023

it help with looking for what was received and what we need

@Borda Borda requested a review from carmocca as a code owner August 7, 2023 08:46
@Borda Borda added the enhancement New feature or request label Aug 7, 2023
@Borda Borda changed the title try to sort all postec checks try to sort all posted checks Aug 7, 2023
Copy link

@carmocca carmocca left a comment

Choose a reason for hiding this comment

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

You'd want to do the same sorting to generateProgressDetailsMarkdown too

@@ -76,6 +76,7 @@ export const generateProgressDetailsCLI = (
for (const availableCheck in postedChecks) {
longestLength = Math.max(longestLength, availableCheck.length);
}
postedChecks.sort((a, b) => a.localeCompare(b))
Copy link

Choose a reason for hiding this comment

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

Have you tested this? ChatGPT suggests that you do

const sortedPostedChecks: Record<string, CheckRunData> = Object.fromEntries(
    Object.keys(postedChecks)
        .sort() // Sort the keys as strings
        .map(key => [key, postedChecks[key]]) // Map sorted keys back to their values
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants