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

Kibit blows up on qualified keywords when require has a :refer #238

Closed
splayemu opened this issue Apr 29, 2020 · 1 comment · Fixed by #260
Closed

Kibit blows up on qualified keywords when require has a :refer #238

splayemu opened this issue Apr 29, 2020 · 1 comment · Fixed by #260

Comments

@splayemu
Copy link

Overview

Running kibit blows up on qualified keywords when the :refer statement comes before the :as statement in the require.

$ lein kibit
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
Retrieving lein-kibit/lein-kibit/0.1.8/lein-kibit-0.1.8.pom from clojars
Retrieving org/clojure/clojure/1.4.0/clojure-1.4.0.pom from central
Retrieving org/clojure/clojure/1.8.0/clojure-1.8.0.pom from central
Retrieving org/clojure/clojure/1.6.0/clojure-1.6.0.pom from central
Retrieving org/clojure/clojure/1.5.1/clojure-1.5.1.pom from central
Retrieving org/clojure/clojure/1.4.0/clojure-1.4.0.jar from central
Retrieving lein-kibit/lein-kibit/0.1.8/lein-kibit-0.1.8.jar from clojars
Retrieving org/clojure/clojure/1.8.0/clojure-1.8.0.jar from central
Check failed -- skipping rest of file (src/repro/core.clj:4:null)
[line 4, col 10] Invalid keyword: ::s/derp.

Steps to reproduce:

  1. Create a clj project:
lein new repro
  1. Add kibit to leiningen plugins
(defproject repro "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
            :url "https://www.eclipse.org/legal/epl-2.0/"}
  :dependencies [[org.clojure/clojure "1.10.1"]]
  :plugins [[lein-kibit "0.1.8"]]
  :repl-options {:init-ns repro.core})
  1. Update src/repro/core.clj to be:
(ns repro.core
  (:require [clojure.string :refer [join] :as s]))

(::s/derp {})
  1. run kibit
lein kibit

Context

Clojure: 1.10.1
kibit version: 0.1.8

Note: didn't happen in kibit version: 0.1.6

@iku000888
Copy link

Looks like this line does not register the namespace alias if the position of :refer and :as are different.
https://github.com/jonase/kibit/blob/ed2f8e57d28e77037f806a8ffa8da53efb308245/kibit/src/kibit/check/reader.clj#L64

NoahTheDuke added a commit to NoahTheDuke/kibit that referenced this issue May 14, 2024
NoahTheDuke added a commit to NoahTheDuke/kibit that referenced this issue May 15, 2024
NoahTheDuke added a commit to NoahTheDuke/kibit that referenced this issue May 15, 2024
NoahTheDuke added a commit to NoahTheDuke/kibit that referenced this issue May 15, 2024
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

Successfully merging a pull request may close this issue.

2 participants