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

Vertical whitespace between functions #5136

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

bunnyhero
Copy link

As requested in #2526, adds a configuration option to vertical_whitespace rule that allows specifying a separate value for the maximum number of empty lines between functions.

Notes:

  • The new option is named max_empty_lines_between_functions. If the option is absent, then its value defaults to the value of max_empty_lines. I was uncertain of the best way to handle this, and if there's a simple way to note how this works in the generated documentation.
  • I use a linear search to detect whether a section of empty lines is adjacent to a function. Obviously this isn't very efficient. I haven't benchmarked this however.

@SwiftLintBot
Copy link

17 Messages
📖 Linting Aerial with this PR took 1.12s vs 1.11s on main (0% slower)
📖 Linting Alamofire with this PR took 1.45s vs 1.45s on main (0% slower)
📖 Linting Brave with this PR took 8.13s vs 8.09s on main (0% slower)
📖 Linting DuckDuckGo with this PR took 3.95s vs 3.96s on main (0% faster)
📖 Linting Firefox with this PR took 9.57s vs 9.55s on main (0% slower)
📖 Linting Kickstarter with this PR took 10.49s vs 10.44s on main (0% slower)
📖 Linting Moya with this PR took 0.6s vs 0.6s on main (0% slower)
📖 Linting NetNewsWire with this PR took 3.16s vs 3.14s on main (0% slower)
📖 Linting Nimble with this PR took 0.77s vs 0.76s on main (1% slower)
📖 Linting PocketCasts with this PR took 8.12s vs 8.09s on main (0% slower)
📖 Linting Quick with this PR took 0.38s vs 0.38s on main (0% slower)
📖 Linting Realm with this PR took 11.86s vs 11.86s on main (0% slower)
📖 Linting Sourcery with this PR took 2.34s vs 2.32s on main (0% slower)
📖 Linting Swift with this PR took 5.18s vs 5.14s on main (0% slower)
📖 Linting VLC with this PR took 1.41s vs 1.39s on main (1% slower)
📖 Linting Wire with this PR took 8.66s vs 8.62s on main (0% slower)
📖 Linting WordPress with this PR took 12.45s vs 12.41s on main (0% slower)

Generated by 🚫 Danger

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

Successfully merging this pull request may close these issues.

None yet

2 participants