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

CS: variety of whitespace fixes #360

Merged
merged 1 commit into from
Oct 20, 2020
Merged

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Sep 19, 2019

[This PR is part of a series to introduce code style checking to the repo]

Fix whitespace issues:

  • Don't use space indentation.
  • Don't use inline tabs.
  • Don't use precision alignment
  • No multiple consecutive blank lines.
  • One space (or a new line) on either side of a concatenation operator.
  • Always have a space (or new line) before and after each operator, with the exception of the boolean not ! and the spread operator.
  • No space between the boolean not ! and what it applies to.
    Note: This is the opposite of WPCS, but in line with the majority of uses of the ! operator in this repo.
  • Always have a space (or new line) after a comma.
  • Don't use horizontal alignment within single line arrays.
  • One space between the close parenthesis and the opening curly of function declarations.
  • No space on the inside of function call, function declaration, array, control structure or arbitrary parentheses.
    Note: This is the opposite of WPCS, but in line with the majority of code in this repo.
    Also note: for arrays this won't be enforced as there is no sniff available for this, but the current code-base has been fixed where necessary.
  • Multi-line function calls should have each parameter on a new line.
  • There should be one space between a control structure keyword and its opening parenthesis.
  • For multi-part control structures - if/else, try/catch, the next keyword should be on a new line.
    Note: This is the opposite of WPCS, but in line with the majority of code in this repo.
    Also note: This will not be enforced as there is no sniff for it, but is in line with the prevailing code style in the repo.
  • End each file with a new line character.

@jrfnl jrfnl added this to the 1.7.1 milestone Sep 19, 2019
@jrfnl jrfnl force-pushed the feature/cs-fix-whitespace-issues branch from 4321db0 to f519379 Compare October 18, 2020 13:52
@jrfnl
Copy link
Member Author

jrfnl commented Oct 18, 2020

Rebased for merge conflicts.

Fix whitespace issues:
* Don't use space indentation.
* Don't use inline tabs.
* Don't use precision alignment
* No multiple consecutive blank lines.
* One space (or a new line) on either side of a concatenation operator.
* Always have a space (or new line) before and after each operator, with the exception of the boolean not `!` and the spread operator.
* No space between the boolean not `!` and what it applies to.
    Note: _This is the opposite of WPCS, but in line with the majority of uses of the `!` operator in this repo._
* Always have a space (or new line) after a comma.
* Don't use horizontal alignment within single line arrays.
* One space between the close parenthesis and the opening curly of function declarations.
* No space on the inside of function call, function declaration, array, control structure or arbitrary parentheses.
    Note: _This is the opposite of WPCS, but in line with the majority of code in this repo._
    Also note: for arrays this won't be enforced as there is no sniff available for this, but the current code-base has been fixed where necessary.
* Multi-line function calls should have each parameter on a new line.
* There should be one space between a control structure keyword and its opening parenthesis.
* For multi-part control structures - `if/else`, `try/catch`, the next keyword should be on a new line.
    Note: _This is the opposite of WPCS, but in line with the majority of code in this repo._
    Also note: This will not be enforced as there is no sniff for it, but is in line with the prevailing code style in the repo.
* End each file with a new line character.
@jrfnl jrfnl force-pushed the feature/cs-fix-whitespace-issues branch from f519379 to eb7a22b Compare October 20, 2020 20:46
@jrfnl
Copy link
Member Author

jrfnl commented Oct 20, 2020

Rebased for merge conflicts ;-)

@schlessera schlessera merged commit e114972 into master Oct 20, 2020
@schlessera schlessera deleted the feature/cs-fix-whitespace-issues branch October 20, 2020 21:09
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.

2 participants