-
Notifications
You must be signed in to change notification settings - Fork 112
Building the AST is not practical because it runs tests - how to prevent that? #426
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
Comments
The easiest way to solve this would be wrap your tests in a function, which your test-runner calls, instead of having There's code in place to ignore certain paths that's already been written on the middleware side of things. It would be easy to expose that to the client as a config setting, and we should probably do that. However, if you ignore your test directory, then renamings using cljr-rename-symbol won't be propagated to these namespaces because they haven't been analyzed! This could be a source of both breakage and confusion :( In other words, you'd unfortunately have to refactor a little even with a new config setting, e.g. to have a file with nothing except a require form and |
This makes it possible to easily exclude certain files and directories for analysis.
This makes it possible to easily exclude certain files and directories for analysis.
This makes it possible to easily exclude certain files and directories for analysis.
You should be able to apply this minimal patch manually, if you're so inclined, to see if it solves your problem @Andre0991: #427 |
This makes it possible to easily exclude certain files and directories for analysis.
The issue is that I use Midje, which runs the test when the test form is evaluated. I actually like this behaviour, it makes testing more interactive - but it does make evaluating the whole project impractical.
You're right, that would be confusing. I'm not sure if there's a good solution for this using Midje :( Thanks for the patch. I manually applied it, but I got the following error:
I set the variable as follows: (setq cljr-middleware-ignored-paths '("test\.*")) |
Thanks, think we're missing a coercion step in the middleware to turn these into regexes. |
The new snapshot is out @Andre0991. Let please me know if this is solved now. |
Thanks @expez .
Those are my attempts:
|
@Andre0991 change the |
@expez, for some reason it's always triggering the same error. How can I debug that? 🤔 It complains about My clj-refactor version is 20180826.2149. I basically set |
Looks like when this feature was implemented it was only meant to be used to ignore directories. Guess that could've been made a little clearer. Honestly we should fix that, so any arbitrary file can be excluded. Try again with |
Oh, that makes sense. Ignoring all paths with I'm suspecting nrepl is not actually considering it. Let me know if you need more information. |
cljr-find-usages
and friends have to create the AST for the whole project.This is not practical for my use case, as it would need to run all the tests, which might take a long time. Also, some tests actually break the AST creation with
Method code too large!
.Is there are way to configure
clj-refactor
so that it ignore certain namespaces when building the AST?The text was updated successfully, but these errors were encountered: