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

Multiple file sources #149

Closed
spenserblack opened this issue Aug 31, 2023 · 3 comments · Fixed by #194
Closed

Multiple file sources #149

spenserblack opened this issue Aug 31, 2023 · 3 comments · Fixed by #194
Labels
enhancement New feature or request

Comments

@spenserblack
Copy link
Owner

spenserblack commented Aug 31, 2023

Right now, the file source is a git repository via git2. But the analyzer is pretty flexible, and basically just needs to receive a filepath and bytes. So it might be cool to have a trait like FileSource, which would require an iterator method that returns a path and bytes and a static open method.

Besides a git repository, another source could be the filesystem.


This could also perhaps lead to multiple binaries -- git-gengo would analyze a git repository, and gengo would analyze a directory.

@spenserblack
Copy link
Owner Author

#150 (comment) Different file sources may have utilities that are too specific for a generic FileSource trait. So it might make more sense to have multiple implementations for multiple file sources.

@Byron
Copy link
Contributor

Byron commented Sep 3, 2023

I also recommend to move the git-specific code into its own submodule to pave the way to one day allow it (and its dependencies) to be turned off. gengo can compile much faster once gix isn't in the dependency tree anymore.

@spenserblack
Copy link
Owner Author

Notes based on discussion in #174:

  • Allowing sources to define their own overrides with MySource::with_overrides(overrides) could be nice, especially for more generic implementations
    • based on this, some sort of Overrides::from_gitattributes() could be nice

spenserblack added a commit that referenced this issue Sep 26, 2023
This changes the implementation of `Gengo` to take a generic `FileSource` type, moving git-specific
stuff to its own module. This breaks usage by moving the `rev` argument from `Gengo::analyze` to
`Builder::new` (there's a good chance that this will break again once other file sources are implemented).

Closes #150
Resolves #165
Related to #149
spenserblack added a commit that referenced this issue Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants