mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 17:57:04 +08:00
Add phpcs, Travis, clean up editorconfig and eslint
This commit is contained in:
parent
a90dfd686a
commit
76a6673088
|
@ -12,21 +12,8 @@ insert_final_newline = true
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
[*.js]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[*.{css,less}]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[*.html]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[*.{diff,md}]
|
[*.{diff,md}]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
[*.php]
|
[*.php]
|
||||||
indent_style = space
|
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
|
@ -27,7 +27,12 @@
|
||||||
"$": true,
|
"$": true,
|
||||||
"moment": true
|
"moment": true
|
||||||
},
|
},
|
||||||
|
"plugins": [
|
||||||
|
"react"
|
||||||
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"react/jsx-uses-vars": 1,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strict mode
|
* Strict mode
|
||||||
*/
|
*/
|
||||||
|
|
27
extensions/sticky/.php_cs
Executable file
27
extensions/sticky/.php_cs
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$header = <<<EOF
|
||||||
|
This file is part of Flarum.
|
||||||
|
|
||||||
|
(c) Toby Zerner <toby.zerner@gmail.com>
|
||||||
|
|
||||||
|
For the full copyright and license information, please view the LICENSE
|
||||||
|
file that was distributed with this source code.
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);
|
||||||
|
|
||||||
|
$finder = Symfony\CS\Finder\DefaultFinder::create()
|
||||||
|
->exclude('js')
|
||||||
|
->exclude('less')
|
||||||
|
->in(__DIR__);
|
||||||
|
|
||||||
|
return Symfony\CS\Config\Config::create()
|
||||||
|
->setUsingCache(true)
|
||||||
|
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
|
||||||
|
->fixers([
|
||||||
|
'short_array_syntax',
|
||||||
|
'header_comment',
|
||||||
|
'-psr0'
|
||||||
|
])
|
||||||
|
->finder($finder);
|
23
extensions/sticky/.travis.yml
Normal file
23
extensions/sticky/.travis.yml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
language: php
|
||||||
|
|
||||||
|
php:
|
||||||
|
- 5.5
|
||||||
|
- 5.6
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
allow_failures:
|
||||||
|
- php: hhvm
|
||||||
|
fast_finish: true
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- curl -s http://getcomposer.org/installer | php
|
||||||
|
- php composer.phar install
|
||||||
|
|
||||||
|
script:
|
||||||
|
- php composer.phar style
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
email:
|
||||||
|
on_failure: change
|
||||||
|
|
||||||
|
sudo: false
|
|
@ -3,5 +3,8 @@
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Flarum\\Sticky\\": "src/"
|
"Flarum\\Sticky\\": "src/"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"style": "phpcs --standard=PSR2 -np src"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user