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

Nested requires which bring in aliases used with keywords cause issues #202

Closed
jeaye opened this issue Sep 26, 2017 · 17 comments
Closed

Nested requires which bring in aliases used with keywords cause issues #202

jeaye opened this issue Sep 26, 2017 · 17 comments
Labels

Comments

@jeaye
Copy link

jeaye commented Sep 26, 2017

I've read through #14 and I see that a PR was merged for it here: #198 From what I see, this isn't in the latest stable release, so I've been working on the latest beta [lein-kibit "0.1.6-beta2"]. Here is the most minimal reproduction case:

┌─(✓)[jeaye@oryx]─[~/projects/tmp][22:11:46]
└──╼ lein new app kibit-test
Generating a project called kibit-test based on the 'app' template.
┌─(✓)[jeaye@oryx]─[~/projects/tmp][22:11:55]
└──╼ cd kibit-test/
┌─(✓)[jeaye@oryx]─[~/projects/tmp/kibit-test][22:11:57]
└──╼ vim src/kibit_test/core.clj 
┌─(✓)[jeaye@oryx]─[~/projects/tmp/kibit-test][22:12:32]
└──╼ cat src/kibit_test/core.clj 
(ns kibit-test.core
  (:gen-class)
  (:require [clojure
             [string :as string]]))

(defn -main
  [& args]
  (println ::string/uh-oh))
┌─(✓)[jeaye@oryx]─[~/projects/tmp/kibit-test][22:12:37]
└──╼ lein run
:clojure.string/uh-oh
┌─(✓)[jeaye@oryx]─[~/projects/tmp/kibit-test][22:12:48]
└──╼ lein kibit
Check failed -- skipping rest of file
[line 8, col 26] Invalid keyword: ::string/uh-oh.
@danielcompton
Copy link
Member

Thanks for reporting this, I think the reader probably needs to be extended to understand nested requires.

@arrdem
Copy link
Collaborator

arrdem commented Sep 26, 2017

Argh we wrote our own require parser at some point didn't we

@danielcompton
Copy link
Member

@jeaye
Copy link
Author

jeaye commented Jan 6, 2018

Happy new year! Any update on the priority of this one?

@arrdem
Copy link
Collaborator

arrdem commented Jan 7, 2018

Still no priority on this, but it happens that I wrote a ns parser for another project recently so we should be able to get a fix for this out whenever I can find an hour to get that code shuffled around and packaged for use here.

@jeaye
Copy link
Author

jeaye commented Jan 7, 2018

Good to know. Thanks for the update.

@tomjkidd
Copy link
Contributor

tomjkidd commented Apr 8, 2019

Another Happy New Year! Will 2019 see some love for this?

@arrdem
Copy link
Collaborator

arrdem commented Apr 8, 2019

Probably not. You gonna send us a patch @tomjkidd?

@tomjkidd
Copy link
Contributor

tomjkidd commented Apr 9, 2019

I'm willing to look if it isn't duplicating the work of others!

@tomjkidd
Copy link
Contributor

tomjkidd commented Apr 9, 2019

Took a stab at it, please refer to #226

@arrdem
Copy link
Collaborator

arrdem commented Apr 9, 2019

@tomjkidd Thanks for the PR! On a quick pass it looks good, I'll try to give it more time later today.

@tomjkidd
Copy link
Contributor

@arrdem I imagine y'all are pretty busy, so is there any way to help this along?

@arrdem
Copy link
Collaborator

arrdem commented Apr 23, 2019

@tomjkidd Thanks for the reminder, I read through this ~two weeks ago and it looked mostly good but I have some concerns about the vagaries of the require incantation I need to poke at. Will look now.

@arrdem
Copy link
Collaborator

arrdem commented Apr 23, 2019

kibit.test.check-reader> (reader/read-file (clojure.lang.LineNumberingPushbackReader. (java.io.StringReader. "(ns user (:require clojure.string)) ::clojure.string/foo")) 'user)
((ns user (:require clojure.string)) :clojure.string/foo)
kibit.test.check-reader> (reader/read-file (clojure.lang.LineNumberingPushbackReader. (java.io.StringReader. "(ns user (:require clojure.string)) ::clojure.string/foo")) 'user)
((ns user (:require clojure.string)) :clojure.string/foo)
kibit.test.check-reader> 

Okay. This was the behavior I was concerned could mess up - looks good!

arrdem added a commit that referenced this issue Apr 23, 2019
Implement a solution for Issue #202
@arrdem
Copy link
Collaborator

arrdem commented Apr 23, 2019

I think we can close this out if/when @danielcompton can be persuaded to cut a release.

@tomjkidd
Copy link
Contributor

@arrdem Thanks for taking a look!

@danielcompton
Copy link
Member

Fixed with the release of 0.1.7: https://github.com/jonase/kibit/releases/tag/0.1.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants