Skip to content

Commit

Permalink
Cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
rimi-itk committed May 1, 2024
1 parent 0d4cc49 commit fc90fbe
Show file tree
Hide file tree
Showing 23 changed files with 183 additions and 181 deletions.
31 changes: 10 additions & 21 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
composer validate --strict composer.json
# Check that dependencies resolve.
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Check that composer file is normalized
run: |
composer normalize --dry-run
php-coding-standards:
name: PHP coding standards
Expand Down Expand Up @@ -111,27 +114,13 @@ jobs:
run: |
./scripts/code-analysis
markdownlint:
coding-standards-markdown:
name: Markdown coding standards
runs-on: ubuntu-latest
name: markdownlint
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn packages
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn install
uses: actions/setup-node@v2
with:
node-version: '20'
- run: yarn install
- name: markdownlint
run: yarn coding-standards-check/markdownlint
uses: actions/checkout@master

- name: Coding standards
run: |
docker run --rm --volume $PWD:/md peterdavehello/markdownlint markdownlint --ignore vendor --ignore LICENSE.md '**/*.md'
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
composer.lock
vendor

node_modules/
yarn.lock
13 changes: 13 additions & 0 deletions .markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"default": true,
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md
"line-length": {
"line_length": 120,
"code_blocks": false,
"tables": false
},
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md
"no-duplicate-heading": {
"siblings_only": true
}
}
18 changes: 0 additions & 18 deletions .markdownlintrc

This file was deleted.

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa

## [Unreleased]

