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

Fix the formatter for no curly "if" statement with a line comment [GH-7185] #7447

Conversation

junichi11
Copy link
Member

Example:

if (true)
    $example = 1; // comment1

// comment2

Before:

if (true)
    $example = 1; // comment1

new line is added here
// comment2

After:

if (true)
    $example = 1; // comment1

// comment2

…acheGH-7185]

- apache#7185
- Don't add the `WHITESPACE_BETWEEN_LINE_COMMENTS` token
- Add unit tests

Example:
```php
if (true)
    $example = 1; // comment1

// comment2
```

Before:
```php
if (true)
    $example = 1; // comment1

new line is added here
// comment2
```

After:
```php
if (true)
    $example = 1; // comment1

// comment2
```
@junichi11 junichi11 added the PHP [ci] enable extra PHP tests (php/php.editor) label Jun 7, 2024
@junichi11 junichi11 added this to the NB23 milestone Jun 7, 2024
@junichi11 junichi11 requested a review from tmysik June 8, 2024 02:56
@junichi11 junichi11 linked an issue Jun 8, 2024 that may be closed by this pull request
@junichi11 junichi11 merged commit bf9d119 into apache:master Jun 9, 2024
33 checks passed
@junichi11 junichi11 deleted the php-gh-7185-formatting-for-nocurly-if-with-line-comment branch June 9, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP - Format adds blank lines each time it is run
2 participants