Skip to content

Commit d2f5585

Browse files
committed
1322: Applied coding standards
1 parent 186639a commit d2f5585

File tree

8 files changed

+591
-108
lines changed

8 files changed

+591
-108
lines changed

.github/workflows/pr.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
- name: Validate composer files
4444
run: |
4545
composer validate composer.json
46+
- name: Check composer file is normalized
47+
run: |
48+
composer normalize composer.json --dry-run
4649
4750
phpcs:
4851
name: PHP - Check Coding Standards

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,14 @@ for further details.
161161
## Coding standards
162162

163163
```sh
164-
docker compose exec phpfpm composer coding-standards-check
165164
docker compose exec phpfpm composer coding-standards-apply
165+
docker compose exec phpfpm composer coding-standards-check
166166
```
167167

168168
```sh
169169
docker compose run --rm node yarn install
170-
docker compose run --rm node yarn coding-standards-check
171170
docker compose run --rm node yarn coding-standards-apply
171+
docker compose run --rm node yarn coding-standards-check
172172
```
173173

174174
### GitHub Actions

composer.json

Lines changed: 111 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,9 @@
11
{
22
"name": "os2loop/os2loop",
33
"description": "OS2Loop",
4-
"type": "project",
54
"license": "GPL-2.0-or-later",
5+
"type": "project",
66
"homepage": "https://github.com/os2loop/os2loop",
7-
"repositories": {
8-
"drupal": {
9-
"type": "composer",
10-
"url": "https://packages.drupal.org/8",
11-
"canonical": false
12-
},
13-
"drupal/theme_switcher": {
14-
"type": "vcs",
15-
"url": "https://git.drupalcode.org/project/theme_switcher"
16-
},
17-
"os2loop/os2loop_fixtures": {
18-
"type": "path",
19-
"url": "web/profiles/custom/os2loop/modules/os2loop_fixtures"
20-
},
21-
"drupal/views_flag_refresh": {
22-
"type": "package",
23-
"package": {
24-
"name": "drupal/views_flag_refresh",
25-
"version": "dev-2929394-drupal-8-port",
26-
"type": "drupal-module",
27-
"source": {
28-
"url": "https://git.drupalcode.org/issue/views_flag_refresh-2929394.git",
29-
"type": "git",
30-
"reference": "origin/2929394-drupal-8-port"
31-
}
32-
}
33-
}
34-
},
357
"require": {
368
"php": "^8.2",
379
"composer/installers": "^2.0",
@@ -87,58 +59,99 @@
8759
"drupal/xls_serialization": "^1.3",
8860
"drush/drush": "^12.2"
8961
},
90-
"scripts": {
91-
"code-analysis/phpstan": [
92-
"phpstan analyse --configuration=phpstan.neon --memory-limit=2G"
93-
],
94-
"code-analysis": [
95-
"@code-analysis/phpstan"
96-
],
97-
"coding-standards-check/phpcs": [
98-
"php vendor/bin/phpcs --standard=phpcs.xml.dist"
99-
],
100-
"coding-standards-check/twigcs": [
101-
"twigcs web/profiles/custom/os2loop/themes/os2loop_theme/templates"
102-
],
103-
"coding-standards-check": [
104-
"@coding-standards-check/phpcs",
105-
"@coding-standards-check/twigcs"
106-
],
107-
"coding-standards-apply/phpcs": [
108-
"vendor/bin/phpcbf --standard=phpcs.xml.dist"
109-
],
110-
"coding-standards-apply": [
111-
"@coding-standards-apply/phpcs"
112-
]
62+
"require-dev": {
63+
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
64+
"drupal/coder": "^8.3",
65+
"drupal/core-dev": "^10.1",
66+
"drupal/devel": "^5.1",
67+
"ergebnis/composer-normalize": "^2.42",
68+
"friendsoftwig/twigcs": "^6.2",
69+
"kint-php/kint": "^5.0",
70+
"mglaman/phpstan-drupal": "^1.2",
71+
"os2loop/os2loop_fixtures": "*",
72+
"phpspec/prophecy-phpunit": "^2.0",
73+
"phpstan/extension-installer": "^1.3",
74+
"phpstan/phpstan-deprecation-rules": "^1.1"
11375
},
11476
"conflict": {
11577
"drupal/drupal": "*"
11678
},
79+
"repositories": {
80+
"drupal": {
81+
"type": "composer",
82+
"url": "https://packages.drupal.org/8",
83+
"canonical": false
84+
},
85+
"drupal/theme_switcher": {
86+
"type": "vcs",
87+
"url": "https://git.drupalcode.org/project/theme_switcher"
88+
},
89+
"os2loop/os2loop_fixtures": {
90+
"type": "path",
91+
"url": "web/profiles/custom/os2loop/modules/os2loop_fixtures"
92+
},
93+
"drupal/views_flag_refresh": {
94+
"type": "package",
95+
"package": {
96+
"name": "drupal/views_flag_refresh",
97+
"type": "drupal-module",
98+
"version": "dev-2929394-drupal-8-port",
99+
"source": {
100+
"type": "git",
101+
"url": "https://git.drupalcode.org/issue/views_flag_refresh-2929394.git",
102+
"reference": "origin/2929394-drupal-8-port"
103+
}
104+
}
105+
}
106+
},
117107
"minimum-stability": "dev",
118108
"prefer-stable": true,
119109
"config": {
120-
"sort-packages": true,
121-
"process-timeout": 0,
122110
"allow-plugins": {
123111
"composer/installers": true,
124112
"cweagans/composer-patches": true,
125113
"dealerdirect/phpcodesniffer-composer-installer": true,
126114
"drupal/console-extend-plugin": true,
127115
"drupal/core-composer-scaffold": true,
128116
"drupal/core-project-message": true,
129-
"phpstan/extension-installer": true,
130-
"php-http/discovery": true
131-
}
117+
"ergebnis/composer-normalize": true,
118+
"php-http/discovery": true,
119+
"phpstan/extension-installer": true
120+
},
121+
"process-timeout": 0,
122+
"sort-packages": true
132123
},
133124
"extra": {
125+
"drupal-core-project-message": {
126+
"include-keys": [
127+
"homepage",
128+
"support"
129+
],
130+
"post-create-project-cmd-message": [
131+
"<bg=blue;fg=white> </>",
132+
"<bg=blue;fg=white> Congratulations, you’ve installed the Drupal codebase </>",
133+
"<bg=blue;fg=white> from the drupal/recommended-project template! </>",
134+
"<bg=blue;fg=white> </>",
135+
"",
136+
"<bg=yellow;fg=black>Next steps</>:",
137+
" * Install the site: https://www.drupal.org/docs/8/install",
138+
" * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
139+
" * Get support: https://www.drupal.org/support",
140+
" * Get involved with the Drupal community:",
141+
" https://www.drupal.org/getting-involved",
142+
" * Remove the plugin that prints this message:",
143+
" composer remove drupal/core-project-message"
144+
]
145+
},
134146
"drupal-scaffold": {
135-
"locations": {
136-
"web-root": "web/"
137-
},
138147
"file-mapping": {
139148
"[web-root]/sites/development.services.yml": false
149+
},
150+
"locations": {
151+
"web-root": "web/"
140152
}
141153
},
154+
"enable-patching": true,
142155
"installer-paths": {
143156
"web/core": [
144157
"type:drupal-core"
@@ -171,40 +184,11 @@
171184
"type:os2loop-custom-module"
172185
]
173186
},
174-
"drupal-core-project-message": {
175-
"include-keys": [
176-
"homepage",
177-
"support"
178-
],
179-
"post-create-project-cmd-message": [
180-
"<bg=blue;fg=white> </>",
181-
"<bg=blue;fg=white> Congratulations, you’ve installed the Drupal codebase </>",
182-
"<bg=blue;fg=white> from the drupal/recommended-project template! </>",
183-
"<bg=blue;fg=white> </>",
184-
"",
185-
"<bg=yellow;fg=black>Next steps</>:",
186-
" * Install the site: https://www.drupal.org/docs/8/install",
187-
" * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
188-
" * Get support: https://www.drupal.org/support",
189-
" * Get involved with the Drupal community:",
190-
" https://www.drupal.org/getting-involved",
191-
" * Remove the plugin that prints this message:",
192-
" composer remove drupal/core-project-message"
193-
]
194-
},
195-
"enable-patching": true,
196187
"patches": {
197188
"drupal/core": {
198189
"Disable forced configuration langcode (https://www.drupal.org/project/drupal/issues/3150540)": "https://www.drupal.org/files/issues/2024-01-25/3150540-40.patch",
199190
"Handle undefined index when using form states (https://www.drupal.org/project/drupal/issues/2700667)": "https://www.drupal.org/files/issues/2020-03-11/2700667-104.patch"
200191
},
201-
"drupal/flag": {
202-
"Implement Migration Paths for Flag 7.x (https://www.drupal.org/project/flag/issues/2409901#comment-13082245)": "https://www.drupal.org/files/issues/2019-04-25/2409901_flag_migration_paths_52.patch",
203-
"Implement Migration Paths for Flag 7.x (https://www.drupal.org/project/flag/issues/2409901#comment-13281955)": "https://www.drupal.org/files/issues/2019-10-02/2409901-60.patch"
204-
},
205-
"drupal/masquerade": {
206-
"https://www.drupal.org/project/masquerade/issues/2962970#comment-13391256": "https://www.drupal.org/files/issues/2019-12-13/temporary%20unmask%20workaround-2962970-8.patch"
207-
},
208192
"drupal/devel": {
209193
"Public methods are not visible in kint (https://www.drupal.org/project/devel/issues/3112201)": "https://www.drupal.org/files/issues/2022-04-26/devel_3112201_4.patch"
210194
},
@@ -213,20 +197,46 @@
213197
},
214198
"drupal/entity_reference_integrity": {
215199
"https://www.drupal.org/project/entity_reference_integrity/issues/3380250": "https://www.drupal.org/files/issues/2023-08-29/entity_reference_integrity-3380250-5.patch"
200+
},
201+
"drupal/flag": {
202+
"Implement Migration Paths for Flag 7.x (https://www.drupal.org/project/flag/issues/2409901#comment-13082245)": "https://www.drupal.org/files/issues/2019-04-25/2409901_flag_migration_paths_52.patch",
203+
"Implement Migration Paths for Flag 7.x (https://www.drupal.org/project/flag/issues/2409901#comment-13281955)": "https://www.drupal.org/files/issues/2019-10-02/2409901-60.patch"
204+
},
205+
"drupal/masquerade": {
206+
"https://www.drupal.org/project/masquerade/issues/2962970#comment-13391256": "https://www.drupal.org/files/issues/2019-12-13/temporary%20unmask%20workaround-2962970-8.patch"
216207
}
217208
}
218209
},
219-
"require-dev": {
220-
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
221-
"drupal/coder": "^8.3",
222-
"drupal/core-dev": "^10.1",
223-
"drupal/devel": "^5.1",
224-
"friendsoftwig/twigcs": "^6.2",
225-
"kint-php/kint": "^5.0",
226-
"mglaman/phpstan-drupal": "^1.2",
227-
"os2loop/os2loop_fixtures": "*",
228-
"phpspec/prophecy-phpunit": "^2.0",
229-
"phpstan/extension-installer": "^1.3",
230-
"phpstan/phpstan-deprecation-rules": "^1.1"
210+
"scripts": {
211+
"code-analysis": [
212+
"@code-analysis/phpstan"
213+
],
214+
"code-analysis/phpstan": [
215+
"phpstan analyse --configuration=phpstan.neon --memory-limit=2G"
216+
],
217+
"coding-standards-apply": [
218+
"@coding-standards-apply/phpcs",
219+
"@coding-standards-apply/composer-normalize"
220+
],
221+
"coding-standards-apply/composer-normalize": [
222+
"@normalize"
223+
],
224+
"coding-standards-apply/phpcs": [
225+
"vendor/bin/phpcbf --standard=phpcs.xml.dist"
226+
],
227+
"coding-standards-check": [
228+
"@coding-standards-check/phpcs",
229+
"@coding-standards-check/twigcs",
230+
"@coding-standards-check/composer-normalize"
231+
],
232+
"coding-standards-check/composer-normalize": [
233+
"@normalize --dry-run"
234+
],
235+
"coding-standards-check/phpcs": [
236+
"php vendor/bin/phpcs --standard=phpcs.xml.dist"
237+
],
238+
"coding-standards-check/twigcs": [
239+
"twigcs web/profiles/custom/os2loop/themes/os2loop_theme/templates"
240+
]
231241
}
232242
}

0 commit comments

Comments
 (0)