Allow running kibit w/o project.clj #27

Closed
swannodette opened this Issue Mar 30, 2012 · 7 comments

Comments

Projects
None yet
5 participants

Unless there's some particular reason for the limitation. One benefit of this is that kibit can be run on Clojure itself without having to create a project.clj. The time it takes for kibit to run on Clojure's source is also a reasonable performance benchmark.

Owner

jonase commented Mar 31, 2012

I'll be working on the plugin part of kibit the next couple of days. I have lots of ideas and I'll definitely keep this in mind. Currently, I'm aiming for something like:

$ lein kibit ;; Must be run inside a project. Will check all namespaces found in :source-paths

$ lein kibit some.namespace ;; Must be run inside a project and will only check some.namespace
                            ;; for example `$ lein kibit clojure.core.logic` would run kibit on 
                            ;; the clojure.core.logic namespace (if core.logic is one of the 
                            ;; dependencies specified in project.clj)

$ lein kibit "path/to/file.clj" ;; can be run outside a project to check any .clj file 

jonase was assigned Mar 31, 2012

Sounds good though for the last one I think specifying directories should work too.

Collaborator

ohpauleez commented Mar 31, 2012

Agreed with the directory lookup.

Jonas, want me to tackle the plugin while you tackle the rules?

Owner

jonase commented Apr 1, 2012

@ohpauleez - Thanks! Go for it!

Make sure you understand the difference between

  • running with or without a project.clj,
  • within the project process or within the leiningen process.

It's all very well described in the plugin guide. I think a "good" patch would also solve issue #26.

When running kibit in the project's process you could look at the very first released version of kibit on how to find a source file given a namespace symbol (note, this was broken only because I ran it within the leiningen process).

ohpauleez was assigned Apr 1, 2012

Is this issue dead, or implemented already?

I was looking at the documentation for Kibit, and didn't see a way to run it on a Clojure source file without using Leiningen, and came here. Is this functionality available, or planned?

danielcompton added this to the 0.1.0 release milestone Nov 10, 2014

Collaborator

danielcompton commented Nov 10, 2014

Here's the status of the tasks

  • Able to call lein kibit with one or more filenames or globbed filenames inside and outside a project
  • Able to call lein kibit with a directory inside and outside a project
  • Able to call lein kibit with one or more namespaces (not implemented currently)
  • Update README with documentation on running in these modes
Collaborator

danielcompton commented Nov 25, 2014

Most of this is implemented, I've put calling kibit with namespaces into #114.

@jpb jpb added a commit to jpb/kibit that referenced this issue Apr 13, 2016

@jpb jpb Automatically apply suggestions to source files
Introduces `--replace` and `--interactive` cli arguments to automatically
replace suggestions in source files.

Initial port from jpb/kibit-replace b49410c

Resolves #27
eac2975

@jpb jpb added a commit to jpb/kibit that referenced this issue Apr 16, 2016

@jpb jpb Automatically apply suggestions to source files
Introduces `--replace` and `--interactive` cli arguments to automatically
replace suggestions in source files.

Initial port from jpb/kibit-replace b49410c

Resolves #27
b076c60

@jpb jpb added a commit to jpb/kibit that referenced this issue Apr 16, 2016

@jpb jpb Automatically apply suggestions to source files
Introduces `--replace` and `--interactive` cli arguments to automatically
replace suggestions in source files.

Initial port from jpb/kibit-replace b49410c

Resolves #27
9a0734d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment