Skip to content

Commit 87e94a4

Browse files
authored
Merge branch 'master' into feature/add_rule_indent_pipe_operator
2 parents 276d005 + 175156d commit 87e94a4

File tree

7 files changed

+52
-24
lines changed

7 files changed

+52
-24
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
os: [macos-latest, windows-latest]
11-
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
11+
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
1212
name: Test on ${{ matrix.os }} & PHP ${{ matrix.php-version }}
1313
steps:
1414
- name: Checkout

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
### 1.2.52
2+
3+
- Upgrade fmt.stub.php [(V1054.0.0)](https://github.com/driade/phpfmt8/releases/tag/v1054.0.0)
4+
5+
### 1.2.51
6+
7+
- Upgrade fmt.stub.php [(V1054.0.0)](https://github.com/driade/phpfmt8/releases/tag/v1054.0.0)
8+
9+
### 1.2.50
10+
11+
- Upgrade fmt.stub.php [(V1054.0.0)](https://github.com/driade/phpfmt8/releases/tag/v1054.0.0)
12+
113
### 1.2.49
214

315
- Upgrade fmt.stub.php [(V1053.0.0)](https://github.com/driade/phpfmt8/releases/tag/v1053.0.0)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ transformation.
181181
| YodaComparisons | Execute Yoda Comparisons. |
182182
| SpaceAfterExclamationMark | Add space after exclamation mark. |
183183
| SpaceAroundParentheses | Add spaces inside parentheses. |
184+
| IndentPipeOperator | Applies indentation to the pipe operator. |
184185
<!-- Transformations END -->
185186

186187
## Contribute

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vscode-phpfmt",
33
"displayName": "phpfmt - PHP formatter",
4-
"version": "1.2.49",
4+
"version": "1.2.52",
55
"description": "Integrates phpfmt into VS Code",
66
"main": "./dist/extension",
77
"scripts": {
@@ -297,6 +297,7 @@
297297
"YodaComparisons",
298298
"SpaceAfterExclamationMark",
299299
"SpaceAroundParentheses",
300+
"IndentPipeOperator",
300301
"WPResizeSpaces",
301302
"AlignDoubleSlashComments",
302303
"AlignGroupDoubleArrow",
@@ -409,6 +410,7 @@
409410
"Execute Yoda Comparisons.",
410411
"Add space after exclamation mark.",
411412
"Add spaces inside parentheses.",
413+
"Applies indentation to the pipe operator.",
412414
"Core pass",
413415
"Vertically align \"//\" comments.",
414416
"Vertically align T_DOUBLE_ARROW (=>) by line groups.",
@@ -530,6 +532,7 @@
530532
"YodaComparisons",
531533
"SpaceAfterExclamationMark",
532534
"SpaceAroundParentheses",
535+
"IndentPipeOperator",
533536
"WPResizeSpaces",
534537
"AlignDoubleSlashComments",
535538
"AlignGroupDoubleArrow",
@@ -642,6 +645,7 @@
642645
"Execute Yoda Comparisons.",
643646
"Add space after exclamation mark.",
644647
"Add spaces inside parentheses.",
648+
"Applies indentation to the pipe operator.",
645649
"Core pass",
646650
"Vertically align \"//\" comments.",
647651
"Vertically align T_DOUBLE_ARROW (=>) by line groups.",

scripts/release.mts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,19 @@ ${changelogData}`;
9898
process.exit(0);
9999
}
100100

101+
if (process.env.VSCE_TOKEN) {
102+
// Publish to VSCE
103+
try {
104+
await $({
105+
stdio: 'inherit',
106+
preferLocal: true
107+
})`vsce publish -p ${process.env.VSCE_TOKEN} --no-dependencies`;
108+
} catch (err) {
109+
consola.error(err);
110+
process.exit(0);
111+
}
112+
}
113+
101114
const git = simpleGit({
102115
config: [
103116
'credential.https://github.com/.helper="! f() { echo username=x-access-token; echo password=$GITHUB_TOKEN; };f"'
@@ -147,17 +160,7 @@ ${changelogData}`;
147160
}
148161
}
149162

150-
if (process.env.VSCE_TOKEN) {
151-
// Publish to VSCE
152-
try {
153-
await $({
154-
stdio: 'inherit',
155-
preferLocal: true
156-
})`vsce publish -p ${process.env.VSCE_TOKEN} --no-dependencies`;
157-
} catch (err) {
158-
consola.error(err);
159-
}
160-
}
163+
161164

162165
if (process.env.OVSX_TOKEN) {
163166
// Publish to OVSX

src/PHPFmt.ts

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,24 @@ export class PHPFmt {
256256
throw new PHPFmtError(`Cannot create tmp file in "${tmpDir}"`);
257257
}
258258

259-
// test whether the php file has syntax error
260-
try {
261-
await exec(`${this.config.php_bin} -l "${tmpFileName}"`, execOptions);
262-
} catch (err) {
263-
this.widget.logError('PHP lint failed', err);
264-
vscode.window.setStatusBarMessage(
265-
'phpfmt: Format failed - syntax errors found',
266-
4500
267-
);
268-
throw new PHPFmtSkipError();
259+
const hasAutoSemicolon =
260+
this.config.passes.includes('AutoSemicolon') ||
261+
this.config.exclude.includes('AutoSemicolon');
262+
263+
if (! hasAutoSemicolon) {
264+
// test whether the php file has syntax error
265+
try {
266+
await exec(`${this.config.php_bin} -l "${tmpFileName}"`, execOptions);
267+
} catch (err) {
268+
this.widget.logError('PHP lint failed', err);
269+
vscode.window.setStatusBarMessage(
270+
'phpfmt: Format failed - syntax errors found',
271+
4500
272+
);
273+
throw new PHPFmtSkipError();
274+
}
275+
} else {
276+
this.widget.logInfo('Skipping PHP lint because AutoSemicolon is active');
269277
}
270278

271279
const args = this.getArgs(tmpFileName);

src/meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Meta info
55
export const publisher = "kokororin"
66
export const name = "vscode-phpfmt"
7-
export const version = "1.2.48"
7+
export const version = "1.2.51"
88
export const displayName = "phpfmt - PHP formatter"
99
export const description = "Integrates phpfmt into VS Code"
1010
export const extensionId = `${publisher}.${name}`

0 commit comments

Comments
 (0)