1
1
# OS2Web Data lookup [ ![ Build Status] ( https://travis-ci.org/OS2web/os2web_datalookup.svg?branch=8.x )] ( https://travis-ci.org/OS2web/os2web_datalookup )
2
+
2
3
## Install
3
4
4
5
OS2Web Data lookup provides integration with Danish data lookup services such as Service platformen or Datafordeler.
5
6
Module is available to download via composer.
6
- ```
7
+
8
+ ``` shell
7
9
composer require os2web/os2web_datalookup
8
10
drush en os2web_datalookup
9
11
```
10
12
11
13
## Update
14
+
12
15
Updating process for OS2Web Data lookup module is similar to usual Drupal 8 module.
13
16
Use Composer's built-in command for listing packages that have updates available:
14
17
15
- ```
18
+ ``` shell
16
19
composer outdated os2web/os2web_datalookup
17
20
```
18
21
19
22
## Automated testing and code quality
23
+
20
24
See [ OS2Web testing and CI information] ( https://github.com/OS2Web/docs#testing-and-ci )
21
25
22
26
## Contribution
@@ -28,14 +32,16 @@ For issue description there is expected that you will provide clear and
28
32
sufficient information about your feature request or bug report.
29
33
30
34
### Code review policy
35
+
31
36
See [ OS2Web code review policy] ( https://github.com/OS2Web/docs#code-review )
32
37
33
38
### Git name convention
39
+
34
40
See [ OS2Web git name convention] ( https://github.com/OS2Web/docs#git-guideline )
35
41
36
42
### Using services in other modules
37
43
38
- ```
44
+ ``` php
39
45
// CVR lookup
40
46
/** @var \Drupal\os2web_datalookup\Plugin\DataLookupManager $pluginManager */
41
47
$pluginManager = \Drupal::service('plugin.manager.os2web_datalookup');
@@ -66,7 +72,7 @@ if ($cprPlugin->isReady()) {
66
72
67
73
## New services/features
68
74
69
- ### Datafordeler integration (https://datafordeler.dk)
75
+ ### Datafordeler integration (< https://datafordeler.dk > )
70
76
71
77
In scope of os2forms project already implemented light integration
72
78
with Danmarks Adresseregister (DAR) via fetching data for form elements
@@ -76,7 +82,9 @@ As soon as it is clear how the integration is going to be used, then
76
82
os2forms_dawa will be refactored to OS2Web Data lookup plugin plugin.
77
83
78
84
## Important notes
85
+
79
86
### Serviceplatformen plugins
87
+
80
88
Settings for CPR and CVR serviceplantormen plugins are storing as configuration
81
89
in db and will(could) be exported as ` yml ` file via Drupal configuration
82
90
management system. And afterwards could be tracked by ` git ` .
@@ -87,3 +95,37 @@ will be exposed for third persons.
87
95
To avoid/prevent this behavior we recommend use ` Config ignore ` module, where
88
96
you can add all settings you do not want to export/import via configuration
89
97
management system.
98
+
99
+ ## Coding standards
100
+
101
+ Our coding are checked by GitHub Actions (cf.
102
+ [ .github/workflows/pr.yml] ( .github/workflows/pr.yml ) ). Use the commands below to
103
+ run the checks locally.
104
+
105
+ ### PHP
106
+
107
+ ``` shell
108
+ docker run --rm --volume ${PWD} :/app --workdir /app itkdev/php8.1-fpm composer install
109
+ # Fix (some) coding standards issues
110
+ docker run --rm --volume ${PWD} :/app --workdir /app itkdev/php8.1-fpm composer coding-standards-apply
111
+ # Check that code adheres to the coding standards
112
+ docker run --rm --volume ${PWD} :/app --workdir /app itkdev/php8.1-fpm composer coding-standards-check
113
+ ```
114
+
115
+ ### Markdown
116
+
117
+ ``` shell
118
+ docker run --rm --volume $PWD :/md peterdavehello/markdownlint markdownlint --ignore vendor --ignore LICENSE.md ' **/*.md' --fix
119
+ docker run --rm --volume $PWD :/md peterdavehello/markdownlint markdownlint --ignore vendor --ignore LICENSE.md ' **/*.md'
120
+ ```
121
+
122
+ ## Code analysis
123
+
124
+ We use [ PHPStan] ( https://phpstan.org/ ) for static code analysis.
125
+
126
+ Running statis code analysis on a standalone Drupal module is a bit tricky, so we use a helper script to run the
127
+ analysis:
128
+
129
+ ``` shell
130
+ docker run --rm --volume ${PWD} :/app --workdir /app itkdev/php8.1-fpm ./scripts/code-analysis
131
+ ```
0 commit comments