-
Notifications
You must be signed in to change notification settings - Fork 457
Make readProjectFromPaths use typed paths. #355
Conversation
<*> argument str (metavar "DIR") | ||
<*> optional (pathOption (long "root" <> help "Root directory of project. Optional, defaults to entry file/directory." <> metavar "DIR")) | ||
<*> many (pathOption (long "exclude-dir" <> help "Exclude a directory (e.g. vendor)" <> metavar "DIR")) | ||
<*> argument path (metavar "PATH") |
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.
It’s still expected to be a directory, right? The metavar should probably still indicate that.
Edit: I believe I was mistaken, so this is a good detail to have caught 👍 thank you!
readProjectFromPaths :: MonadIO m => Maybe FilePath -> FilePath -> Language -> [FilePath] -> m Project | ||
readProjectFromPaths :: MonadIO m | ||
=> Maybe Path.AbsRelDir -- ^ An optional root directory for the project | ||
-> Path.AbsRelFileDir -- ^ A file or directory to parse. Passing a file path loads all files in that file's parent directory. |
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.
I gotta say, I’m not sold on this semantic, but it looks to me like you’re maintaining the current behaviour and not introducing this so let’s see about resolving it separately from this PR.
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.
Yeah, it’s pretty shifty! Revealing weirdnesses like this is one of my favorite parts of adding pathtype
everywhere: it lays bare the sins were committing and not even knowing it.
This function has been a bête noire for some time; I’m glad to see it getting some type safety.