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

Fixed author name string to remove apostrophe #3151

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sbshah97
Copy link

@sbshah97 sbshah97 commented Dec 20, 2023

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)
Closes #3128

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using wails doctor.

  • Windows
  • macOS
  • Linux

Test Configuration

Please paste the output of wails doctor. If you are unable to run this command, please describe your environment in as much detail as possible.

Checklist:

  • I have updated website/src/pages/changelog.mdx with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Refactor
    • Improved handling of author names by removing extraneous characters.

Copy link
Contributor

coderabbitai bot commented Dec 20, 2023

Walkthrough

The update to the codebase addresses an issue where an apostrophe in the author's name in the wails.json file would cause the application to crash. The modification ensures that author names with apostrophes are handled correctly, by removing the need to escape such characters, thus preventing crashes during the application development process.

Changes

File Path Change Summary
v2/cmd/wails/init.go Modified options.AuthorName by removing backslashes and an apostrophe at line 230
website/src/pages/changelog.mdx Various updates including fixes for author name handling, addition of platform specification for dev command, Windows options support, and Apple Silicon hardware detection in wails doctor

Assessment against linked issues

Objective Addressed Explanation
Identify the source of the author name in the wails.json file. (#3128)
Ensure that the author name with an apostrophe is handled correctly without causing application crashes. (#3128)
Modify the code to handle apostrophes in author names without generating escape characters. (#3128)
Verify that running wails dev with an author name containing an apostrophe does not result in a crash. (#3128) The objective is addressed by the code change, but verification requires manual testing which is not covered by the code review.
Update the script to handle special characters, such as apostrophes, in author names appropriately. (#3128)

Poem

In the code where strings entwine,
A rabbit hopped to fix a line.
No more crashes, devs delight,
Apostrophes now handled right. 🐇✨

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 3c7a218 and 969c798.
Files selected for processing (1)
  • v2/cmd/wails/init.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • v2/cmd/wails/init.go

@leaanthony
Copy link
Member

Thanks 🙏 Please could you add an entry to the changelog located at website/src/pages/changelog.mdx?

@leaanthony leaanthony added the awaiting feedback More information is required from the requestor label Jan 3, 2024
@sbshah97
Copy link
Author

sbshah97 commented Jan 5, 2024

Hi, added the changelog message, @leaanthony

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 969c798 and 3be3546.
Files selected for processing (1)
  • website/src/pages/changelog.mdx (1 hunks)
Additional comments: 1
website/src/pages/changelog.mdx (1)
  • 19-21:

website/src/pages/changelog.mdx Outdated Show resolved Hide resolved
website/src/pages/changelog.mdx Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 3be3546 and 86b7785.
Files selected for processing (1)
  • website/src/pages/changelog.mdx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • website/src/pages/changelog.mdx

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 86b7785 and 16d1d41.
Files selected for processing (1)
  • website/src/pages/changelog.mdx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • website/src/pages/changelog.mdx

@leaanthony
Copy link
Member

@sbshah97 - I recalled that there are sometimes legitimate backslashes in git names. The example I was shown was windows domain users that can have git names of MYDOMAIN\USER. It would be better to make your replacement more explicit, e.g. replace \' with '.

@leaanthony
Copy link
Member

@sbshah97 - ping

@sbshah97
Copy link
Author

sbshah97 commented Mar 3, 2024

Hi apologies. I missed this. Coming back to this will make some changes later today.

@@ -230,6 +230,7 @@ func findAuthorDetails(options *templates.Options) {
name, err := git.Name()
if err == nil {
options.AuthorName = strings.TrimSpace(name)
options.AuthorName = strings.Replace(options.AuthorName, "\\", "", -1)
Copy link
Member

Choose a reason for hiding this comment

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

This isn't removing an apostrophe from the name but rather a backslash. Perhaps a function sanitizeName would be appropriate if there are additional characters to be removed in the future.

Is this the only bad character that can occur?

Copy link
Author

Choose a reason for hiding this comment

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

Sorry didn't get this, what is the change we are looking for ?

From what I understand,

  1. Create a function called sanitizeName
  2. Remove apostrophe from the author name instead of back slash.

ANything else?

Copy link
Member

Choose a reason for hiding this comment

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

My point is the change doesn't accomplish what your PR title says it does.

I am not sure what the correct output is based on this change set and your comments.

@leaanthony
Copy link
Member

@sbshah97 - any thoughts on this?

@sbshah97
Copy link
Author

sbshah97 commented May 7, 2024

Hi slightly caught on stuff. Happy in case someone else wants to make the proposed fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback More information is required from the requestor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apostrophe in Autogenerated Name Causes Application Crash
3 participants