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

Feature Proposal: Grouped Import Sorting in Typstyle (Similar to Python’s isort) #212

Open
Tracked by #214
Enter-tainer opened this issue Dec 29, 2024 · 0 comments

Comments

@Enter-tainer
Copy link
Owner

generated by genai from unstructured chat logs

Issue Description

Currently, Typstyle does not have any functionality for sorting imports. This can lead to inconsistent and disorganized import statements in code, reducing readability and maintainability. This proposal suggests adding import sorting to Typstyle, similar to tools like Python’s isort, to automatically organize imports in a consistent and logical manner.

Proposed Feature

Implement an import sorting feature that:

  1. Sorts Imports Alphabetically: Orders import statements alphabetically.
  2. Groups Imports (Optional): Allows imports to be grouped logically (e.g., standard library, third-party, local modules) with empty lines separating groups.

Implementation Considerations

  1. Basic Sorting:
    • Sort all imports alphabetically by default.
    • Handle both import and from ... import statements.
  2. Grouping (Optional):
    • Detect and group imports by type (e.g., standard library, third-party, local modules).
    • Separate groups with empty lines.

cc @QuadnucYard

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

No branches or pull requests

1 participant