aiba / lein-count Goto Github PK
View Code? Open in Web Editor NEWCount Lines of Clojure Code
License: Eclipse Public License 1.0
Count Lines of Clojure Code
License: Eclipse Public License 1.0
When running on Windows lein count
fails with an "illegal/unsupported escape sequence" which seems to be caused by using an unescaped path as part of a regular expression.
The stack trace is:
java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence near index 4
^C:\Users\username\path\to\project/
^
at java.util.regex.Pattern.error (Pattern.java:1955)
java.util.regex.Pattern.escape (Pattern.java:2471)
java.util.regex.Pattern.atom (Pattern.java:2198)
java.util.regex.Pattern.sequence (Pattern.java:2130)
java.util.regex.Pattern.expr (Pattern.java:1996)
java.util.regex.Pattern.compile (Pattern.java:1696)
java.util.regex.Pattern.<init> (Pattern.java:1351)
java.util.regex.Pattern.compile (Pattern.java:1028)
clojure.core$re_pattern.invokeStatic (core.clj:4665)
clojure.core$re_pattern.invoke (core.clj:4657)
aiba.lein_count.core$relative_path_str.invokeStatic (core.clj:26)
aiba.lein_count.core$relative_path_str.invoke (core.clj:20)
leiningen.count$count$fn__1671.invoke (count.clj:66)
Just tried in different projects I have cloned locally and stumbled a problem when checking my local copy of the sente library:
$ lein count
File or directory not found: test
Pretty sure this is not intended.
clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: No such var: lcp/resolve-managed-dependencies, compiling:(leiningen/count.clj:38:18)
Leiningen 2.6.1 on Java 1.8.0_122 OpenJDK 64-Bit Server VM
In any project, it occured.
Hello,
I was exited about the number in my project but alas, this error was thrown.
clojure.lang.Compiler$CompilerException: java.lang.IllegalStateException: read-regex already refers to: #'clojure.tools.reader.impl.commons/read-regex in namespace: aiba.lein-count.constant-wrapping-reader, compiling:(aiba/lein_count/constant_wrapping_reader.clj:134:1)
at clojure.lang.Compiler.analyzeSeq (Compiler.java:6730)
clojure.lang.Compiler.analyze (Compiler.java:6524)
clojure.lang.Compiler.analyze (Compiler.java:6485)
clojure.lang.Compiler.eval (Compiler.java:6786)
clojure.lang.Compiler.load (Compiler.java:7227)
clojure.lang.RT.loadResourceScript (RT.java:371)
clojure.lang.RT.loadResourceScript (RT.java:362)
clojure.lang.RT.load (RT.java:446)
clojure.lang.RT.load (RT.java:412)
clojure.core$load$fn__5448.invoke (core.clj:5866)
clojure.core$load.doInvoke (core.clj:5865)
clojure.lang.RestFn.invoke (RestFn.java:408)
clojure.core$load_one.invoke (core.clj:5671)
clojure.core$load_lib$fn__5397.invoke (core.clj:5711)
clojure.core$load_lib.doInvoke (core.clj:5710)
clojure.lang.RestFn.applyTo (RestFn.java:142)
clojure.core$apply.invoke (core.clj:632)
clojure.core$load_libs.doInvoke (core.clj:5749)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invoke (core.clj:632)
clojure.core$require.doInvoke (core.clj:5832)
clojure.lang.RestFn.invoke (RestFn.java:551)
aiba.lein_count.core$eval607$loading__5340__auto____608.invoke (core.clj:1)
aiba.lein_count.core$eval607.invoke (core.clj:1)
lein version 2.6.2
'''
Retrieving lein-count/lein-count/1.0.7/lein-count-1.0.7.jar from clojars
clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: No such var: lcp/resolve
-managed-dependencies, compiling:(leiningen/count.clj:38:18)
'''
lein upgrade 2.7.1 ok :)
I have the following file:
(ns foo.bar
(:require [cljs.spec :as s]))
When running lein count :by-file some-folder/
I get the following output (only showing the relevant line):
| cljs | src/foo/bar.cljs | 2 | 45 |
The line count is correct, but the node count is way to high. I guess this is true after macro expansion, but shouldn't the node count be pre-expansion?
I tried lein-count with this project and was surprised at the 4k line count!
Turns out most files where counted 4 times for some reason.
Hi Aaron,
This plugin sound like it would be useful at times. I tried using it, however, and ran into this:
clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to resolve symbol: second' in this context, compiling:(aiba/lein_count/constant_wrapping_reader.clj:772:19)
Same error in different projects when running lein count
. Maybe you can have a look what could be the issue.
Cheers,
Matthias
I got this problem when attempting to run the plugin.
clojure.lang.Compiler$CompilerException: java.lang.IllegalStateException: read-regex already refers to: #'clojure.tools.reader.impl.commons/read-regex in namespace: aiba.lein-count.constant-wrapping-reader, compiling:(aiba/lein_count/constant_wrapping_reader.clj:134:1)
Looks like a dependency issue that could be solved by not using :refer :all. Not sure why I've hit this problem when others haven't.
... and find the latest version avaible, just like lein-ancient.
;; explicit version
lein count :artifact metosin/spec-tools 0.2.0
;; without version finds the latest version (0.2.0)
lein count :artifact metosin/spec-tools
nice lib!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.