CI: Added .editorconfig linting

This commit is contained in:
Igor Scheller 2020-05-13 18:40:03 +02:00 committed by msquare
parent 390db395a6
commit 85d9e01489
3 changed files with 30 additions and 7 deletions

View File

@ -1,16 +1,33 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# PHP PSR-2 Coding Standards
# http://www.php-fig.org/psr/psr-2/
# https://github.com/editorconfig/specification/blob/master/index.rst
root = true
[*.php]
[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
max_line_length = 120
[*.md]
trim_trailing_whitespace = false
[*.php]
indent_size = 4
[*.{js,css,less,sass,scss}]
indent_size = 2
[*.{yml,yaml}]
indent_size = 2
[*.mo]
charset = unset
end_of_line = unset
indent_style = unset
indent_size = unset
insert_final_newline = unset
trim_trailing_whitespace = unset

View File

@ -35,6 +35,12 @@ check-style:
script:
- phpcs -p --no-colors --basepath="$PWD"
check-editorconfig:
image: mstruebing/editorconfig-checker
stage: validate
script:
- ec -v
validate-composer:
image: composer:latest
stage: validate

View File

@ -1,7 +1,7 @@
# Contributing
## Coding guide lines
* Make sure you code follows the [PSR-12](https://www.php-fig.org/psr/psr-12/) code style.
You may use `composer run phpcs` to verify that.
* Make sure your code follows the [PSR-12](https://www.php-fig.org/psr/psr-12/) code style and is [.editorconfig](.editorconfig) valid.
You may use `composer run phpcs` and [Editorconfig-Checker](https://editorconfig-checker.github.io) to verify that.
* Use `use` statements wherever possible instead of writing the fully qualified name.
* Order the composer/npm dependencies alphabetically.
* Do not use code from the [includes](./includes) directory anywhere else.