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

Merge refer and as on equal namespaces #105

Open
tcoenraad opened this issue Jan 16, 2020 · 1 comment
Open

Merge refer and as on equal namespaces #105

tcoenraad opened this issue Jan 16, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@tcoenraad
Copy link
Contributor

tcoenraad commented Jan 16, 2020

Brief

Seperate requires with refer and as are not merged into each other. This was found in https://github.com/nedap/pep-link/pull/619/files#diff-2f1e1e5fb241876ee8df4f29f8f896f3R35-R36

Expected behavior

   [medley.core :refer [deep-merge]]
   [medley.core :as medley]

is formatted into

   [medley.core :refer [deep-merge] :as medley]

Actual behavior

It is left untouched as:

   [medley.core :refer [deep-merge]]
   [medley.core :as medley]

Reproduction steps

  • Put the first expected snippet in a file
  • Run formatting-stack on it

Suspected cause

A missed case of all variations of requires.

@vemv
Copy link
Contributor

vemv commented Jan 17, 2020

Good one, yes I was aware of this. clean-ns (from refactor-nrepl) generally consolidates these, but f-s occasionally disables clean-ns for certain ns'es.

Compensating for that, there's https://github.com/nedap/formatting-stack/blob/2e5db0d71f9f0abceca88530cf650d0827a48b75/src/formatting_stack/formatters/trivial_ns_duplicates.clj but it lacks 'consolidation' logic. Could be done.

@vemv vemv added the enhancement New feature or request label Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants