Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Sorting of interfaces, events, and structs #4

Open
iamdefinitelyahuman opened this issue Nov 2, 2020 · 1 comment
Open

Sorting of interfaces, events, and structs #4

iamdefinitelyahuman opened this issue Nov 2, 2020 · 1 comment

Comments

@iamdefinitelyahuman
Copy link

blackadder should order imports, interfaces, events, and structs so that they are logically grouped together.

  1. absolute import statements
    • one blank line between the top-level natspec and the first absolute import
    • zero blank lines between each statement
  2. relative imports
    • one blank line between the last absolute import and the first relative import
    • zero blank lines between each statement
  3. implements
    • one blank line between the last relative import and the first implements
    • zero blank lines between each statement
  4. interfaces
    • two blank lines between the first interface and the last line of the previous statement
    • one blank line between each interface
  5. events
    • two blank lines between the first event and the last line of the previous statement
    • one blank line between each event
  6. structs
    • two blank lines between the first struct and the last line of the previous statement
    • one blank line between each struct

Each of these sections should also be alphabetically ordered.

This functionality might be more in the spirit of isort than black, but given there is no isort for Vyper I think it could happily live within a tool such as blackadder :)

@spinoch
Copy link
Contributor

spinoch commented Nov 9, 2020

This functionality might be more in the spirit of isort than black, but given there is no isort for Vyper I think it could happily live within a tool such as blackadder :)

I think this functionality is useful but I'd rather keep the scope of blackadder limited for now, being "code formatter".

@spinoch spinoch mentioned this issue Nov 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants