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

Feat: Add VSCodium Reporter #173

Closed
wants to merge 2 commits into from

Conversation

stevendkwtz
Copy link
Contributor

Add VSCodium Reporter

VSCodium is the open source binary distribution of Microsoft’s editor VS Code.

It is VS Code without the Microsoft telemetry. If VSCode reporter is supported, this should be extremely straightforward to implement, just changing the CLI name from code to codium which I've done.

If you have some suggestions for testing functionaltiy or anything I missed, please let me know. I just put this together quickly because I'm working in a different project which uses this package, and the approvals tool doesn't work with VSCodium, which I use.

Small pull requests are great and easy for me to understand and accept
Please try prefix every commits in the pull request with Arlo's git notation

Prefix Meaning
e development enviroment only - not production
d documentation only
t tests only
R!! Refactoring
B!! Bug Fix
F!! New Feature

But it's not small!

Then you should setup a remote pairing session with Llewellyn ( [email protected] )
Usually the sessions are between 45-90 minutes.

assuming you still feel it is small, please include

Description

A description of what the PR achieves.

The solution

Outline the implementation.
Any tests that are affected.

Notation

I prefer lots of very small commits prefixed with Arlo's git notation

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @stevendkwtz - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Docstrings: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.


class Reporter extends GenericDiffReporterBase {
constructor() {
super("codium");
Copy link

Choose a reason for hiding this comment

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

issue (typo): The constructor argument should match the reporter name 'vscodium', not 'codium'.

This ensures consistency and avoids confusion when referencing the reporter by name.

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 can change this to codiumReporter.js, would prefer a human to advise though, not familiar with this codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update: done

Comment on lines 11 to 15
if (ostools.platform.isWindows) {
this.exePath = autils.searchForExecutable("codium.cmd");
} else {
this.exePath = autils.searchForExecutable("codium");
}
Copy link

Choose a reason for hiding this comment

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

suggestion (code_refinement): Consider verifying the existence of the executable path after assignment.

This adds an extra layer of reliability by ensuring the path indeed points to an existing executable before proceeding.

Suggested change
if (ostools.platform.isWindows) {
this.exePath = autils.searchForExecutable("codium.cmd");
} else {
this.exePath = autils.searchForExecutable("codium");
}
if (ostools.platform.isWindows) {
this.exePath = autils.searchForExecutable("codium.cmd");
if (!fs.existsSync(this.exePath)) throw new Error("Executable not found: codium.cmd");
} else {
this.exePath = autils.searchForExecutable("codium");
if (!fs.existsSync(this.exePath)) throw new Error("Executable not found: codium");
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This smells like a bad suggestion? I only see multireporter throwing


options.cmdArgs = ["-n", "--diff", received, approved];
options.cmdOptionOverrides = {
detached: true,
Copy link

Choose a reason for hiding this comment

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

question (code_clarification): Clarify the need for the 'detached' option in 'cmdOptionOverrides'.

Understanding the specific reason for running the process detached could be beneficial for future maintenance.

isidore added a commit that referenced this pull request May 7, 2024
See #173 for orginal contribution

Co-Authored-By: Clare Macrae <[email protected]>
Co-Authored-By: Steven <[email protected]>
@isidore isidore closed this May 7, 2024
@claremacrae
Copy link
Contributor

Thanks very much - we will release this soon!

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.

None yet

3 participants