Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to sort requires in .cljc? #205

Open
borkdude opened this issue Feb 10, 2020 · 1 comment
Open

How to sort requires in .cljc? #205

borkdude opened this issue Feb 10, 2020 · 1 comment

Comments

@borkdude
Copy link
Sponsor

borkdude commented Feb 10, 2020

This commit adds a section about sorting namespaces. Clj-kondo want to check this, but currently there is no clarity around how "requirements" (which I find a bit of a weird word for libspecs in a require clause) in .cljc namespaces should be sorted.

Since there is no clarity around this, I'm thinking about just disabling the rule for clj-kondo in .cljc files for now.

See clj-kondo/clj-kondo#741.

cc @Heliosmaster

@Heliosmaster
Copy link
Contributor

@borkdude re about the wording "requirements". Feel free to improve it! Note that it also refer to the java classes in import statement though.. (requirements is still wrong, as they are imported classes)

About .cljc, I think the cleanest is to just sort the :clj, :cljr (🤷‍♂ ), :cljs and then the libspecs without a reader conditional. Within each block they should be sorted, independently (i.e. if in the same block we have both :clj and :cljs they should be sorted independently.

But is this consistent with the general usage of the reader conditional in ns declaration? Does it make sense?

@borkdude borkdude changed the title How to sort "requirements" in .cljc? How to sort requires in .cljc? May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants