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

Replace SemanticBlocks with custom BlockDelimiters #263

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

searls
Copy link
Contributor

@searls searls commented Mar 3, 2021

This change will move Standard from attempting to enforce Weirich-style semantic blocks, because there will always be edge-cases we can't cover automatically, given how expressive Ruby is and the fact that certain cases are genuinely ambiguous, such that an automated tool cannot reliably determine the authorial intent of a block.

Instead, the new rule will only enforce that single-line blocks be delimited with { and }, but otherwise allow users to use whatever multiline format they wish.

Resolves #255
Resolves #246
Resolves #94
Resolves #66

This change will move Standard from attempting to enforce Weirich-style semantic blocks, because there will always be edge-cases we can't cover automatically, given how expressive Ruby is and the fact that certain cases are genuinely ambiguous, such that an automated tool cannot reliably determine the authorial intent of a block.

Instead, the new rule will only enforce that single-line blocks be delimited with `{` and `}`, but otherwise allow users to use whatever multiline format they wish.
Copy link
Contributor

@jmkoni jmkoni left a comment

Choose a reason for hiding this comment

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

I think this is definitely the right move to make.

@searls searls merged commit a776217 into master Mar 3, 2021
@searls searls deleted the relax-semantic-blocks branch March 3, 2021 20:50
@dnsco
Copy link

dnsco commented Mar 4, 2021

Thanks for doing this! And thanks again for the awesome project! 💖

@R167
Copy link
Contributor

R167 commented Mar 4, 2021

Thank you! always had to disable because of certain edge cases and appreciate the more minimal form of enforcement now (which I really agree with!). Awesome project!!!

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