Skip to content

Commit d000a05

Browse files
committed
Cleaned up code
1 parent eecb47a commit d000a05

File tree

17 files changed

+92
-105
lines changed

17 files changed

+92
-105
lines changed

.github/workflows/pr.yml

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
strategy:
2525
matrix:
26-
php-versions: [ '8.1' ]
26+
php-versions: [ '8.3' ]
2727
dependency-version: [ prefer-lowest, prefer-stable ]
2828
steps:
2929
- uses: actions/checkout@master
@@ -39,24 +39,29 @@ jobs:
3939
id: composer-cache
4040
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
4141
- name: Cache dependencies
42-
uses: actions/cache@v2
42+
uses: actions/cache@v4
4343
with:
4444
path: ${{ steps.composer-cache.outputs.dir }}
4545
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
4646
restore-keys: ${{ runner.os }}-composer-
4747
- name: Validate composer files
4848
run: |
4949
composer config --no-plugins allow-plugins.mglaman/composer-drupal-lenient true
50-
composer validate --strict composer.json
50+
# The --strict flag on validate has been removed due to the package drupal/config_entity_revisions 2.0.x-dev
51+
# being considered a version cf. https://getcomposer.org/doc/articles/versions.md#branches
52+
composer validate composer.json
5153
# Check that dependencies resolve.
5254
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
55+
- name: Check that composer file is normalized
56+
run: |
57+
composer normalize --dry-run
5358
5459
php-coding-standards:
5560
name: PHP coding standards
5661
runs-on: ubuntu-latest
5762
strategy:
5863
matrix:
59-
php-versions: [ '8.1' ]
64+
php-versions: [ '8.3' ]
6065
steps:
6166
- uses: actions/checkout@master
6267
- name: Setup PHP, with composer and extensions
@@ -71,7 +76,7 @@ jobs:
7176
id: composer-cache
7277
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
7378
- name: Cache dependencies
74-
uses: actions/cache@v2
79+
uses: actions/cache@v4
7580
with:
7681
path: ${{ steps.composer-cache.outputs.dir }}
7782
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -89,7 +94,7 @@ jobs:
8994
runs-on: ubuntu-latest
9095
strategy:
9196
matrix:
92-
php-versions: [ '8.1' ]
97+
php-versions: [ '8.3' ]
9398
steps:
9499
- uses: actions/checkout@master
95100
- name: Setup PHP, with composer and extensions
@@ -104,7 +109,7 @@ jobs:
104109
id: composer-cache
105110
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
106111
- name: Cache dependencies
107-
uses: actions/cache@v2
112+
uses: actions/cache@v4
108113
with:
109114
path: ${{ steps.composer-cache.outputs.dir }}
110115
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -113,27 +118,13 @@ jobs:
113118
run: |
114119
./scripts/code-analysis
115120
116-
markdownlint:
121+
coding-standards-markdown:
122+
name: Markdown coding standards
117123
runs-on: ubuntu-latest
118-
name: markdownlint
119124
steps:
120125
- name: Checkout
121-
uses: actions/checkout@v2
122-
- name: Get yarn cache directory path
123-
id: yarn-cache-dir-path
124-
run: echo "::set-output name=dir::$(yarn cache dir)"
125-
- name: Cache yarn packages
126-
uses: actions/cache@v2
127-
id: yarn-cache
128-
with:
129-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
130-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
131-
restore-keys: |
132-
${{ runner.os }}-yarn-
133-
- name: Yarn install
134-
uses: actions/setup-node@v2
135-
with:
136-
node-version: '20'
137-
- run: yarn install
138-
- name: markdownlint
139-
run: yarn coding-standards-check/markdownlint
126+
uses: actions/checkout@master
127+
128+
- name: Coding standards
129+
run: |
130+
docker run --rm --volume $PWD:/md peterdavehello/markdownlint markdownlint --ignore vendor --ignore LICENSE.md '**/*.md'

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@
44
composer.lock
55
vendor
66

