-
Notifications
You must be signed in to change notification settings - Fork 55
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
Supporting mutiple main files (entry points) for a single project #175
Comments
I think this could be really useful, especially for Crystalline as well. I think this would be best in shard.yml due to the limitations of It would be good to get this (somewhat) standardized before implementing it though, for instance, do the rules parse top to bottom for a file until it's caught, or what happens when a file is caught by multiple endpoints? What happens with an endpoint that doesn't have any includes/excludes? My other thoughts are how this will translate to looking at files in other folders outside of the current project (like shards in |
Using the The only issue I forsee is if a file can be used with multiple targets, but I'm not sure that's a big issue to worry about right now. |
nice, too bad or we can just support reading |
Having targets in the shards override file would work for me, can implement soon |
Currently the extension only support a single entry point with the
Main File
option. But with a large project with many files and multiple entry points (for example microservice webapps) it it not a ideal situation.For example I have a project with this structure:
The services might have conflicting dependencies, so creating another file and require all the file (and point the Main File to it) is not possible as it can cause both compilation time error and runtime error.
So in order to make the extension to work properly I need to change the Main File setting every time I switch from working with service_a to service_b, or just give up making it work again.
Also, as Crystal/Crystalline struggle with larger projects, ideally we need to keep the files required count as little as possible. For example in the example folder structure, the working file
service_1_foo.cr
at most will only need the files fromservice_1
folder, the files fromutilities
folder and the files fromlib
. The files fromservice_2
and other services should not be included in the checking.Another scenario is you implement the code in file
src/service_x/foo.cr
and write the test inspec/service_x/foo_test.cr
. Ideally the main file of current working filesrc/service_x/foo.cr
isspec/service_x/foo_test.cr
, notsrc/service_x.cr
so it can be even faster to check the error.So I hope the extension can support multiple entry points (Main File) mapping for a single project. The structure can be like this:
For the current working file it will run through the include/exclude filters and return the first endpoint that matches. You can switch the main file of the current file by moving the rule up or down.
Also, since the file content can change a lot, it might be better to save it as .vscode setting instead of putting it in
shard.yml
The text was updated successfully, but these errors were encountered: