Skip to content

Make slamhound work for GET #7

Closed
wants to merge 2 commits into from

2 participants

@amalloy
amalloy commented May 1, 2011

Make failure-type return a list of possible fixes, so that regrow can try them all before failing, rather than having failure-details throw an exception if a fix doesn't work.

amalloy added some commits May 1, 2011
@amalloy amalloy Make failure-type return a list of possible fixes, so that regrow can…
… try them all before failing, rather than having failure-details throw an exception if a fix doesn't work
0e9a7ea
@amalloy amalloy Group :use declarations better a368b04
@amalloy
amalloy commented May 2, 2011

Added improved grouping for :use statements while I was waiting for you to pull. See https://gist.github.com/951227 for an example in action.

@technomancy
Owner

The first commit looks good. It might be nice to split the double if-let out into its own function though. I'm not too sold on the second; I do prefer the full namespace to be visible on each :use line for greppability purposes.

@amalloy
amalloy commented May 3, 2011

I don't think I've ever wanted to grep for a namespace declaration. I guess the "reduced size of ns form" doesn't matter as much when (a) each ns has an :only clause (so you can't just slam a bunch of namespaces on each line), and (b) slamhound writes the whole thing for you. But it seems to me that it's more readable, and more user-friendly if not everyone on a project uses slamhound. Say I fix all the (currently pretty awful) 4clojure namespace declarations with slamhound. The next guy to add a new file has three choices:

  • Figure out how to use slamhound to write his namespace for him
  • Manually write a namespace form that looks different from the rest of the project because it uses those human-friendly (parent.ns [child1...]) forms
  • Write all those tediously verbose fully-qualified namespaces himself to conform with the rest of the project

I don't like any of those choices; do you recommend something better?

@technomancy
Owner

Write all those tediously verbose fully-qualified namespaces himself to conform with the rest of the project

It's really not tedious when you have completion available. Even naieve "whatever else is in this file" completion is helpful for something like that.

It's likely that a future ns overhaul will remove the prefix support according to the first comment on http://dev.clojure.org/jira/browse/CLJ-272 for the same reasons, so I would rather go with that.

@technomancy technomancy closed this May 7, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.