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

Rewriter doesn't actually rewrite #52

Closed
jackbsteinberg opened this issue Aug 23, 2019 · 3 comments · Fixed by #53
Closed

Rewriter doesn't actually rewrite #52

jackbsteinberg opened this issue Aug 23, 2019 · 3 comments · Fixed by #53
Milestone

Comments

@jackbsteinberg
Copy link
Owner

At this time the rewriter when run processes the file, determining what the rewritten output would be, but doesn't use that output to actually rewrite the file.

The code needs to be updated to reflect the requirement of actually rewriting, and should get an integration test for this at the same time.

@fergald
Copy link
Collaborator

fergald commented Aug 26, 2019

I don't think anyone will ever want to overwrite their original code with the new code. We need to support outputting to a different directory (and if necessary, creating the same directory hierarchy on the output side as we find on the input side - but only for directories that have output files).

@domenic
Copy link
Collaborator

domenic commented Aug 26, 2019

Hmm, overwriting the source file is pretty common in the JS rewriter ecosystem, given the existence of source control etc. (See e.g. jscodeshift or prettier.)

If you think we should also have a feature that outputs to a different directory, then let's open a separate issue for that, and figure out how to prioritize it.

@fergald
Copy link
Collaborator

fergald commented Aug 27, 2019

I don't think this is JS-world vs others. I just don't think rewriting the input file is useful for get-originals. It makes sense for a reformatter to overwrite the source because you actually want to continue on with the rewritten code as your human-edited code (and clang-format supports this) but you're never going commit the original-ified version of a script as a replacement for the naive source and then work with that going forward, are you?

Chrome's build process definitely needs this (I think most build processes do not like steps that modifies the inputs). So #59 filed.

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 a pull request may close this issue.

3 participants