-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[EXPERIMENT] add support for checking types with Flow #178
Conversation
Oh, and using flow was how I found #175 😁 |
if (typeof options === 'function') { | ||
callback = options | ||
options = null | ||
function getText(stdout: Buffer | string): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code feels really 💩 but I haven't really dug into whether it's correct here to be paranoid about exec
returning a Buffer
for stdout
and stderr
Let me know if you'd like the Travis changes extracted to a different PR |
Oh dang, I hate that you did all this work! In general I'm anti things that you have to precompile so I wouldn't want to to add Flow or Babel. I'd rather have tests help find errors like the one with I am, however, very interested in 🔥 or reducing Portable Git, though I'm not sure how Flow/Babel would help with that? Can you explain more about how you were thinking it could be 🔥 'd? |
@jlord don't sweat it - it was a fun learning experience for me.
That's fine. I'll have a look into where I could help out with that.
The project itself uses Typescript and removes the dependency of having Git on your PATH - it also supports Windows/macOS/Ubuntu, so it feels like a great fit for Git-It. I wanted to use this exercise as a way to catch regressions as I went through the refactoring exercise, but given how specific |
I'm not sure if this is appealing to you, but as part of my investigation into 🔥ing the PortableGit dependency I started down the path of what it would take to get flow incorporated (so I don't break the callers in the app).
TL;DR:
flow
testing thespawnGit
method and where it's being usedelectron-compile
to handle the transpiling which needs to remove the flow type information, so that we don't need to worry about changing the packaging stepsstandard
now breaks when testing these annotations - I could swap this out to use the Node API and pass in the transpiled output, but that would mean a standalone script rather than a simple commandShip List:
spawnGit
and it's callers to verify the type informationflow
andstandard
as part ofnpm test
spawnGit
to drop unnecessaryexecOpts
parameters