Liking cljdoc? Tell your friends :D

eastwood.lint


*eastwood-version*clj

source

all-lintersclj

source

assert-cb-has-proper-keysclj

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

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

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

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"
sourceraw docstring

default-builtin-config-filesclj

source

default-lintersclj

source

eastwoodclj

(eastwood opts)
source

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

eastwood-from-cmdlineclj

(eastwood-from-cmdline opts)
source

eastwood-versionclj

(eastwood-version)
source

empty-ordered-lint-warning-map-v1clj

source

empty-ordered-lint-warning-map-v2clj

source

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.
sourceraw docstring

file-warn-infoclj

(file-warn-info f cwd-file)
source

filename-namespace-mismatchesclj

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

filename-to-nsclj

(filename-to-ns fname)
source

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))
sourceraw docstring

last-cwd-shownclj

source

last-options-map-adjustmentsclj

(last-options-map-adjustments opts)
source

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"
sourceraw docstring

lint-nsclj

(lint-ns ns-sym linters opts)
source

lint-ns*clj

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

lint-ns-noprintclj

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

linter-infoclj

source

linter-name->infoclj

source

linter-seq->setclj

(linter-seq->set linter-seq)
source

make-default-cbclj

(make-default-cb opts)
source

make-default-debug-ast-cbclj

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

make-default-dirs-scanned-cbclj

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

make-default-eval-msg-cbclj

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

make-default-form-cbclj

(make-default-form-cb wrtr)
source

make-default-lint-warning-cbclj

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

make-default-msg-cbclj

(make-default-msg-cb wrtr)
source

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]})
source

make-lint-warningclj

(make-lint-warning kw msg opts file)
source

namespace-infoclj

(namespace-info ns-sym cwd-file)
source

ns-to-filename-setclj

(ns-to-filename-set namespace extensions)
source

nss-in-dirsclj

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

opts->lintersclj

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

opts->namespacesclj

(opts->namespaces opts warning-count)
source

replace-linter-keywordsclj

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

replace-ns-keywordsclj

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

replace-path-in-compiler-errorclj

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

report-warningsclj

(report-warnings cb warning-count warnings)
source

to-uriclj

(to-uri x)
source

unknown-ns-keywordsclj

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

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

× close