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

Lint vertical spacing in Rust code #1572

Merged
merged 6 commits into from
Mar 15, 2023
Merged

Lint vertical spacing in Rust code #1572

merged 6 commits into from
Mar 15, 2023

Conversation

emilk
Copy link
Member

@emilk emilk commented Mar 12, 2023

This is a matter of taste, but I find vertical spacing to be crucial for readability.

I find it difficult to match what docstring goes with what element in this:

enum Meme {
  /// foo
  Badger,
  /// bar
  Mushroom,
  /// baz
  Snake,
}

While this is clear:

enum Meme {
  /// foo
  Badger,

  /// bar
  Mushroom,

  /// baz
  Snake,
}

similarly, I find it good practice to have a blank line before each new type declaration or impl block.

Checklist

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a matter of taste

definitely is :)
Don't care as much, seems a bit excessive to me to make it a hard rule. I wish this would happen via cargofmt or something else I can run on file save so I don't need to think about it

@emilk emilk force-pushed the emilk/lint-vertical-spacing branch from 90db9bf to f98c0a0 Compare March 15, 2023 09:05
@emilk emilk merged commit 48d86f1 into main Mar 15, 2023
@emilk emilk deleted the emilk/lint-vertical-spacing branch March 15, 2023 09:13
@emilk
Copy link
Member Author

emilk commented Mar 15, 2023

Not controversial enough apparently. I'll try harder next time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛑 controversial 🧑‍💻 dev experience developer experience (excluding CI)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants