Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{js,scss,yaml}]
[*.{js,scss}]
indent_size = 2
9 changes: 9 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,15 @@ jobs:
- name: markdownlint
run: yarn check-coding-standards/markdownlint

yamllint:
name: yamllint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: yamllint
run: docker run --rm --volume $(pwd):/data cytopia/yamllint -f github .

translations:
runs-on: ubuntu-20.04
strategy:
Expand Down
33 changes: 33 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# @see https://yamllint.readthedocs.io/en/stable/configuration.html#extending-the-default-configuration
extends: default

ignore:
- .docker/
- .github/
- node_modules/
- vendor/
- 'docker-compose*.yml'

rules:
# @see https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.braces
braces:
min-spaces-inside: 1
max-spaces-inside: 1
# @see https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.brackets
brackets:
min-spaces-inside: 0
max-spaces-inside: 1
# @see https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.comments
comments:
min-spaces-from-content: 1
require-starting-space: false
# @see https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.document_start
document-start:
present: false
# @see https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.indentation
indentation:
spaces: 4
# 80 chars should be enough, but don't fail if a line is longer
line-length:
max: 160
level: warning
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ about writing changes to this log.

## [Unreleased]

- Added YAML linting.

## [1.1.2] 2023-02-17

- [SUPP0RT-874](https://jira.itkdev.dk/browse/SUPP0RT-874)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,12 @@ we decided to adhere to in this project.
docker run -v ${PWD}:/app itkdev/yarn:latest markdownlint README.md
```

* YAML

```sh
docker run --rm --volume $(pwd):/data cytopia/yamllint config
```

## Code analysis

We use [PHPStan](https://phpstan.org/) and [Psalm](https://psalm.dev/) for code
Expand Down
14 changes: 7 additions & 7 deletions config/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# app/config/config.yml
twig:
form_themes:
- LexikFormFilterBundle:Form:form_div_layout.html.twig
form_themes:
- LexikFormFilterBundle:Form:form_div_layout.html.twig

lexik_form_filter:
listeners:
doctrine_orm: true
doctrine_dbal: false
doctrine_mongodb: false
where_method: ~ # null | and | or
listeners:
doctrine_orm: true
doctrine_dbal: false
doctrine_mongodb: false
where_method: ~ # null | and | or
8 changes: 4 additions & 4 deletions config/packages/dev/security.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
security:
firewalls:
main:
custom_authenticators:
- App\Security\MasqueradeAuthenticator
firewalls:
main:
custom_authenticators:
- App\Security\MasqueradeAuthenticator
6 changes: 3 additions & 3 deletions config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ doctrine:
prefix: 'App\Monolog'
alias: Log
filters:
case_deleted_filter:
class: App\Doctrine\CaseDeletedFilter
enabled: true
case_deleted_filter:
class: App\Doctrine\CaseDeletedFilter
enabled: true
2 changes: 1 addition & 1 deletion config/packages/fos_ckeditor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ fos_ck_editor:
editor:
- ['Bold', 'Italic', 'Underline', 'StrikeThrough']
- ['BulletedList', 'NumberedList']
- ['Outdent', 'Indent', 'TextColor']
- ['Outdent', 'Indent', 'TextColor']
34 changes: 17 additions & 17 deletions config/packages/itkdev_openid_connect.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
itkdev_openid_connect:
cache_options:
cache_pool: 'cache.app' # Cache item pool for caching discovery document and CLI login tokens
cli_login_options:
cli_redirect: '%env(CLI_REDIRECT)%' # Redirect route for CLI login
openid_providers:
admin:
options:
metadata_url: '%env(ADMIN_OIDC_METADATA_URL)%'
client_id: '%env(ADMIN_OIDC_CLIENT_ID)%'
client_secret: '%env(ADMIN_OIDC_CLIENT_SECRET)%'
redirect_route: 'default'
cache_options:
cache_pool: 'cache.app' # Cache item pool for caching discovery document and CLI login tokens
cli_login_options:
cli_redirect: '%env(CLI_REDIRECT)%' # Redirect route for CLI login
openid_providers:
admin:
options:
metadata_url: '%env(ADMIN_OIDC_METADATA_URL)%'
client_id: '%env(ADMIN_OIDC_CLIENT_ID)%'
client_secret: '%env(ADMIN_OIDC_CLIENT_SECRET)%'
redirect_route: 'default'

board-member:
options:
metadata_url: '%env(BOARD_MEMBER_OIDC_METADATA_URL)%'
client_id: '%env(BOARD_MEMBER_OIDC_CLIENT_ID)%'
client_secret: '%env(BOARD_MEMBER_OIDC_CLIENT_SECRET)%'
redirect_route: 'default'
board-member:
options:
metadata_url: '%env(BOARD_MEMBER_OIDC_METADATA_URL)%'
client_id: '%env(BOARD_MEMBER_OIDC_CLIENT_ID)%'
client_secret: '%env(BOARD_MEMBER_OIDC_CLIENT_SECRET)%'
redirect_route: 'default'
24 changes: 12 additions & 12 deletions config/packages/knp_paginator.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
knp_paginator:
page_range: 5 # number of links showed in the pagination menu (e.g: you have 10 pages, a page_range of 3, on the 5th page you'll see links to page 4, 5, 6)
default_options:
page_name: page # page query parameter name
sort_field_name: sort # sort field query parameter name
sort_direction_name: direction # sort direction query parameter name
distinct: true # ensure distinct results, useful when ORM queries are using GROUP BY statements
filter_field_name: filterField # filter field query parameter name
filter_value_name: filterValue # filter value query parameter name
template:
pagination: '@KnpPaginator/Pagination/twitter_bootstrap_v4_pagination.html.twig' # sliding pagination controls template
sortable: '@KnpPaginator/Pagination/twitter_bootstrap_v4_font_awesome_sortable_link.html.twig' # sort link template
filtration: '@KnpPaginator/Pagination/filtration.html.twig' # filters template
page_range: 5 # number of links showed in the pagination menu (e.g: you have 10 pages, a page_range of 3, on the 5th page you'll see links to page 4, 5, 6)
default_options:
page_name: page # page query parameter name
sort_field_name: sort # sort field query parameter name
sort_direction_name: direction # sort direction query parameter name
distinct: true # ensure distinct results, useful when ORM queries are using GROUP BY statements
filter_field_name: filterField # filter field query parameter name
filter_value_name: filterValue # filter value query parameter name
template:
pagination: '@KnpPaginator/Pagination/twitter_bootstrap_v4_pagination.html.twig' # sliding pagination controls template
sortable: '@KnpPaginator/Pagination/twitter_bootstrap_v4_font_awesome_sortable_link.html.twig' # sort link template
filtration: '@KnpPaginator/Pagination/filtration.html.twig' # filters template
14 changes: 7 additions & 7 deletions config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ security:
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
- { path: ^/api/os2forms/submission, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/api/complaint-categories, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/openidconnect/login(/.+)?$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin, roles: [ROLE_CASEWORKER, ROLE_ADMINISTRATION] }
- { path: ^/, roles: [ROLE_USER] }
# - { path: ^/profile, roles: ROLE_USER }
- { path: '^/api/os2forms/submission', role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: '^/api/complaint-categories', role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: '^/openidconnect/login(/.+)?$', role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: '^/login$', role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: '^/admin', roles: [ROLE_CASEWORKER, ROLE_ADMINISTRATION] }
- { path: '^/', roles: [ROLE_USER] }
# - { path: '^/profile', roles: ROLE_USER }
10 changes: 5 additions & 5 deletions config/packages/stof_doctrine_extensions.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Read the documentation: https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/index.html
# See the official DoctrineExtensions documentation for more details: https://github.com/doctrine-extensions/DoctrineExtensions/tree/main/doc
stof_doctrine_extensions:
default_locale: en_US
orm:
default:
blameable: true
timestampable: true
default_locale: en_US
orm:
default:
blameable: true
timestampable: true
12 changes: 6 additions & 6 deletions config/packages/twig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ twig:
form_themes: ['bootstrap_4_layout.html.twig', 'form/theme.html.twig']

date:
format: 'd/m/Y H:i'
# By default translate all datetimes to Copenhagen timezone.
# Exceptions are agenda & agenda items start/end time.
# @see e.g. templates/agenda/index.html.twig
# @see https://twig.symfony.com/doc/2.x/filters/date.html#timezone
timezone: Europe/Copenhagen
format: 'd/m/Y H:i'
# By default translate all datetimes to Copenhagen timezone.
# Exceptions are agenda & agenda items start/end time.
# @see e.g. templates/agenda/index.html.twig
# @see https://twig.symfony.com/doc/2.x/filters/date.html#timezone
timezone: Europe/Copenhagen
4 changes: 2 additions & 2 deletions config/routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

# OpenID Connect redirect URI route (cf. packages/itkdev_openid_connect.yaml)
authenticate-board-member:
# @todo Update the path when we get a proper OIDC setup.
path: /os2forms_nemlogin_openid_connect/authenticate
# @todo Update the path when we get a proper OIDC setup.
path: /os2forms_nemlogin_openid_connect/authenticate
4 changes: 2 additions & 2 deletions config/routes/itkdev_openid_connect.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
itkdev_openid_connect:
resource: "@ItkDevOpenIdConnectBundle/src/Resources/config/routes.yaml"
prefix: "/openidconnect" # Prefix for bundle routes
resource: "@ItkDevOpenIdConnectBundle/src/Resources/config/routes.yaml"
prefix: "/openidconnect" # Prefix for bundle routes
62 changes: 31 additions & 31 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ services:
entity_class_names:
- App\Entity\HearingPost
agenda_inspection:
label: Agenda inspection
entity_class_names:
- App\Entity\InspectionLetter
label: Agenda inspection
entity_class_names:
- App\Entity\InspectionLetter
agenda_broadcast:
label: Agenda broadcast
entity_class_names:
- App\Entity\AgendaBroadcast
- App\Entity\AgendaBroadcast
board_receipt_case:
label: Board receipt (case)
entity_class_names:
Expand Down Expand Up @@ -139,33 +139,33 @@ services:
App\Service\DigitalPostHelper:
arguments:
$options:
digital_post_options:
digital_post_system_id: '%env(DIGITAL_POST_SYSTEM_ID)%'
digital_post_afsender_system: '%env(DIGITAL_POST_AFSENDER_SYSTEM)%'
digital_post_options:
digital_post_system_id: '%env(DIGITAL_POST_SYSTEM_ID)%'
digital_post_afsender_system: '%env(DIGITAL_POST_AFSENDER_SYSTEM)%'

digital_post_materiale_id: '%env(DIGITAL_POST_MATERIALE_ID)%'
digital_post_materiale_id: '%env(DIGITAL_POST_MATERIALE_ID)%'

digital_post_forsendelses_type: '%env(DIGITAL_POST_FORSENDELSES_TYPE)%'
digital_post_forsendelses_type: '%env(DIGITAL_POST_FORSENDELSES_TYPE)%'

azure_tenant_id: '%env(AZURE_TENANT_ID)%'
azure_application_id: '%env(AZURE_APPLICATION_ID)%'
azure_client_secret: '%env(AZURE_CLIENT_SECRET)%'
azure_tenant_id: '%env(AZURE_TENANT_ID)%'
azure_application_id: '%env(AZURE_APPLICATION_ID)%'
azure_client_secret: '%env(AZURE_CLIENT_SECRET)%'

azure_key_vault_name: '%env(AZURE_KEY_VAULT_NAME)%'
azure_key_vault_secret: '%env(AZURE_KEY_VAULT_SECRET)%'
azure_key_vault_secret_version: '%env(AZURE_KEY_VAULT_SECRET_VERSION)%'
azure_key_vault_name: '%env(AZURE_KEY_VAULT_NAME)%'
azure_key_vault_secret: '%env(AZURE_KEY_VAULT_SECRET)%'
azure_key_vault_secret_version: '%env(AZURE_KEY_VAULT_SECRET_VERSION)%'

service_agreement_uuid: '%env(SERVICE_AGREEMENT_UUID)%'
user_system_uuid: '%env(USER_SYSTEM_UUID)%'
user_uuid: '%env(USER_UUID)%'
service_agreement_uuid: '%env(SERVICE_AGREEMENT_UUID)%'
user_system_uuid: '%env(USER_SYSTEM_UUID)%'
user_uuid: '%env(USER_UUID)%'

service_uuid: '%env(SERVICE_UUID)%'
service_endpoint: '%env(SERVICE_ENDPOINT)%'
service_contract: '%env(resolve:SERVICE_CONTRACT)%'
service_uuid: '%env(SERVICE_UUID)%'
service_endpoint: '%env(SERVICE_ENDPOINT)%'
service_contract: '%env(resolve:SERVICE_CONTRACT)%'

restriction_options:
number_of_attachments_allowed: '%env(NUMBER_OF_ATTACHMENTS_ALLOWED)%'
total_filesize_allowed: '%env(TOTAL_FILESIZE_ALLOWED)%'
restriction_options:
number_of_attachments_allowed: '%env(NUMBER_OF_ATTACHMENTS_ALLOWED)%'
total_filesize_allowed: '%env(TOTAL_FILESIZE_ALLOWED)%'

# Setting level in config/packages/monolog.yaml does not work as expected
# (cf. https://github.com/symfony/monolog-bundle/issues/322)
Expand Down Expand Up @@ -199,15 +199,15 @@ services:
App\Service\CvrHelper:
arguments:
$options:
azure_tenant_id: '%env(AZURE_TENANT_ID)%'
azure_application_id: '%env(AZURE_APPLICATION_ID)%'
azure_client_secret: '%env(AZURE_CLIENT_SECRET)%'
azure_tenant_id: '%env(AZURE_TENANT_ID)%'
azure_application_id: '%env(AZURE_APPLICATION_ID)%'
azure_client_secret: '%env(AZURE_CLIENT_SECRET)%'

azure_key_vault_name: '%env(AZURE_KEY_VAULT_DATAFORDELER_NAME)%'
azure_key_vault_datafordeler_secret: '%env(AZURE_KEY_VAULT_DATAFORDELER_SECRET)%'
azure_key_vault_datafordeler_secret_version: '%env(AZURE_KEY_VAULT_DATAFORDELER_SECRET_VERSION)%'
azure_key_vault_name: '%env(AZURE_KEY_VAULT_DATAFORDELER_NAME)%'
azure_key_vault_datafordeler_secret: '%env(AZURE_KEY_VAULT_DATAFORDELER_SECRET)%'
azure_key_vault_datafordeler_secret_version: '%env(AZURE_KEY_VAULT_DATAFORDELER_SECRET_VERSION)%'

datafordeler_cvr_lookup_base_url: '%env(DATAFORDELER_CVR_LOOKUP_BASE_URL)%'
datafordeler_cvr_lookup_base_url: '%env(DATAFORDELER_CVR_LOOKUP_BASE_URL)%'

App\Service\MailTemplate\ComplexMacroHelper:
arguments:
Expand Down
Loading