Liking cljdoc? Tell your friends :D

eastwood.lint


*eastwood-version*clj


all-lintersclj


assert-cb-has-proper-keysclj

(assert-cb-has-proper-keys info)

assert-debug-form-cb-has-proper-keysclj

(assert-debug-form-cb-has-proper-keys info)

canonical-filenameclj

(canonical-filename fname)

Returns the canonical file name for the given file name. A canonical file name is platform dependent, but is both absolute and unique. See the Java docs for getCanonicalPath for some more details, and the examples below.

http://docs.oracle.com/javase/7/docs/api/java/io/File.html#getCanonicalPath%28%29

Examples:

Context: A Linux or Mac OS X system, where the current working directory is /Users/jafinger/clj/dolly

user=> (canonical-filename "README.md") "/Users/jafinger/clj/dolly/README.md"

user=> (canonical-filename "../../Documents/") "/Users/jafinger/Documents"

user=> (canonical-filename "../.././clj/../Documents/././") "/Users/jafinger/Documents"

Context: A Windows 7 system, where the current working directory is C:\Users\jafinger\clj\dolly

user=> (canonical-filename "README.md") "C:\Users\jafinger\clj\dolly\README.md"

user=> (canonical-filename "....\Documents") "C:\Users\jafinger\Documents"

user=> (canonical-filename ".....\clj..\Documents..") "C:\Users\jafinger\Documents"

Returns the canonical file name for the given file name.  A
canonical file name is platform dependent, but is both absolute and
unique.  See the Java docs for getCanonicalPath for some more details,
and the examples below.

    http://docs.oracle.com/javase/7/docs/api/java/io/File.html#getCanonicalPath%28%29

Examples:

Context: A Linux or Mac OS X system, where the current working
directory is /Users/jafinger/clj/dolly

user=> (canonical-filename "README.md")
"/Users/jafinger/clj/dolly/README.md"

user=> (canonical-filename "../../Documents/")
"/Users/jafinger/Documents"

user=> (canonical-filename "../.././clj/../Documents/././")
"/Users/jafinger/Documents"

Context: A Windows 7 system, where the current working directory is
C:\Users\jafinger\clj\dolly

user=> (canonical-filename "README.md")
"C:\Users\jafinger\clj\dolly\README.md"

user=> (canonical-filename "..\..\Documents\")
"C:\Users\jafinger\Documents"

user=> (canonical-filename "..\..\.\clj\..\Documents\.\.\")
"C:\Users\jafinger\Documents"
raw docstring

default-builtin-config-filesclj


default-lintersclj


eastwoodclj

(eastwood opts)

eastwood-coreclj

(eastwood-core opts)

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
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
raw docstring

eastwood-from-cmdlineclj

(eastwood-from-cmdline opts)

eastwood-versionclj

(eastwood-version)

empty-ordered-lint-warning-map-v1clj


empty-ordered-lint-warning-map-v2clj


error-msgcljmultimethod

Given a map describing an Eastwood error result, which should always have at least the keys :err and :err-data, return a string describing the error.

Given a map describing an Eastwood error result, which should
always have at least the keys :err and :err-data, return a string
describing the error.
raw docstring

file-warn-infoclj

(file-warn-info f cwd-file)

filename-namespace-mismatchesclj

(filename-namespace-mismatches dir-name-strs)

filename-to-nsclj

(filename-to-ns fname)

inspclj

(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))
raw docstring

last-cwd-shownclj


last-options-map-adjustmentsclj

(last-options-map-adjustments opts)

lintclj

(lint opts)

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. nil

: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.  nil

  :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"
raw docstring

lint-nsclj

(lint-ns ns-sym linters opts)

lint-ns*clj

(lint-ns* ns-sym analyze-results opts linter)

lint-ns-noprintclj

(lint-ns-noprint ns-sym linters opts)

linter-infoclj


linter-name->infoclj


linter-seq->setclj

(linter-seq->set linter-seq)

make-default-cbclj

(make-default-cb opts)

make-default-debug-ast-cbclj

(make-default-debug-ast-cb wrtr)

make-default-dirs-scanned-cbclj

(make-default-dirs-scanned-cb wrtr)

make-default-eval-msg-cbclj

(make-default-eval-msg-cb wrtr)
(make-default-eval-msg-cb wrtr opt)

make-default-form-cbclj

(make-default-form-cb wrtr)

make-default-lint-warning-cbclj

(make-default-lint-warning-cb wrtr)

make-default-msg-cbclj

(make-default-msg-cb wrtr)

make-eastwood-cbclj

(make-eastwood-cb {:keys [error dirs-scanned lint-warning note eval-out eval-err
                          debug debug-ast debug-form-read debug-form-analyzed
                          debug-form-emitted]})

make-lint-warningclj

(make-lint-warning kw msg opts file)

namespace-infoclj

(namespace-info ns-sym cwd-file)

ns-to-filename-setclj

(ns-to-filename-set namespace extensions)

nss-in-dirsclj

(nss-in-dirs dir-name-strs opt warning-count)

opts->lintersclj

(opts->linters opts linter-name->info default-linters)

opts->namespacesclj

(opts->namespaces opts warning-count)

replace-linter-keywordsclj

(replace-linter-keywords linters all-linters default-linters)

replace-ns-keywordsclj

(replace-ns-keywords namespaces source-paths test-paths)

replace-path-in-compiler-errorclj

(replace-path-in-compiler-error msg opt)

report-warningsclj

(report-warnings cb warning-count warnings)

to-uriclj

(to-uri x)

unknown-ns-keywordsclj

(unknown-ns-keywords namespaces known-ns-keywords desc)

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close