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

Data/op reviewer info export #5049

Closed
wants to merge 15 commits into from
Closed

Conversation

motechFR
Copy link
Contributor

WHAT

WHY

@mattcasey mattcasey requested a review from Copilot November 20, 2024 16:04

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 suggestion.

Comments skipped due to low confidence (1)

scripts/optimism/getProposalReviewerStats.ts:113

  • The variable name 'intakeStap' is a typo. It should be renamed to 'intakeStep'.
let intakeStap: ProposalStep | undefined;
@charmverse charmverse deleted a comment from Copilot bot Nov 21, 2024
@@ -0,0 +1,8 @@
export default {
// Teardown function after all tests run
Copy link
Member

@mattcasey mattcasey Nov 21, 2024

Choose a reason for hiding this comment

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

remove comment


export function getUniqueWeeksCount(events: Date[]): number {
// Helper function to calculate the ISO week number
function getWeekNumber(date: Date): number {
Copy link
Member

@mattcasey mattcasey Nov 21, 2024

Choose a reason for hiding this comment

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

Strongly prefer we do not write/maintain our own date logic and use libs instead. This code is extremely hard to follow

You should be able to just do DateTime.fromJSDate(date).weekYear

https://moment.github.io/luxon/api-docs/index.html#datetimeweeknumber

Copy link
Member

@mattcasey mattcasey left a comment

Choose a reason for hiding this comment

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

Would be better if you used a date library instead of AI to do date math (I'm assuming that method was generated :). I think I wouldn't even point it out if it was part of the single-use script, but when it lives in the utils package it means it can be used anywhere, and we should always default to using luxon in our production code

@mattcasey mattcasey closed this Dec 9, 2024
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.

2 participants