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

Create Aliases with supported characters (and warn on provided unsupported aliases) #254

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

jafeltra
Copy link
Collaborator

This PR updates that aliases that GoFSH creates to ensure that only supported characters are included in the Alias name. To do this, I replaced any unsupported character with -. The PR also makes it so that when provided Aliases use unsupported characters, GoFSH logs the same warning that SUSHI now does.

I couldn't figure out a more elegant way to ignore the leading $ in alias names with the regex, so if I missed something obvious, I'm happy to make the regex ignore that character so the full replacement can be done with alias.replace(...)

- Replace any unsupported characters with '-'
- Include SUSHI's new warning when processing aliases with
  unsupported characters
mint-thompson
mint-thompson previously approved these changes Mar 4, 2024
Copy link
Collaborator

@mint-thompson mint-thompson left a comment

Choose a reason for hiding this comment

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

I think the implementation you went with for replacing unsupported characters is reasonable. The only other way I can think of implementing this is with a replacement function that checks the match offset, but I don't like that as much as your implementation.

Copy link
Member

@cmoesel cmoesel left a comment

Choose a reason for hiding this comment

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

I like it. It's pretty clean, which is always welcome!

I've made a couple of comments that I think should be addressed before we merge this.

src/optimizer/utils.ts Outdated Show resolved Hide resolved
src/processor/AliasProcessor.ts Outdated Show resolved Hide resolved
Copy link
Member

@cmoesel cmoesel left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thank you!

@jafeltra jafeltra merged commit 4af59b4 into master Mar 7, 2024
14 checks passed
@jafeltra jafeltra deleted the no-unsupported-aliases branch March 7, 2024 15:32
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.

3 participants