Broken tracker after mis-named namespace

Description

A tools.namespace dependency tracker can get into an inconsistent state after attempting to load a file with a namespace declaration that does not match the file's name.

Steps to reproduce:

In a new Clojure project, create a file foo.clj on the classpath containing the namespace declaration (ns wrong-ns-declaration-for-foo)

Then at the REPL:

Edit the file foo.clj so that its namespace declaration is correct: (ns foo)

But at the REPL, refresh still doesn't work:

Since tools.namespace 0.2.5, the workaround is to call clear:

Environment

None

Activity

Show:
Andy Fingerhut
September 12, 2014, 12:38 AM

Such files introduce problems for all kinds of tools, not just tools.namespace. I don't know all of the consequences, but two are listed here: https://github.com/jonase/eastwood#check-consistency-of-namespace-and-file-names

I have added warnings in Eastwood whenever it finds files like this, and doesn't do any linting checks on any files until such things are corrected.

Assignee

Stuart Sierra

Reporter

Stuart Sierra

Labels

None

Approval

None

Patch

None

Priority

Minor
Configure