This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-14
Channels
- # 100-days-of-code (4)
- # announcements (1)
- # beginners (63)
- # boot (22)
- # braveandtrue (104)
- # calva (3)
- # cider (12)
- # cljs-dev (53)
- # cljsjs (3)
- # cljsrn (1)
- # clojure (180)
- # clojure-dev (14)
- # clojure-italy (4)
- # clojure-nl (11)
- # clojure-spec (15)
- # clojure-uk (60)
- # clojure-ukraine (1)
- # clojurescript (118)
- # clojutre (3)
- # core-async (12)
- # core-logic (17)
- # cursive (19)
- # datomic (45)
- # devcards (4)
- # emacs (7)
- # figwheel-main (218)
- # fulcro (27)
- # funcool (3)
- # graphql (1)
- # jobs (4)
- # leiningen (57)
- # off-topic (71)
- # pedestal (2)
- # portkey (17)
- # re-frame (5)
- # reitit (4)
- # remote-jobs (2)
- # ring (11)
- # rum (2)
- # shadow-cljs (14)
- # specter (11)
- # sql (34)
- # tools-deps (23)
so I have a lein plugin that adds a profile in its middleware
I expect, after adding that plugin to a project in its top-level :plugins
, that I can use that profile, e.g. via :profiles {:dev [:my-profile {...}]}
this seems to work, except that leiningen prints a warning saying the profile is not found
as far I as can tell it's being used
if I add a println to the middleware, I can tell the warning is printed before the middleware is run
is there some better way for a plugin to register a profile?
@gfredericks I think this is common
If you track back through history in lein
you can see the change was made to make that “missing profile” thing a warning instead of failing - it used to fail.
the reason is that plugins may add profiles, but there are earlier “passes” over the project map where those haven’t been added yet. I think there were issues related to this
a false positive is a pretty severe thing to put up with though
I guess I should clarify that at this point I'm complaining about having to see the warning; I don't think I have any other issues
hmm; seems I can suppress the warning by adding an empty version of the profile to the top-level :profiles
map and the provided one still works
so that's significantly better
if you can add a top-level that helps, but that means anyone using your plugin would have to do that
but the profile lookup logic happens several times throughout the initialization of things
yeah both solutions are annoying, but the extra entry is less annoying than a printed warning on every task
do you think this is Fundamentally Unsolvable?
I was pretty sure I saw discussion on this a long while back, but can’t find anything now
any chance that warnings could be queued up until all middlewares have been processed?
at worst there could be a less hacky warning suppression mechanism
:suppress-missing-profile-warnings #{:my-profile}
wait wait
this plugin is top-level
so you should be able to at least run the top-level plugin middlewares before loading any profiles
but I’m not sure how hard that’d be or if that’d mess up any other initialization steps that are expected prior to plugin loading
then A
may need to see the :profiles
, so will have to load them before B
gets to and then the missing warning would happen right?
plugins can see profiles?
it seems like there's no good mechanism for a plugin to add non-production things to a project
dependencies in particular are what I'm concerned with
lein-modules
may do some similar sorts of things https://github.com/jcrossley3/lein-modules