CI: Added .editorconfig linting

main
Igor Scheller 5 years ago committed by msquare
parent 390db395a6
commit 85d9e01489

@ -1,16 +1,33 @@
# This file is for unifying the coding style for different editors and IDEs # This file is for unifying the coding style for different editors and IDEs
# editorconfig.org # editorconfig.org
# https://github.com/editorconfig/specification/blob/master/index.rst
# PHP PSR-2 Coding Standards
# http://www.php-fig.org/psr/psr-2/
root = true root = true
[*.php] [*]
charset = utf-8 charset = utf-8
end_of_line = lf end_of_line = lf
indent_style = space
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
indent_style = space max_line_length = 120
[*.md]
trim_trailing_whitespace = false
[*.php]
indent_size = 4 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

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

@ -1,7 +1,7 @@
# Contributing # Contributing
## Coding guide lines ## Coding guide lines
* Make sure you code follows the [PSR-12](https://www.php-fig.org/psr/psr-12/) code style. * 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` to verify that. 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. * Use `use` statements wherever possible instead of writing the fully qualified name.
* Order the composer/npm dependencies alphabetically. * Order the composer/npm dependencies alphabetically.
* Do not use code from the [includes](./includes) directory anywhere else. * Do not use code from the [includes](./includes) directory anywhere else.

Loading…
Cancel
Save