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

Respect extensions cli option when filtering individual files #562

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

robcmills
Copy link
Contributor

Resolves #561

@facebook-github-bot
Copy link

Hi @robcmills!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@robcmills robcmills changed the title Respect extensions when filtering individual files Respect extensions cli option when filtering individual files Jun 28, 2023
@Daniel15
Copy link
Member

This could go either way - it's not defined whether passing in an exact filename should bypass the extension filter or not. Changing it so everything observes the extension filter seems reasonable to me though.

@Daniel15 Daniel15 merged commit c2ba556 into facebook:main Jul 18, 2023
@ElonVolo ElonVolo mentioned this pull request Oct 16, 2023
ElonVolo pushed a commit that referenced this pull request Oct 16, 2023
ElonVolo pushed a commit to ElonVolo/evcodeshift that referenced this pull request Oct 17, 2023
@lg-kialo
Copy link

lg-kialo commented Nov 8, 2023

This could go either way - it's not defined whether passing in an exact filename should bypass the extension filter or not. Changing it so everything observes the extension filter seems reasonable to me though.

@Daniel15 I disagree, for a single filename supplying the extension twice (once in the filename and once as --extension flag) seems redundant.

@Daniel15
Copy link
Member

Daniel15 commented Nov 8, 2023

@lg-kialo The --extension flag is optional. You don't have to provide it.

@lg-kialo
Copy link

lg-kialo commented Nov 8, 2023

@Daniel15 you do have to provide it if you want to transform files with extension different than .js.
Before version 0.15.1 jscodeshift -t transform.ts fileToTransform.tsx used to work, now one is forced to use jscodeshift -t transform.ts --extensions=tsx fileToTransform.tsx

@lg-kialo
Copy link

lg-kialo commented Nov 8, 2023

My suggestion would be that if no --extensions flag is passed, we don't filter by extension at all. Instead of filtering only files with the default extension (.js) as it is now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

extensions cli option not respected when passing individual file paths
4 participants