Comments (9)
Can reproduce, thanks.
from carve.
Hmm, when I run locally I get:
$ clojure -M -m carve.main --opts '{:paths ["src" "test"] :report {:format :text}}'
Cloning: https://github.com/borkdude/clj-kondo
Checking out: https://github.com/borkdude/clj-kondo at 0d31f63e40f220dff88670335ad639d39647314c
src/carve/api.clj:5:1 carve.api/print!
src/carve/api.clj:9:1 carve.api/run!
src/carve/api.clj:17:1 carve.api/report
from carve.
A repro with a test repo is welcome so I can take a look.
from carve.
I can give you the exact setup where I see this situation:
git clone [email protected]:filipesilva/athens.git
cd athens
git checkout lein-to-clj
clojure -M:carve --opts '{:paths ["src" "test"] :report {:format :text}}'
from carve.
@filipesilva I pushed a new commit. This discrepancy should now be solved, although the report is missing some data. I'm going to try to fix that later.
from carve.
@borkdude using the new I can see report flagging the unused vars, but I can also see it flagging a defrecord incorrectly:
git clone [email protected]:athensresearch/athens.git
cd athens
git checkout feature/rtc-v1
# update deps edn to use new carve SHA
yarn carve
yarn run v1.22.10
$ clojure -M:carve --opts '{:paths ["src" "test"] :report {:format :text}}'
src/cljs/athens/self_hosted/client.cljs:414:1 athens.self-hosted.client/->WSClient
src/cljs/athens/self_hosted/client.cljs:414:1 athens.self-hosted.client/WSClient
test/athens/db_test.cljs:4:29 cljs.pprint/
test/athens/parser/impl_test.clj:4:44 clojure.test/
src/cljs/athens/self_hosted/client.cljs:414
to 441
looks like this:
(defrecord WSClient
[url]
component/Lifecycle
(start
[component]
(log/info "WSClient starting with url:" url)
(let [connection (connect-to-self-hosted! url)]
(log/debug "WSClient connection started...")
(reset! ws-connection connection)
component))
(stop
[component]
(log/info "WSClient stopping for url:" url)
(when-let [connection @ws-connection]
(close-reconnect-timer!)
(remove-listeners! connection)
(.close connection)
(log/info "WSClient closed connection")
(reset! ws-connection nil)
(rf/dispatch [:conn-status :disconnected])
component)))
(defn new-ws-client
[url]
(map->WSClient {:url url}))
The defrecord is followed by the map->WSClient
usage so I think it shouldn't be marked as unused. It also wasn't marked as unused with the previous version, so I think something unexpected changed. Maybe a regression of the fix for #1?
from carve.
from carve.
@filipesilva Please test again with newest commit. The issue was that cljs.core/defrecord wasn't correctly ignored.
from carve.
I can confirm that report now works the same as interactive, and that defrecords are not reported. Thanks for all the work @borkdude !
from carve.
Related Issues (20)
- False positive with `:implements` HOT 3
- Binary releases? HOT 3
- Options from config file? HOT 3
- Automate the carving process? HOT 7
- Cleanup unused imports? HOT 2
- Export to .carve/ignore
- Confusing options merging HOT 2
- Preserve existing trailing newline when carving from the end of a file HOT 8
- requires with empty :refer aren't discarded
- clj-kondo/config not working? HOT 2
- Accept lowercase "y" to remove dead code HOT 2
- Output file info when exception is thrown.
- Clojure API HOT 3
- Regression with medley carve HOT 2
- Upgrade build to bullseye
- unused referred vars in report are missing name HOT 1
- Report unused dependencies HOT 2
- error while trying to read hook -- Could not find namespace: clojure.pprint. HOT 4
- Carving empty namespaces HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carve.