Skip to content

Conversation

@43081j
Copy link
Collaborator

@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
Collaborator 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
Collaborator 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