8000 Allow passing `*.exp` paths to update_testdata_exp.sh by jez · Pull Request #8790 · sorbet/sorbet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow passing *.exp paths to update_testdata_exp.sh #8790

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

Merged
merged 3 commits into from
Apr 24, 2025
Merged

Conversation

jez
Copy link
Collaborator
@jez jez commented Apr 24, 2025

Motivation

Sometimes I want to be able to regenerate all the *.exp files for a
certain kind of expectation. There are two ways to do this:

  1. regenerate everything
  2. list out each *.rb file that has that kind of exp

Doing the second approach always requires writing some fiddly shell
code, and it's easier to just have it here. Now you can do something
like this:

tools/scripts/update_testdata_exp.sh test/testdata/**/*.package.exp

which saves time.

Test plan

Tested manually on another branch where I'm changing exp files.

Sometimes I want to be able to regenerate all the `*.exp` files for a
certain kind of expectation. There are two ways to do this:

1.  regenerate everything
2.  list out each `*.rb` file that has that kind of exp

Doing the second approach always requires writing some fiddly shell
code, and it's easier to just have it here. Now you can do something
like this:

    tools/scripts/update_testdata_exp.sh test/testdata/**/*.package.exp

which saves time.
@jez jez requested a review from a team as a code owner April 24, 2025 21:54
@jez jez requested review from froydnj and removed request for a team April 24, 2025 21:54
Copy link
Contributor
@froydnj froydnj 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 this doesn't work for multiple files?

fi
fi

paths=("$path")
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't accumulate the paths properly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch, thanks

@jez jez requested a review from froydnj April 24, 2025 21:58
@jez jez enabled auto-merge (squash) April 24, 2025 22:00
@jez jez merged commit 6587bd9 into master Apr 24, 2025
15 checks passed
@jez jez deleted the jez-update-test-data branch April 24, 2025 22:18
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
0