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

NCD-672: initial code review #26

Merged
merged 19 commits into from
Jan 26, 2024
Merged

NCD-672: initial code review #26

merged 19 commits into from
Jan 26, 2024

Conversation

cybic
Copy link
Contributor

@cybic cybic commented Jan 24, 2024

Tried to incorporate as much as possible from the code review.

Copy link

Make sure to add the "doc required" or "doc not required" label.

@aadnekar aadnekar added the doc not required All PRs either need "doc required" or "doc not required". label Jan 24, 2024
Copy link
Contributor

@aadnekar aadnekar left a comment

Choose a reason for hiding this comment

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

Great improvements!

I really think it's cool to see the xor function in use, think it helps to make the code consice and readable.
We could considering extracting it into it's own file, and then rather importing it in the different use cases. But that's far from important.

Well done! 🙌

onClick={() => {
console.dir(device);
// console.dir(device);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you not remove the console.log?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had actually removed it but for some reason it wasn't committed :/ Doing it now 👍

Comment on lines 57 to 66
logger.debug(
`Got device ${JSON.stringify(device)} ${JSON.stringify(
boardRevision
)}`
);
logger.debug(
`Device with boardVersion: ${JSON.stringify(
device?.devkit?.boardVersion
)}`
);
Copy link
Contributor

Choose a reason for hiding this comment

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

If the plan is to keep this, we could consider extracting the logging into a function?

// Define it somewhere:
const logDeviceInfo = (device: Device) => {
     logger.debug(
            `Got device ${JSON.stringify(device)} ${JSON.stringify(
                boardRevision
            )}`
        );
        logger.debug(
            `Device with boardVersion: ${JSON.stringify(
                device?.devkit?.boardVersion
            )}
}

// ... and call it
logDeviceInfo(device);

sorry for the formatting, wish Github had autoformatting

@cybic cybic merged commit 0903ee7 into main Jan 26, 2024
2 checks passed
@cybic cybic deleted the NCD-672_initial_code_review branch January 26, 2024 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc not required All PRs either need "doc required" or "doc not required".
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants