Skip to content

Commit a75c68a

Browse files
author
Wout Gevaert
committed
Add php-cs-fixer dependency and github rule
1 parent 8fffe51 commit a75c68a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
COMPOSER_VERSION: 2
2828
INSTALL_PATH: php-cypher-dsl
2929
REPOSITORY_NAME: php-cypher-dsl
30+
FIXER_RULES: @PSR12,align_multiline_comment,array_indentation,blank_line_before_statement,indentation_type,no_trailing_whitespace,no_unused_imports,no_useless_else,no_useless_return,ordered_imports,phpdoc_scalar,return_assignment,simplified_if_return,single_line_after_imports,switch_case_space,trailing_comma_in_multiline,ternary_operator_spaces
3031

3132
steps:
3233
# https://getcomposer.org/download/
@@ -55,8 +56,14 @@ jobs:
5556
- name: Install dependencies
5657
run: composer update --working-dir ${{ env.INSTALL_PATH }}
5758

59+
- name: Run php-cs-fixer on src
60+
run: ./vendor/bin/php-cs-fixer fix --dry-run --verbose --rules=${{ env.FIXER_RULES }} ./src
61+
62+
- name: Run php-cs-fixer on tests
63+
run: ./vendor/bin/php-cs-fixer fix --dry-run --verbose --rules=${{ env.FIXER_RULES }} ./tests
64+
5865
- name: Run unit tests
5966
run: composer test --working-dir ${{ env.INSTALL_PATH }}
6067

6168
- name: Run mutation tests
62-
run: composer infect --working-dir ${{ env.INSTALL_PATH }}
69+
run: composer infect --working-dir ${{ env.INSTALL_PATH }}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
},
4141
"require-dev": {
4242
"phpunit/phpunit": "~9.0",
43-
"infection/infection": "^0.25.5"
43+
"infection/infection": "^0.25.5",
44+
"friendsofphp/php-cs-fixer": "^3.0"
4445
},
4546
"autoload": {
4647
"psr-4": {

0 commit comments

Comments
 (0)