Skip to content

Commit

Permalink
Merge pull request #3 from 40ants/fix-unused-import-when-symbol-is-ba…
Browse files Browse the repository at this point in the history
…ckquoted

Fixed issue when package was mentioned as unused whereas it was used inside a backquoted part of the macro.
  • Loading branch information
svetlyak40wt authored Dec 1, 2023
2 parents 34fe637 + 8873a9e commit d71111a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ docs/build/
.#*
.*.~undo-tree~
.DS_Store
*.fasl
2 changes: 2 additions & 0 deletions docs/changelog.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"ASDF"
"REPL"
"HTTP"))
(0.3.0 2023-12-01
"* Fixed issue when package was mentioned as unused whereas it was used inside a backquoted part of the macro.")
(0.2.0 2023-11-19
"* Now imports linter can warn on packages mentioned in defpackage but missing.")
(0.1.0 2021-04-06
Expand Down
6 changes: 6 additions & 0 deletions src/imports.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@
(form-symbols (cdr form))))
(symbol
(list form))
#+sbcl
(sb-impl::comma
(alexandria:mappend
#'form-symbols
(uiop:ensure-list
(slot-value form 'sb-impl::expr))))
(t
nil)))

Expand Down
9 changes: 6 additions & 3 deletions t/core.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
(:import-from #:rove
#:deftest
#:ok
#:testing))
#:testing)
(:import-from #:40ants-linter/imports
#:used-symbols))
(in-package #:40ants-linter-tests/core)


(deftest test-example ()
(ok t "Replace this test with something useful."))
(deftest test-symbol-forms-extractor ()
(let ((symbols (used-symbols '`,bar)))
(ok (member 'bar symbols))))

0 comments on commit d71111a

Please sign in to comment.