style: add prettier-php as code formatter
parent
1da3328bc2
commit
8e1ea8696b
|
@ -7,7 +7,7 @@ trim_trailing_whitespace = true
|
|||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.{json,yml}]
|
||||
[{*.{json,yml},.prettierrc}]
|
||||
indent_size = 2
|
||||
|
||||
[composer.json]
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
vendor/
|
||||
fixtures/
|
||||
validation/frameworks/
|
||||
tests/Validation/cases/
|
||||
package.json
|
||||
composer.json
|
||||
package-lock.json
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"printWidth": 120,
|
||||
"singleQuote": true
|
||||
}
|
|
@ -16,7 +16,11 @@ cache:
|
|||
|
||||
install:
|
||||
- composer install --prefer-dist --no-interaction
|
||||
- nvm install 10
|
||||
- nvm use 10
|
||||
- npm ci
|
||||
script:
|
||||
- npm run prettier
|
||||
- vendor/bin/phpcs -n
|
||||
- vendor/bin/phpunit --coverage-clover=coverage.xml --colors=always
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
@ -41,8 +45,8 @@ jobs:
|
|||
services:
|
||||
- docker
|
||||
install:
|
||||
- nvm install 8
|
||||
- nvm use 8
|
||||
- nvm install 10
|
||||
- nvm use 10
|
||||
- npm install
|
||||
script:
|
||||
- ./node_modules/.bin/semantic-release
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"recommendations": ["esbenp.prettier-vscode", "felixfbecker.php-debug", "EditorConfig.EditorConfig"]
|
||||
}
|
|
@ -43,7 +43,7 @@
|
|||
"psr-4": {
|
||||
"LanguageServer\\": "src/"
|
||||
},
|
||||
"files" : [
|
||||
"files": [
|
||||
"src/utils.php",
|
||||
"src/FqnUtilities.php",
|
||||
"src/ParserHelpers.php"
|
||||
|
@ -62,7 +62,7 @@
|
|||
"post-install-cmd": "@parse-stubs",
|
||||
"post-update-cmd": "@parse-stubs",
|
||||
"test": "vendor/bin/phpunit",
|
||||
"lint": "vendor/bin/phpcs"
|
||||
"lint": "vendor/bin/phpcs -s"
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
|
|
|
@ -53,6 +53,28 @@
|
|||
"url-template": "^2.0.8"
|
||||
}
|
||||
},
|
||||
"@prettier/plugin-php": {
|
||||
"version": "0.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.9.0.tgz",
|
||||
"integrity": "sha512-x3RS9P2W8jRseHa1wecmZnzh9w2kLUJIR6//CroHZtagFSgnGLRNvReDZLlT1PJtTMPVacluPOjY2BFPapO9bw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mem": "^3.0.1",
|
||||
"php-parser": "github:glayzzle/php-parser#ca007c812e9920bcf1ae9fd24f1a92f5d5906a5e"
|
||||
},
|
||||
"dependencies": {
|
||||
"mem": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/mem/-/mem-3.0.1.tgz",
|
||||
"integrity": "sha512-QKs47bslvOE0NbXOqG6lMxn6Bk0Iuw0vfrIeLykmQle2LkCw1p48dZDdzE+D88b/xqRJcZGcMNeDvSVma+NuIQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mimic-fn": "^1.0.0",
|
||||
"p-is-promise": "^1.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@semantic-release/commit-analyzer": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-6.0.0.tgz",
|
||||
|
@ -5496,6 +5518,11 @@
|
|||
"pify": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"php-parser": {
|
||||
"version": "github:glayzzle/php-parser#ca007c812e9920bcf1ae9fd24f1a92f5d5906a5e",
|
||||
"from": "github:glayzzle/php-parser#ca007c812e9920bcf1ae9fd24f1a92f5d5906a5e",
|
||||
"dev": true
|
||||
},
|
||||
"pify": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
||||
|
@ -5519,9 +5546,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"prettier": {
|
||||
"version": "1.14.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.2.tgz",
|
||||
"integrity": "sha512-McHPg0n1pIke+A/4VcaS2en+pTNjy4xF+Uuq86u/5dyDO59/TtFZtQ708QIRkEZ3qwKz3GVkVa6mpxK/CpB8Rg==",
|
||||
"version": "1.15.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.15.2.tgz",
|
||||
"integrity": "sha512-YgPLFFA0CdKL4Eg2IHtUSjzj/BWgszDHiNQAe0VAIBse34148whfdzLagRL+QiKS+YfK5ftB6X4v/MBw8yCoug==",
|
||||
"dev": true
|
||||
},
|
||||
"process-nextick-args": {
|
||||
|
|
|
@ -4,8 +4,13 @@
|
|||
"type": "git",
|
||||
"url": "https://github.com/felixfbecker/php-language-server.git"
|
||||
},
|
||||
"scripts": {
|
||||
"prettier": "prettier '**/{*.php,*.json,*.yml,*.md,.prettierrc,.*.yml}' --write --list-different"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@prettier/plugin-php": "^0.9.0",
|
||||
"@semantic-release/exec": "^3.1.0",
|
||||
"prettier": "^1.15.2",
|
||||
"semantic-release": "^15.9.9",
|
||||
"semantic-release-docker": "^2.1.0"
|
||||
},
|
||||
|
|
|
@ -4,10 +4,15 @@
|
|||
<file>tests</file>
|
||||
<exclude-pattern>tests/Validation/cases</exclude-pattern>
|
||||
<rule ref="PSR2">
|
||||
<exclude name="PSR2.Namespaces.UseDeclaration.MultipleDeclarations"/>
|
||||
<exclude name="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed"/>
|
||||
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace"/>
|
||||
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose"/>
|
||||
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen"/>
|
||||
<exclude name="Generic.Files.LineLength.TooLong"></exclude>
|
||||
<exclude name="PSR2.Namespaces.UseDeclaration.MultipleDeclarations" />
|
||||
<exclude name="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed" />
|
||||
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace" />
|
||||
<exclude name="PSR2.Methods.FunctionCallSignature.Indent" />
|
||||
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
|
||||
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen" />
|
||||
<exclude name="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen" />
|
||||
<exclude name="Squiz.ControlStructures.ForEachLoopDeclaration.SpacingBeforeAs" />
|
||||
<exclude name="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose" />
|
||||
</rule>
|
||||
</ruleset>
|
||||
|
|
Loading…
Reference in New Issue