- [#101](https://github.com/OS2Forms/os2forms/pull/101)
Added support for os2web_key
- Adding Lat and Long fetching to DataAddress
- [#84](https://github.com/OS2Forms/os2forms/pull/84)
Added digital post test command.
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,19 @@ docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm composer c
### Markdown

```sh
docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn install
docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn coding-standards-check/markdownlint

# Fix (some) coding standards issues.
docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn coding-standards-apply/markdownlint
docker run --rm --volume $PWD:/md peterdavehello/markdownlint markdownlint --ignore vendor --ignore LICENSE.md '**/*.md' --fix
docker run --rm --volume $PWD:/md peterdavehello/markdownlint markdownlint --ignore vendor --ignore LICENSE.md '**/*.md'
```

## Code analysis

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

Running statis code analysis on a standalone Drupal module is a bit tricky, so
we use a helper script to run the analysis:
Running statis code analysis on a standalone Drupal module is a bit tricky, so we use a helper script to run the
analysis:

```sh
./scripts/code-analysis
```shell
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm ./scripts/code-analysis
```

**Note**: Currently the code analysis is only run on the `os2forms_digital_post` sub-module (cf. [`phpstan.neon`](./phpstan.neon)).
102 changes: 52 additions & 50 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
{
"name": "os2forms/os2forms",
"type": "drupal-module",
"description": "Drupal 8 OS2Form module provides advanced webform functionality for Danish Municipalities",
"minimum-stability": "dev",
"prefer-stable": true,
"license": "EUPL-1.2",
"repositories": {
"os2web/os2web_key": {
"type": "vcs",
"url": "https://github.com/rimi-itk/os2web_key"
},
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8"
},
"assets": {
"type": "composer",
"url": "https://asset-packagist.org"
}
},
"type": "drupal-module",
"require": {
"php": "^8.1",
"ext-dom": "*",
Expand Down Expand Up @@ -51,7 +35,7 @@
"drupal/mailsystem": "^4.1",
"drupal/masquerade": "^2.0@RC",
"drupal/pathauto": "^1.5",
"drupal/permissions_by_term": "^3.1 || ^2.25",
"drupal/permissions_by_term": "^2.25 || ^3.1",
"drupal/queue_mail": "^1.4",
"drupal/queue_ui": "^2.1",
"drupal/r4032login": "^2.1",
Expand Down Expand Up @@ -79,12 +63,12 @@
"itk-dev/beskedfordeler-drupal": "^1.0",
"itk-dev/serviceplatformen": "dev-feature/guzzle6-adapter as 1.5",
"os2web/os2web_datalookup": "^1.5",
"os2web/os2web_nemlogin": "^1.0",
"os2web/os2web_key": "dev-os2web_key",
"os2web/os2web_nemlogin": "^1.0",
"php-http/guzzle6-adapter": "^2.0",
"phpoffice/phpword": "^0.18.2",
"symfony/options-resolver": "^5.4 || ^6.0",
"tecnickcom/tcpdf": "~6",
"tecnickcom/tcpdf": "^6",
"webmozart/path-util": "^2.3",
"wsdltophp/packagebase": "^5.0",
"zaporylie/composer-drupal-optimizations": "^1.2"
Expand All @@ -93,62 +77,80 @@
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"drupal/coder": "^8.3",
"drupal/maillog": "^1.0",
"ergebnis/composer-normalize": "^2.42",
"mglaman/phpstan-drupal": "^1.1",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpunit/phpunit": "^9.5",
"wsdltophp/packagegenerator": "^4.0"
},
"extra" : {
"repositories": {
"os2web/os2web_key": {
"type": "vcs",
"url": "https://github.com/itk-dev/os2web_key"
},
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8"
},
"assets": {
"type": "composer",
"url": "https://asset-packagist.org"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"ergebnis/composer-normalize": true,
"phpstan/extension-installer": true,
"simplesamlphp/composer-module-installer": true,
"vaimo/composer-patches": true,
"zaporylie/composer-drupal-optimizations": true
},
"sort-packages": true
},
"extra": {
"composer-exit-on-patch-failure": false,
"enable-patching" : true,
"enable-patching": true,
"patches": {
"drupal/coc_forms_auto_export": {
"3240592 - Problem with phpseclib requirement in 2.x (https://www.drupal.org/project/coc_forms_auto_export/issues/3240592)": "https://www.drupal.org/files/issues/2021-10-04/requirement-namespace-3240592-1.patch"
},
"drupal/dynamic_entity_reference": {
"entityQuery reference JOINs should specify target_type (https://www.drupal.org/project/dynamic_entity_reference/issues/3120952#comment-14141038)": "https://www.drupal.org/files/issues/2021-06-22/entityquery-reference-joins-should-specify-target_type-3120952-24.patch"
},
"drupal/entity_print": {
"2733781 - Add Export to Word Support": "https://www.drupal.org/files/issues/2019-11-22/2733781-47.patch"
},
"drupal/webform": {
"Unlock possibility of using Entity print module export to Word": "https://www.drupal.org/files/issues/2020-02-29/3096552-6.patch"
},
"drupal/user_default_page": {
"Warning: in_array() expects parameter 2 to be array, null given in user_default_page_user_logout() (https://www.drupal.org/node/3246986)": "https://www.drupal.org/files/issues/2021-11-01/user_default_page-3246986-2.patch"
},
"drupal/coc_forms_auto_export": {
"3240592 - Problem with phpseclib requirement in 2.x (https://www.drupal.org/project/coc_forms_auto_export/issues/3240592)": "https://www.drupal.org/files/issues/2021-10-04/requirement-namespace-3240592-1.patch"
},
"drupal/dynamic_entity_reference": {
"entityQuery reference JOINs should specify target_type (https://www.drupal.org/project/dynamic_entity_reference/issues/3120952#comment-14141038)": "https://www.drupal.org/files/issues/2021-06-22/entityquery-reference-joins-should-specify-target_type-3120952-24.patch"
"drupal/webform": {
"Unlock possibility of using Entity print module export to Word": "https://www.drupal.org/files/issues/2020-02-29/3096552-6.patch"
}
}
},
"scripts": {
"code-analysis/phpstan": [
"phpstan analyse"
],
"code-analysis": [
"@code-analysis/phpstan"
],
"coding-standards-check/phpcs": [
"phpcs --standard=phpcs.xml.dist"
"code-analysis/phpstan": [
"phpstan analyse"
],
"coding-standards-check": [
"@coding-standards-check/phpcs"
"coding-standards-apply": [
"@coding-standards-apply/phpcs"
],
"coding-standards-apply/phpcs": [
"phpcbf --standard=phpcs.xml.dist"
],
"coding-standards-apply": [
"@coding-standards-apply/phpcs"
"coding-standards-check": [
"@coding-standards-check/phpcs"
],
"coding-standards-check/phpcs": [
"phpcs --standard=phpcs.xml.dist"
]
},
"config": {
"sort-packages": true,
"allow-plugins": {
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true,
"simplesamlphp/composer-module-installer": true,
"vaimo/composer-patches": true,
"zaporylie/composer-drupal-optimizations": true
}
}
}
12 changes: 7 additions & 5 deletions modules/os2forms_attachment/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# OS2Forms Attachment Drupal module

# Module purpose
## Module purpose

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

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

# How does it work
## How does it work

To add custom headers/footer ```admin/structure/webform/config/os2forms_attachment_component```
To add custom headers/footer `admin/structure/webform/config/os2forms_attachment_component`

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

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```
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`
9 changes: 5 additions & 4 deletions modules/os2forms_autocomplete/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# OS2Forms Autocomplete Drupal module

# Module purpose
## Module purpose

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

# How does it work
## How does it work

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

Build page:

```
```url
admin/structure/webform/manage/[webform]
```
3 changes: 1 addition & 2 deletions modules/os2forms_consent/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# OS2forms Consent Drupal module

## Module purpose

The aim of this module is to provide integration consent provider.

## How does it work


7 changes: 4 additions & 3 deletions modules/os2forms_dawa/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# OS2Forms DAWA Drupal module

# Module purpose
## Module purpose

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

# How does it work
## How does it work

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

Expand Down
Loading

0 comments on commit fc90fbe

Please sign in to comment.