(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"
(eastwood-core opts)
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
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.
(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)
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"
(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]})
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close