Fork me on GitHub

@kenny Simple explanation, libhoney for some reason has the org.slf4j class in its jar:


That is strange. It seems more recent versions do not have that issue.


<sourceFolder url="file://$MODULE_DIR$/../../clojure/test" isTestSource="true" />
this isTestSource setting in my module .iml file is getting reset to false after re-importing my deps.edn. the test support in cursive doesn't seem to work without marking the test directories as such. is there a way to get around this? can i somehow specify in my deps.edn file that my test directory is special?


@onetom Are you on the dev build, or the old deps integration?


good point... i thought i was on the latest dev version, but im switching between a laptop and a desktop machine and one was on snapshot1 and the other was on snapshot2 i will try to repro the situation later today and report back


So in the old integration, if it came from an alias containing “test”, then the folder would be marked as a test folder. But I actually think I neglected to add that logic in the new integration - I’ll fix that tomorrow.


Regrettably deps doesn’t distinguish between source and test, so I’m left with something like that. If you have any other suggestions for how to identify test folders, let me know.


unfortunately im still flying a bit blind regarding tools deps, so no idea how should it work really. i don't even know how can i check what is the combined effect of applying multiple aliases. in the cursive Clojure Deps tool window i see a test (system) alias, but i don't know where is it coming from. it's not in some system deps.edn file, because that doesn't exist. there is a :test alias in my ~/.clojure/deps.edn but that's commented out. sounds like it's something hard-coded, just like the default maven and clojars repos.


so im actually not sure whether should i shadow that system :test alias with mine, because i don't even know what does it contain. then i have no idea how cursive is using it. does the test runner rely on it? what's the effect of turning it out in the Clojure Deps tool window? would it affect my Run with Deps REPL run configurations, which don't have any special options specified?


it's all very fuzzy to me. and i don't really expect answers, i just wanted to give you an idea what an average user like me is pondering over 🙂


There actually is a system deps file. If you’re on something unixy you can see where it is using -Sdescribe. If you’re on windows, it’s currently bundled with Cursive but is also present in the tools.deps jar, and Cursive will shortly use that one for modern deps versions which contain it.


maybe some metadata extension like this could work and won't collide with future deps.edn keys:

{:paths ^{:cursive/test-paths ["test"]}
        ["src" "test" "../data" "../rules"]


similarly :java-source-paths and :resource-paths would be very welcome too. i was missing them on my last project, where i had to use some autogenerated protobuf java sources and the classes folder too


Why does IntelliJ care if a source file is a test file or not?


it's used for the cmd-shift-t (navigate test) feature


Couldn't you determine that by indexing deftests?


it also highlights the test sources in the project directory tree with a different color and the editor tabs if they are open, so you can distinguish them from the sources easier


and i guess cursive uses it for showing the test result indicators in the gutter too?


Seems like that can be done for anything that is a deftest. The highlighting thing is nice, I suppose.


something didn't work when the test sources werent marked as test sources... can't remember what was it but i will report here when i can reproduce it


Cursive actually doesn’t care, IIRC - if there are things that don’t work it would be interesting to know so I can look at them. It’s possible that the test navigation uses it, in particular for deciding where to create a new test ns if it doesn’t exist.


I just tried to do Cmd-Shift-T to create a test for a new function I just wrote. 1. the Choose test for... popup window appears 2. I can select the sole Create New Test... menu item in it 3. a Choose destination popup appears with a grey No matches found message in the middle of it


but if I mark my test dir to be Test Sources Root, it actually jumps to the corresponding test file and creates a new deftest form for me, which I really like! Great feature, Colin; thanks!


Ok, thanks, I’ll check that out and see if I can make it work sensibly without test roots, and I’ll also fix the test root import.


is there an option to adhere to the clojure style guide automatically?


I have it almost configured, but have a hard time doing this while still keeping 2 spaces for special forms


@stijn Do you have Preferences | Editor | Code Style | Clojure | General | One space list indent selected?


ah yes, that works


can you have map values aligned only when they are on the same line as the key?


{:a :b
 :b :c


instead of

{:a :b
 :b :c


ok, turns out that's not needed for the codebase i'm working on 🙂


@stijn No, but you should be able to 🙂