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

releasego azure linux update: regexp readability, handle "$" #168

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

dagood
Copy link
Member

@dagood dagood commented Sep 10, 2024

Inspired by #166 (comment). Making the group numbers ([2], ${1}, ${3}) into constants (and doing nothing else) leads to clutter and long names, but we can still do a lot better by putting the usage right next to the regexp to make it easy to read and modify in the future.

I can imagine writing an extra abstraction on top of these "find/replacers" to make all of this even tidier, but it doesn't seem necessary here. It could actually hurt by making things less flexible.

Also, a couple other changes targeting readability:

  • Handling $ rather than erroring out isn't (currently) functionally useful, but doing so simplifies the code, so go ahead and do it.
  • Rearrange updateSpecFile to group the replacements together.

@dagood dagood requested a review from a team as a code owner September 10, 2024 17:08
@karianna karianna merged commit 1b37c9b into main Sep 10, 2024
11 checks passed
@dagood dagood deleted the dev/dagood/regexp-readability branch September 10, 2024 22:56
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