akalongman / akalongman/sublimetext-codeformatter

Space around control structure parantheses and single line opening & closing php tags

Open
#267 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
772
Forks
128
PR merge metrics
No merged PRs in 30d

Description

Hi,

First, thank you for the awesome utility, very handy and versatile.

I do have a couple of issues though:
1. The "SpaceAroundControlStructures" PHP pass has no effect inside the parantheses, is it possible to also apply it there? I couldn't find any other relevant options or passes, maybe I missed it?
e.g. "if(condition && condition2) {" => "if ( condition && condition2 ) {"
2. If i have opening and closing PHP tags on the same line, it adds a newlineafter the opening tag, but this is not desirable when inside an HTML block where I output pieces of code conditionally, e.g.

```php


Some content


Some conditional content


```

which gets transformed into:

```php


Some content


Some conditional content


```

How can I force it to keep everything on a single line?

Cheers!

Edit: Seems the second issue is due to the "SpaceAroundControlStructures" pass, perhaps I am gravely misunderstanding what these transforms mean, but space != newline.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.