Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

[new rule] Space after branch #4112

Closed
wants to merge 2 commits into from

Conversation

arhontmw
Copy link

PR checklist

  • Addresses an existing issue: #0000
  • New feature, bugfix, or enhancement
    • Includes tests
  • Documentation update

Overview of change:

Rule that requires or restricts whitespace after branching keywords (for, if, switch, ...). Can be used instead of check-branch option of whitespace rule.

Motivation: check-branch only checks the presence of space but is invalid for the inverse situation, when a space after branch is forbidden

@arhontmw arhontmw changed the title Space after branch [new rule] Space after branch Aug 15, 2018
@giladgray
Copy link

@arhontmw why introduce this as a new rule instead of improving the existing whitespace rule? i would greatly prefer one solution for each problem.

@@ -0,0 +1,23 @@
if(x = 2) {}
~nil [missing]
Copy link
Contributor

Choose a reason for hiding this comment

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

The "nil" is weird

@@ -0,0 +1,23 @@
if(x = 2) {}
~nil [missing]
Copy link
Contributor

Choose a reason for hiding this comment

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

Same

@adidahiya adidahiya added the Formatting rule Relates to a rule which enforces code formatting and likely overlaps with prettier label Mar 12, 2019
@adidahiya
Copy link
Contributor

Sorry, this is stale and we are de-prioritizing formatting rules as per #4534. This functionality won't get added as a new rule, but if there is a lot of demand, we might want to add the check to an existing rule.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Formatting rule Relates to a rule which enforces code formatting and likely overlaps with prettier Resolution: Declined
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants