Code Monkey home page Code Monkey logo

Comments (8)

weavejester avatar weavejester commented on July 16, 2024

It looks as if you don't have any valid source or test pages in your project. So this code:

(->> (concat (:source-paths project)
             (:test-paths project))
     (map io/file)
     (filter #(and (.exists %) (.isDirectory %))))

Is returning an empty seq. I can add in a better error message, but cljfmt is still going to throw an error message if it can't find any source or test paths.

What does your project.clj file look like?

from cljfmt.

gofeddy avatar gofeddy commented on July 16, 2024

I think I figured out the problem. My project has multiple modules inside of it. I had my :source-paths and :test-paths listed under the nested {:modules {:inherited ..}} section of my parent project.clj file.

So when I ran lein cljfmt check from these individual modules(each having their own project.clj with :source-paths and :test-paths), it worked as expected.

I think this issue can be closed. But I agree, a more useful error message would be helpful here as you mentioned.

from cljfmt.

weavejester avatar weavejester commented on July 16, 2024

I'll keep the issue open until I put in a better error message. Missing source paths shouldn't result in a stack overflow :)

from cljfmt.

AsaAyers avatar AsaAyers commented on July 16, 2024

cljfmt is still going to throw an error message if it can't find any source or test paths.

Why can't it just default to CWD?

from cljfmt.

AsaAyers avatar AsaAyers commented on July 16, 2024

When I have trouble I typically go to the project's configuration to see how it's done. Neither project.clj in this repository seem to have :source-paths, so how exactly are they supposed to be configured? Do you not run your own project against your own code?

from cljfmt.

weavejester avatar weavejester commented on July 16, 2024

Why can't it just default to CWD?

If the project configuration is broken, then the best option is to raise an error, not try to work around it.

from cljfmt.

weavejester avatar weavejester commented on July 16, 2024

When I have trouble I typically go to the project's configuration to see how it's done. Neither project.clj in this repository seem to have :source-paths, so how exactly are they supposed to be configured? Do you not run your own project against your own code?

Leiningen has a default :source-paths of ["src"].

from cljfmt.

AsaAyers avatar AsaAyers commented on July 16, 2024

Thanks. I have moved my code into src.

I'm a few chapters into Clojure Programming and needed to jump into building something, anything, so I just started a folder and began solving problems on https://projecteuler.net/. Thanks for the help :)

from cljfmt.

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.