Skip to content
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

Why does bikeshed merge other profiles? #41

Open
camsaul opened this issue Sep 13, 2019 · 1 comment
Open

Why does bikeshed merge other profiles? #41

camsaul opened this issue Sep 13, 2019 · 1 comment

Comments

@camsaul
Copy link

camsaul commented Sep 13, 2019

My project.clj looked something like:

(defproject my-project "1.0.0-SNAPSHOT"
  :aliases
  {"bikeshed" ["with-profile" "+bikeshed" "bikeshed"]}

  :bikeshed
   {:plugins [[lein-bikeshed "0.4.1"]]})

and I was super confused when Bikeshed started failing after I added a :source-paths ["test"] to a completely unrelated profile in my project.clj:

(defproject my-project "1.0.0-SNAPSHOT"
  :aliases
  {"bikeshed" ["with-profile" "+bikeshed" "bikeshed"]}

  :bikeshed
  {:plugins [[lein-bikeshed "0.4.1"]]}

  :with-tests-in-source
  {:source-paths ["test"]})

I tried changing adding :source-paths ^:replace ["src"] to the :bikeshed profile but that didn't fix it either:

(defproject my-project "1.0.0-SNAPSHOT"
  :aliases
  {"bikeshed" ["with-profile" "+bikeshed" "bikeshed"]}

  :bikeshed
  {:plugins [[lein-bikeshed "0.4.1"]]
   :source-paths ^:replace ["src"]}

  :with-tests-in-source
  {:source-paths ["test"]})

I ended up having to go thru the lein-bikeshed source to work out what was going on and fixed it by adding --exclude-profiles to the alias.

I have a couple questions:

  1. Is this expected behavior? It seems like it must be, because the --exclude-profiles option exists, but it seems sort of weird and unlike every other Leiningen plugin I can think of.
  2. If it's not expected behavior (or it doesn't make sense anymore) I'm happy to submit a PR to fix it
  3. If it is expected behavior, it would be nice to merge the opts and lein-opts map so you can specify :bikeshed {:exclude-profiles [...]} in project.clj instead of having to pass the exclusions list via a command-line arg. I can PR for this as well.
@dakrone
Copy link
Owner

dakrone commented Sep 17, 2019

To be 100% honest, it's been so long that I no longer remember. I might have merged profiles to pick up other required source on any resource paths, but I'm not certain.

If you think there better behavior, I'd be very happy if you opened a PR for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants