-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added tests, made php-cs-fixer a formatter
- Loading branch information
1 parent
d724356
commit 58ecf72
Showing
16 changed files
with
110 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { linterFmtTest } from "tests"; | ||
import { skipOS } from "tests/utils"; | ||
|
||
linterFmtTest({ | ||
linterName: "php-cs-fixer", | ||
skipTestIf: skipOS(["win32"]), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: 0.1 | ||
tools: | ||
definitions: | ||
- name: php-cs-fixer | ||
runtime: php | ||
package: friendsofphp/php-cs-fixer | ||
known_good_version: 3.54.0 | ||
shims: [php-cs-fixer] | ||
environment: | ||
- name: PATH | ||
list: ["${tool}/vendor/bin"] | ||
health_checks: | ||
- command: php-cs-fixer --version | ||
parse_regex: PHP CS Fixer ${semver} | ||
lint: | ||
definitions: | ||
- name: php-cs-fixer | ||
description: Keeps PHP code up to standards | ||
tools: [php-cs-fixer] | ||
known_good_version: 3.54.0 | ||
files: [php] | ||
commands: | ||
# TODO(Tyler): Do we want to define a lint command here? | ||
- name: format | ||
output: rewrite | ||
success_codes: [0] | ||
formatter: true | ||
batch: true | ||
in_place: true | ||
run: php-cs-fixer fix --using-cache=no --show-progress=none ${target} | ||
direct_configs: | ||
# uses ruleset @PSR12 when a config is not present. | ||
- .php-cs-fixer.dist.php | ||
affects_cache: | ||
- .php-cs-fixer.php | ||
suggest_if: config_present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
class HelloWorld | ||
{ | ||
private $b; | ||
|
||
private $a; | ||
|
||
|
||
public function sayHello(DateTimeImutable $date): void | ||
{ | ||
$c=(ARRAY)array(1,2); | ||
echo 'Hello, ' . $date->format('j. n. Y'); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
linters/php-cs-fixer/test_data/php_cs_fixer_v3.54.0_basic.fmt.shot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Testing formatter php-cs-fixer test basic 1`] = ` | ||
"<?php | ||
|
||
declare(strict_types=1); | ||
|
||
class HelloWorld | ||
{ | ||
private $b; | ||
|
||
private $a; | ||
|
||
|
||
public function sayHello(DateTimeImutable $date): void | ||
{ | ||
$c = (array)array(1,2); | ||
echo 'Hello, ' . $date->format('j. n. Y'); | ||
} | ||
} | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { toolInstallTest } from "tests"; | ||
import { skipOS } from "tests/utils"; | ||
|
||
toolInstallTest({ | ||
toolName: "paratest", | ||
toolVersion: "7.4.3", | ||
skipTestIf: skipOS(["win32"]), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { toolInstallTest } from "tests"; | ||
import { skipOS } from "tests/utils"; | ||
|
||
toolInstallTest({ | ||
toolName: "phpunit", | ||
toolVersion: "11.1.3", | ||
skipTestIf: skipOS(["win32"]), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters