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

feat: reuse format options logic for stdin #36

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

43081j
Copy link
Contributor

@43081j 43081j commented Feb 8, 2025

This is a first attempt at re-using the format options logic when stdin mode has been given a file path.

There is still code clean up to do, but this should roughly work.

This is a first attempt at re-using the format options logic when stdin
mode has been given a file path.

There is still code clean up to do, but this should roughly work.
@fabiospampinato
Copy link
Collaborator

fabiospampinato commented Feb 9, 2025

I think we shouldn't have utility functions in index.ts. If we can do this with minimal changes it would be great 🤔

@43081j
Copy link
Contributor Author

43081j commented Feb 9, 2025

yep I agree. I planned on moving them out before publishing this pr, so will do that once I'm back from London this week 👍

@fabiospampinato
Copy link
Collaborator

Worth considering trying to not have them in the first place if possible, this change seems kinda big and kinda disruptive 🤔

@43081j
Copy link
Contributor Author

43081j commented Feb 9, 2025

how else can you do it?

the logic in there right now is very intertwined. lots of logic crossing paths, making it difficult to extract without repeating some things

you'd rather duplicate all of it into the stdin function? 🤔

@fabiospampinato
Copy link
Collaborator

Maybe there isn't a less disruptive way, I'm not sure what the solution is exactly 🤔

I think I'd want to explore how to map the stdin with ~filepath code path into the globs code path, like maybe processing stdin with ~filepath in some way is kinda like searching with a very specific glob, and making sure a result is "found" for it even if not in the filesystem, and maybe bypassing the cache, and a couple very minor tweaks like that? 🤔

I think we should explore doing it that way if possible at all, to not majorly change the code.

@fabiospampinato fabiospampinato force-pushed the main branch 3 times, most recently from 0c953fb to ada6549 Compare February 10, 2025 01:33
@fabiospampinato fabiospampinato force-pushed the main branch 4 times, most recently from 34e0257 to f8dc396 Compare March 6, 2025 00:45
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