7-
node_modules/
8-
yarn.lock

.markdownlint.jsonc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"default": true,
3+
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md
4+
"line-length": {
5+
"line_length": 120,
6+
"code_blocks": false,
7+
"tables": false
8+
},
9+
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md
10+
"no-duplicate-heading": {
11+
"siblings_only": true
12+
}
13+
}

.markdownlintrc

Lines changed: 0 additions & 18 deletions
This file was deleted.

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,29 +122,28 @@ run the checks locally.
122122

123123
```sh
124124
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm composer install
125-
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm composer coding-standards-check
126-
127125
# Fix (some) coding standards issues.
128126
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm composer coding-standards-apply
127+
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm composer coding-standards-check
129128
```
130129

131130
### Markdown
132131

133132
```sh
134-
docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn install
135-
docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn coding-standards-check/markdownlint
136-
137-
# Fix (some) coding standards issues.
138-
docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn coding-standards-apply/markdownlint
133+
docker pull peterdavehello/markdownlint
134+
docker run --rm --volume $PWD:/md peterdavehello/markdownlint markdownlint --ignore vendor --ignore LICENSE.md '**/*.md' --fix
135+
docker run --rm --volume $PWD:/md peterdavehello/markdownlint markdownlint --ignore vendor --ignore LICENSE.md '**/*.md'
139136
```
140137

141138
## Code analysis
142139

