clojureVSCode icon indicating copy to clipboard operation
clojureVSCode copied to clipboard

Disable `:pedantic? :abort` when starting `lein repl`

Open marcomorain opened this issue 6 years ago • 9 comments

At CircleCI we use :pedentic? :abort in most of our leiningen projects. This option prevents the leiningen from starting the repl unless there are no conflicting dependencies in the app.

When clojureVSCode starts the repl, it adds additional dependencies to the app, which often causes the :pedantic? :abort checks to fail, and the repl fails to start.

I suggest that we override the penantic flag set it to the default value, :ranges when starting the repl from VSCode.

Thoughts?

marcomorain avatar Feb 09 '18 12:02 marcomorain

My current work around is comment out :penantic? :abort when loading a project in code.

marcomorain avatar Feb 09 '18 12:02 marcomorain

Another option could to be to start leiningen with a specific profile when starting from vscode.

Then I could add a custom setting in my ~/.lein folder for this:

 {:vscode {:pedantic :ranges}}

marcomorain avatar Feb 09 '18 12:02 marcomorain

Hi @marcomorain and thank you for your recent contributions 👍

Could you point me out where do we set this option? I glanced through the code but haven't found any mentions of it. Is this option set by Leiningen implicitly?

avli avatar Feb 09 '18 14:02 avli

We set this option on our projects in project.clj

This means that if our projects depend on any versions of nrepl or clj-fmt that are different from the versions that clojureVSCode injects, our projects fail to start.

I think I will make a PR to your README.clj with a description of the issue and how to fix it by editing ~/.lein/profiles.clj

👍

marcomorain avatar Feb 09 '18 14:02 marcomorain

Oh, now I see :-)

This makes me think, that the right approach here is to provide a configuration option for passing arbitrary parameters for nREPL as we do for cljfmt. What do you think?

avli avatar Feb 09 '18 15:02 avli

If we invoke the repl with lein repl :headless :vscode then users could put any special lein options that they would like into a :vscode profile in ~/.lein/profiles.clj

marcomorain avatar Feb 09 '18 20:02 marcomorain

As it stands, lein repl uses the :repl profile in ~/.lein/profiles.clj

marcomorain avatar Feb 09 '18 20:02 marcomorain

In this case, let's invoke nREPL with :vscode and add a section with the description of how to get an advantage of it to README.md. What do you think?

avli avatar Feb 10 '18 06:02 avli

I'm running into this as well, and it appears the README update about how to work around it by editing ~/.lein/profiles.clj never happened. Would you mind outlining that fix here?

MikaelSmith avatar Dec 18 '18 19:12 MikaelSmith