lumo icon indicating copy to clipboard operation
lumo copied to clipboard

Use src by default if -c is missing

Open arichiardi opened this issue 7 years ago • 7 comments

If I read the code right, lumo does not include any folder in its classpath unless you specify it with -c.

Now, given that clj uses src as default, a good idea is to do the same in lumo.

Probably a very very simple change.

arichiardi avatar May 31 '18 16:05 arichiardi

Lumo uses Java classpath semantics. The current directory is automatically added to the classpath.

anmonteiro avatar May 31 '18 16:05 anmonteiro

Wouldn't this mean that I would need to require src.my.namespace? It seems odd.

arichiardi avatar May 31 '18 16:05 arichiardi

only if your namespace is called src.my.namespace. I don't have the habit of naming my namespaces src..... I normally include the src directory in the classpath.

anmonteiro avatar May 31 '18 16:05 anmonteiro

I see I am not making myself clear.

The point is that 99% of the time you have a src folder and your app starts namespacing, if it makes sense, from there. I mean that's the reason why clj makes that a default right?

If you don't have that default, you always need to wrap lumo with lumo -c src. In my code base I have a proliferation of scripts that do nothing much except wrapping lumo and add the classpath.

I guess the goal of clj, and I maintain lumo as well, would be to reduce the amount of wrapping scripts you need.

The default to src brings your somewhat closer to that. Another thing would be https://github.com/anmonteiro/lumo/issues/328.

The Clojure world is going towards that direction, so I think we should do the same.

arichiardi avatar May 31 '18 16:05 arichiardi

I personally don't see much value in this. Most of my projects do not have namespaces directly under src for example. My goto project structure is actually src/test and src/cljs for example. Look no further than Lumo for example.

anmonteiro avatar May 31 '18 16:05 anmonteiro

Well this is not a matter of personal preference imho - it has been chosen by the clj tool so they put enough thoughts on that I guess. Cognitect uses something you describe as well but they indeed chose to include src because the majority of the projects use that folder.

It would be great to ask @puredanger what he thinks of it by the way.

arichiardi avatar May 31 '18 17:05 arichiardi

Definitely agree with @arichiardi on this. I've been drafting a couple of general cljs dev tools and find myself always having to specify lumo -c src.

This seems to be a convention according to: lein boot clj\deps.edn

There's value in providing consistency here, making src the default likely wouldn't affect your common setup since you are likely specifying -c src/cljs:src/test anyway which would overwrite it.

Is there a strong reason for not following that convention?

jaidetree avatar Apr 15 '20 22:04 jaidetree