Giter VIP home page Giter VIP logo

Comments (9)

borkdude avatar borkdude commented on September 26, 2024 1

Can reproduce, thanks.

from carve.

borkdude avatar borkdude commented on September 26, 2024

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.

borkdude avatar borkdude commented on September 26, 2024

A repro with a test repo is welcome so I can take a look.

from carve.

filipesilva avatar filipesilva commented on September 26, 2024

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.

borkdude avatar borkdude commented on September 26, 2024

@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.

filipesilva avatar filipesilva commented on September 26, 2024

@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.

borkdude avatar borkdude commented on September 26, 2024

from carve.

borkdude avatar borkdude commented on September 26, 2024

@filipesilva Please test again with newest commit. The issue was that cljs.core/defrecord wasn't correctly ignored.

from carve.

filipesilva avatar filipesilva commented on September 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.