This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-17
Channels
Hiyo! Is there a way to tell clj-kondo to ignore misplaced docstrings? Looking through the readme/docs, not seeing any config settings for this?
I have been putting #_:clj-kondo/ignore
in front of functions with docstrings, so that works but is less desirable to pollute code with comments and obviates (one of the) reason why I like to have docstring following argument vector, which is better line compactness; and also, that’s how I’m used to writing my functions in other Lisps. :face_exhaling: 🤷
Placing it there means it isn’t really available unless you’re looking at the source though
I find readability more joyful with my arguments on the same line as my function name, perhaps out of habit in other Lisps. And also saves on screen real-estate.
E.g. C-c C-d d
will show you the docstring for any function in Emacs, but you have to stick it in the right place.
A string following the argvec is simply not a docstring. If you don’t want to follow this linter rule, which is off by default, why just not let it stay disabled?
I’d say you’re throwing out good effort in the name of familiarity. Switch it up, and you’ll be familiar with the Clojure way in notime 😊
@U9MKYDN4Q Gut zu wissen… good to know, I s’pose. @U04V15CAJ I’m using LSP mode… so not sure exactly what linter rules they have set, or how to twiddle those knobs…. Anyways, thanks for the edification. I get why Clojure has its orderings as it does; internally quite consistent and nice and beautiful. tyty
Note that docstrjngs are saved as metadata on the var and used by tooling. Putting it in the wrong place will get you different results for (doc foo) for example
I hesitate to suggest this, but: why not just make a macro with the desired syntax?
Quick question around importing configurations from libraries: how does clj-kondo determine what dependencies a project has? Does it look for and parse a deps.edn
? Does it also work if the project only has a project.clj
?
Aha, the --lint $(clojure -Spath)
. I see.