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

Improve import and structure output formatting? #24

Open
jessesquires opened this issue Jan 26, 2021 · 2 comments
Open

Improve import and structure output formatting? #24

jessesquires opened this issue Jan 26, 2021 · 2 comments
Labels
good first issue Good for newcomers

Comments

@jessesquires
Copy link

Hey @twostraws ! 👋🏼

Based on the screenshot here: https://twitter.com/twostraws/status/1354136797496881154/photo/1

I was wondering why imports are word-wrapped instead of formatted like everything else?

I think a format like this would be easier to read:

Imports
    UIKit: 8
    Foundation: 63
    AppKit: 17

Structure:
    UIKit View Controllers: 17
    UIKit Views: 23
    SwiftUI View: 0

(Also, separating "imports" into its own section seems helpful)

@twostraws
Copy link
Owner

Having discussed this with Jesse on Twitter we've come to the conclusion that perhaps breaking the imports up into separate lines would work well if we cap the number of imports by default to some sensible value and show the most frequent ones.

Whatever the cap is, it should be enough that it isn't always just the obvious candidates (UIKit, SwiftUI, Combine, Foundation, etc), but not so many that the list of imports overwhelms the rest of the report. Perhaps top 8?

We would then add a command-line flag to show all imports – perhaps -v for verbose mode, or similar. I would suggest that the JSON output always includes all imports.

I'm going to tag this as a good first issue; hopefully someone can investigate!

@twostraws twostraws added the good first issue Good for newcomers label Jan 26, 2021
@jessesquires
Copy link
Author

Whatever the cap is, it should be enough that it isn't always just the obvious candidates

Actually, now that you mention this, I think I would prefer ignoring UIKit, AppKit, and Foundation, at least for the "non-verbose mode". Then -v (or whatever) would include these common imports.

You literally can't build an app without those frameworks. 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants