(eastwood-core reporter
opts
cwd
{:keys [namespaces dirs files file-map non-clojure-files]
:as effective-namespaces}
linters)
Lint a sequence of namespaces using a specified collection of linters.
Prerequisites:
Arguments:
Side effects:
Return value:
Lint a sequence of namespaces using a specified collection of linters. Prerequisites: + eastwood.lint namespace is in your classpath + TBD: Eastwood resources directory is in your classpath + eastwood.lint namespace and its dependencies have been loaded. Arguments: + TBD: to be documented Side effects: + Reads source files, analyzes them, generates Clojure forms from analysis results, and eval's those forms (which if there are bugs in tools.analyzer or tools.analyzer.jvm, may not be identical to the original forms read. If require'ing your source files launches the missiles, so will this. + Does create-ns on all namespaces specified, even if an exception during linting causes this function to return before reading all of them. See the code for why. + Should not print output to any output files/streams/etc., unless this occurs due to eval'ing the code being linted. Return value: + TBD
(effective-linters {:keys [linters exclude-linters add-linters
disable-linter-name-checks]}
linter-name->info
default-linters)
(effective-namespaces exclude-namespaces
namespaces
{:keys [source-paths test-paths]}
modified-since)
(expand-ns-keywords expanded-namespaces namespaces)
Expand any keyword in namespaces
with values from expanded-namespaces
Expand any keyword in `namespaces` with values from `expanded-namespaces`
(insp nssym)
Read, analyze, and eval a file specified by namespace as a symbol, e.g. 'testcases.f01. Return a value that has been 'cleaned up', by removing some keys from ASTs, so that it is more convenient to call clojure.inspector/inspect-tree on it. Example in REPL:
(require '[eastwood.lint :as l] '[clojure.inspector :as i]) (i/inspect-tree (l/insp 'testcases.f01))
Read, analyze, and eval a file specified by namespace as a symbol, e.g. 'testcases.f01. Return a value that has been 'cleaned up', by removing some keys from ASTs, so that it is more convenient to call clojure.inspector/inspect-tree on it. Example in REPL: (require '[eastwood.lint :as l] '[clojure.inspector :as i]) (i/inspect-tree (l/insp 'testcases.f01))
(lint opts)
(lint opts reporter)
Invoke Eastwood from REPL or other Clojure code, and return a map containing these keys:
:warnings - a sequence of maps representing individual warnings. The warning map contents are documented below.
:err - nil if there were no exceptions thrown or other errors that stopped linting before it completed. A keyword identifying a kind of error if there was. See the source file src/eastwood/lint.clj inside Eastwood for defmethod's of error-msg. Each is specialized on a keyword value that is one possible value the :err key can take. The body of each method shows how Eastwood shows to the user each kind of error when it is invoked from the command line via Leiningen, serves as a kind of documentation for what the value of the :err-data key contains.
:err-data - Some data describing the error if :err's value is not nil. See :err above for where to find out more about its contents.
:versions - A nested map with its own keys containing information about JVM, Clojure, and Eastwood versions.
Keys in a warning map:
:uri-or-file-name - string containing file name where warning occurs, relative to :cwd directory of options map, if it is a file inside of that directory, or a URI object, e.g. "cases/testcases/f02.clj"
:line - line number in file for warning, e.g. 20. The first line in the file is 1, not 0. Note: In some cases this key may not be present, or the value may be nil. This is an area where Eastwood will probably improve in the future, but best to handle it for now, perhaps by replacing it with line 1 as a placeholder.
:column - column number in file for warning, e.g. 42. The first character of each line is column 1, not 0. Same comments apply for :column as for :line.
:linter - keyword identifying the linter, e.g. :def-in-def
:msg - string describing the warning message, e.g. "There is a def of i-am-inner-defonce-sym nested inside def i-am-outer-defonce-sym"
:uri - object with class URI of the file, or a URI within a JAR file, e.g. #<URI file:/Users/jafinger/clj/eastwood/0.2.0/eastwood/cases/testcases/f02.clj>
:namespace-sym - symbol containing namespace, e.g. testcases.f02,
:file - string containing resource name, relative to some unspecified path in the Java classpath, e.g. "testcases/f02.clj"
Invoke Eastwood from REPL or other Clojure code, and return a map containing these keys: :warnings - a sequence of maps representing individual warnings. The warning map contents are documented below. :err - nil if there were no exceptions thrown or other errors that stopped linting before it completed. A keyword identifying a kind of error if there was. See the source file src/eastwood/lint.clj inside Eastwood for defmethod's of error-msg. Each is specialized on a keyword value that is one possible value the :err key can take. The body of each method shows how Eastwood shows to the user each kind of error when it is invoked from the command line via Leiningen, serves as a kind of documentation for what the value of the :err-data key contains. :err-data - Some data describing the error if :err's value is not nil. See :err above for where to find out more about its contents. :versions - A nested map with its own keys containing information about JVM, Clojure, and Eastwood versions. Keys in a warning map: :uri-or-file-name - string containing file name where warning occurs, relative to :cwd directory of options map, if it is a file inside of that directory, or a URI object, e.g. "cases/testcases/f02.clj" :line - line number in file for warning, e.g. 20. The first line in the file is 1, not 0. Note: In some cases this key may not be present, or the value may be nil. This is an area where Eastwood will probably improve in the future, but best to handle it for now, perhaps by replacing it with line 1 as a placeholder. :column - column number in file for warning, e.g. 42. The first character of each line is column 1, not 0. Same comments apply for :column as for :line. :linter - keyword identifying the linter, e.g. :def-in-def :msg - string describing the warning message, e.g. "There is a def of i-am-inner-defonce-sym nested inside def i-am-outer-defonce-sym" :uri - object with class URI of the file, *or* a URI within a JAR file, e.g. #<URI file:/Users/jafinger/clj/eastwood/0.2.0/eastwood/cases/testcases/f02.clj> :namespace-sym - symbol containing namespace, e.g. testcases.f02, :file - string containing resource name, relative to some unspecified path in the Java classpath, e.g. "testcases/f02.clj"
(make-report reporter start-time {:keys [warning-count error-count] :as result})
(setup-lint-paths source-paths test-paths)
Return a map containing :source-path
and :test-paths
which
contains the set of values in each. If both source-paths
and test-paths
are empty then :source-path
is set to all the directories on the classpath,
while :test-paths
is the empty set.
Return a map containing `:source-path` and `:test-paths` which contains the set of values in each. If both `source-paths` and `test-paths` are empty then `:source-path` is set to all the directories on the classpath, while `:test-paths` is the empty set.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close