https://github.com/exercism/clojure-analyzer
https://github.com/exercism/clojure-analyzer
community-contributions-paused exercism-analyzer exercism-tooling maintained
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/exercism/clojure-analyzer
- Owner: exercism
- License: agpl-3.0
- Created: 2020-03-31T10:51:28.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-01T23:27:44.000Z (10 months ago)
- Last Synced: 2025-04-29T05:29:06.124Z (8 months ago)
- Topics: community-contributions-paused, exercism-analyzer, exercism-tooling, maintained
- Language: Clojure
- Size: 979 KB
- Stars: 2
- Watchers: 12
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Exercism Clojure analyzer
Exercism's Automated Analysis a long-term endeavour to provide rapid feedback to students through the use of automated code analysis. The Clojure analyzer is based on [clj-kondo](https://github.com/clj-kondo/clj-kondo), [rewrite-clj](https://github.com/clj-commons/rewrite-clj) and [clojure/tools.analyzer](https://github.com/clojure/tools.analyzer).
## Usage
To run the analyzer, pass it an exercise ``, an input solution file and an output directory for the AST:
$ clojure -m exercism.clojure-analyzer two-fer resources/example.clj resources/output/
Analyzing: two-fer
Saved to: resources/output/analysis.json
To generate a JSON static analysis report for a solution file using [clj-kondo](https://github.com/clj-kondo/clj-kondo):
``` bash
$ clj-kondo --lint resources/example.clj --config '{:output {:analysis true :format :json}}'
{"findings":[],"summary":{"error":0,"warning":0,"info":0,"type":"summary","duration":53},"analysis":{"namespace-definitions":[{"filename":"resources/example.clj","row":1,"col":1,"name":"two-fer"}],"namespace-usages":[],"var-definitions":[{"filename":"resources/example.clj","row":3,"col":1,"ns":"two-fer","name":"two-fer","fixed-arities":[0,1]}],"var-usages":[{"fixed-arities":[0,1],"name":"str","filename":"resources/example.clj","from":"two-fer","col":8,"from-var":"two-fer","arity":1,"varargs-min-arity":1,"row":4,"to":"clojure.core"},{"fixed-arities":[0,1],"name":"str","filename":"resources/example.clj","from":"two-fer","col":12,"from-var":"two-fer","arity":3,"varargs-min-arity":1,"row":5,"to":"clojure.core"},{"name":"defn","filename":"resources/example.clj","from":"two-fer","macro":true,"col":2,"arity":3,"varargs-min-arity":2,"row":3,"to":"clojure.core"}]}}
```
Run the project's tests:
$ clojure -A:test:runner
Build an uberjar:
$ clojure -A:uberjar
Run that uberjar:
$ java -jar clojure-analyzer.jar
## Documentation
The specification of the analyzer interface is found in the [track-tooling](https://github.com/exercism/v3-docs/tree/master/anatomy/track-tooling) section of the v3-docs repo.
## Copyright
All content in this repository is Copyright to Exercism and licensed under AGPL.