143140
We use [PHPStan](https://phpstan.org/) for static code analysis.
144141

145-
Running statis code analysis on a standalone Drupal module is a bit tricky, so
146-
we use a helper script to run the analysis:
142+
Running statis code analysis on a standalone Drupal module is a bit tricky, so we use a helper script to run the
143+
analysis:
147144

148-
```sh
149-
./scripts/code-analysis
145+
```shell
146+
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm ./scripts/code-analysis
150147
```
148+
149+
**Note**: Currently the code analysis is only run on the `os2forms_digital_post` sub-module (cf. [`phpstan.neon`](./phpstan.neon)).

modules/os2forms_attachment/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
# OS2Forms Attachment Drupal module
22

3-
# Module purpose
3+
## Module purpose
44

55
The aim of this module is to provide an OS2forms attachment element for adding PDF/HTML attachment.
66

77
It also supports creation of reusable headers/footers components which are used when rendering the attachments.
88

9-
# How does it work
9+
## How does it work
1010

11-
To add custom headers/footer ```admin/structure/webform/config/os2forms_attachment_component```
11+
To add custom headers/footer `admin/structure/webform/config/os2forms_attachment_component`
1212

13-
To specify headers/footers that will override the default ones on a global level (**Third party settings** -> **Entity print** section): ```admin/structure/webform/config```
13+
To specify headers/footers that will override the default ones on a global level (**Third party settings** -> **Entity
14+
print** section): `admin/structure/webform/config`
1415

15-
To specify headers/footers that will override the default ones on a form level (**Third party settings** -> **Entity print** section): ```/admin/structure/webform/manage/[webform]/settings```
16+
To specify headers/footers that will override the default ones on a form level (**Third party settings** -> **Entity
17+
print** section): ```/admin/structure/webform/manage/[webform]/settings```
1618

17-
# Overwriting templates
19+
## Overwriting templates
1820

1921
With some setups it might be necessary to overwrite templates
2022
in order to access stylesheets or images.
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# OS2Forms Autocomplete Drupal module
22

3-
# Module purpose
3+
## Module purpose
44

5-
The aim of this module is to provide a genetic OS2Forms Autocomplete element which can return options from an external webservice.
5+
The aim of this module is to provide a genetic OS2Forms Autocomplete element which can return options from an external
6+
webservice.
67

7-
# How does it work
8+
## How does it work
89

910
Module exposes OS2Forms Autocomplete component that are available in the webform build process.
1011

1112
Build page:
1213

13-
```
14+
```url
1415
admin/structure/webform/manage/[webform]
1516
```

modules/os2forms_dawa/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# OS2Forms DAWA Drupal module
22

3-
# Module purpose
3+
## Module purpose
44

5-
The aim of this module is to provide integration with Danish Addresses Web API (DAWA https://dawa.aws.dk) and provider address autocomplete fields.
5+
The aim of this module is to provide integration with Danish Addresses Web API (DAWA <https://dawa.aws.dk>) and provider
6+
address autocomplete fields.
67

7-
# How does it work
8+
## How does it work
89

910
Module exposes couple of new Autocomplete components that are available in the webform build process.
1011

modules/os2forms_fasit/docs/BENYTTELSE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ aftale hvilke certifikater der anvendes. Disse certifikater skal være OCES-3,
1010
f.eks. FOCES-3, og skal bruges i pem- eller cer-format.
1111

1212
Dernæst oplyses det anvendte certifikats thumbprint eller public-key til Fasit,
13-
som derefter aktiverer snitfladen. Se evt.
13+
som derefter aktiverer snitfladen. Se evt.
1414
[README#certificate](../README.md#certificate)
1515
for hvordan et certifikats thumbprint kan findes gennem kommandolinjen.
1616

@@ -22,22 +22,22 @@ Her skal følgende sættes op:
2222

2323
* Fasit API base url
2424
* Basis url’en til Fasit. Denne specificeres af Fasit.
25-
* Eksempel: https://webservices.fasit.dk/
25+
* Eksempel: <https://webservices.fasit.dk/>
2626
* Fasit API tenant
2727
* Fasit tenant. Denne specificeres af Fasit.
2828
* Eksempel: aarhus
2929
* Fasit API version
3030
* Hvilken version af af API’et der skal bruges. Her er mulighederne ’v1’ eller ’v2’. Der bør altid bruges ’v2’.
3131
* Eksempel: v2
3232
* Certificate
33-
* Her kan angives detaljer til et azure key vault hvori certifikatet ligges (Azure key vault) eller en sti direkte til certifikatet (Filsystem)
33+
* Her kan angives detaljer til et azure key vault hvori certifikatet ligges (Azure key vault) eller en sti direkte til
34+
certifikatet (Filsystem)
3435
* Passphrase
3536
* Passphrase til certifikatet, hvis sådan et eksisterer.
3637

37-
3838
Se evt. Fasit Scultz dokumentationen for flere detaljer på opbygningen af endpoint url’er.
3939

40-
Det er desuden muligt at teste om os2forms kan få fat i certifikatet på samme konfigurations-side.
40+
Det er desuden muligt at teste om os2forms kan få fat i certifikatet på samme konfigurations-side.
4141

4242
## Handler
4343

modules/os2forms_forloeb/CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# OS2Forms Forløb Change Log
2+
23
All notable changes to this project should be documented in this file.
34

45
The format is based on [Keep a Changelog](http://keepachangelog.com/)
@@ -17,9 +18,11 @@ before starting to add changes.
1718
## 2.5.2 - 27.03.2023
1819

1920
### Updated
21+
2022
- Bumped drupal/ultimate_cron version fixing [Deprecated function: Implicit conversion from float-string](https://www.drupal.org/project/ultimate_cron/issues/3256142).
2123

2224
## 2.5.1 - 10.03.2023
25+
2326
- Added github action for checking changelog changes when creating pull requests
2427
- Added os2forms/os2forms dependency
2528
- Changed composer patching configuration
@@ -30,18 +33,20 @@ before starting to add changes.
3033
## 2.5.0 - 11.10.2022
3134

3235
### Added
36+
3337
- retry task controller action
3438
- Added support for inheriting values without creating a submission
3539

3640
## 2.4.0
3741

3842
### Added
43+
3944
- Github CI action for checking Drupal Coding standards with PHP Code Sniffer
4045
- Fixed coding standards issues
4146

42-
4347
## Example of change log record
44-
```
48+
49+
```markdown
4550
## [x.x.x] Release name
4651
### Added
4752
- Description on added functionality.

0 commit comments

Comments
 (0)