Skip to content

Re-lint YAML files #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ indent_size = 4

[*.{yml,yaml}]
indent_size = 2

# Symfony uses 4 spaces for indent
[config/**/*.{yml,yaml}]
indent_size = 4
2 changes: 1 addition & 1 deletion .github/workflows/yaml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
docker network create frontend

- run: |
docker compose run --rm prettier '.github/workflows/*.{yml,yaml}' 'config/**/*.{yml,yaml}' --check
docker compose run --rm prettier '**/*.{yml,yaml}' --check
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# API spec
public/spec.yaml
8 changes: 8 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# https://prettier.io/docs/configuration
overrides:
# Symfony config
- files:
- "config/**/*.{yml,yaml}"
options:
tabWidth: 4
singleQuote: true
2 changes: 1 addition & 1 deletion .woodpecker/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ steps:
from_secret: prod_path
user:
from_secret: user
playbook: 'release'
playbook: "release"
pre_up:
- itkdev-docker-compose-server run --rm phpfpm bin/console cache:clear
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ See [keep a changelog] for information about writing changes to this log.

## [Unreleased]

- [PR-23](https://github.com/itk-dev/event-database-api/pull/23)
Re-lint YAML files
- [PR-21](https://github.com/itk-dev/event-database-api/pull/21)
Linted YAML
- [PR-18](https://github.com/itk-dev/event-database-api/pull/18)
Expand Down
7 changes: 2 additions & 5 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ vars:
# https://taskfile.dev/reference/templating/
DOCKER_COMPOSE: '{{.TASK_DOCKER_COMPOSE | default "docker compose"}}'

# We're not yet ready to normalize config files …
YAML_FILES_GLOB: "'.github/workflows/*.{yml,yaml}' 'config/**/*.{yml,yaml}' Taskfile.yml phpstan.dist.neon"

tasks:
site:update:
desc: Update/install site
Expand Down Expand Up @@ -156,7 +153,7 @@ tasks:
cmds:
- task: compose
vars:
COMPOSE_ARGS: run --rm prettier --parser yaml {{.YAML_FILES_GLOB}} --write
COMPOSE_ARGS: run --rm prettier '**/*.{yml,yaml}' --write
silent: true

coding-standards:yaml:check:
Expand All @@ -165,7 +162,7 @@ tasks:
- task: coding-standards:yaml:apply
- task: compose
vars:
COMPOSE_ARGS: run --rm prettier --parser yaml {{.YAML_FILES_GLOB}} --check
COMPOSE_ARGS: run --rm prettier '**/*.{yml,yaml}' --check
silent: true

code-analysis:
Expand Down
114 changes: 57 additions & 57 deletions config/packages/api_platform.yaml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
api_platform:
title: "%env(OPENAPI_TITLE)%"
description: "%env(OPENAPI_DESCRIPTION)%"
version: 2.0.0
show_webby: false

openapi:
contact:
name: "%env(OPENAPI_CONTACT_NAME)%"
url: "%env(OPENAPI_CONTACT_URL)%"
email: "%env(OPENAPI_CONTACT_EMAIL)%"
termsOfService: "%env(OPENAPI_TERMS_OF_SERVICE)%"

formats:
jsonld: ["application/ld+json"]

docs_formats:
jsonld: ["application/ld+json"]
jsonopenapi: ["application/vnd.openapi+json"]
html: ["text/html"]

mapping:
paths:
- "%kernel.project_dir%/src/Api/Dto"

doctrine:
enabled: false

swagger:
api_keys:
ApiKeyAuth:
name: "X-Api-Key"
type: header

elasticsearch:
hosts: ["%env(INDEX_URL)%"]

defaults:
stateless: true
pagination_items_per_page: "%env(int:PAGINATION_ITEMS_PER_PAGE)%"
pagination_maximum_items_per_page: "%env(int:PAGINATION_MAXIMUM_ITEMS_PER_PAGE)%"
cache_headers:
max_age: 3600
shared_max_age: 3600
vary: ["Content-Type", "Authorization", "Origin"]
extra_properties:
# Note: The api-platform/core 3.4 recipe sets `standard_put` eventhough
# https://api-platform.com/docs/core/upgrade-guide/#api-platform-34
# (probably) tells us to remove it
# standard_put: true
# https://api-platform.com/docs/core/upgrade-guide/#api-platform-34
rfc_7807_compliant_errors: true
# Note: The api-platform/core 3.4 recipe wants `use_symfony_listeners` to be true
use_symfony_listeners: false

# https://api-platform.com/docs/core/upgrade-guide/#upgrade-guide
serializer:
hydra_prefix: true
title: '%env(OPENAPI_TITLE)%'
description: '%env(OPENAPI_DESCRIPTION)%'
version: 2.0.0
show_webby: false

openapi:
contact:
name: '%env(OPENAPI_CONTACT_NAME)%'
url: '%env(OPENAPI_CONTACT_URL)%'
email: '%env(OPENAPI_CONTACT_EMAIL)%'
termsOfService: '%env(OPENAPI_TERMS_OF_SERVICE)%'

formats:
jsonld: ['application/ld+json']

docs_formats:
jsonld: ['application/ld+json']
jsonopenapi: ['application/vnd.openapi+json']
html: ['text/html']

mapping:
paths:
- '%kernel.project_dir%/src/Api/Dto'

doctrine:
enabled: false

swagger:
api_keys:
ApiKeyAuth:
name: 'X-Api-Key'
type: header

elasticsearch:
hosts: ['%env(INDEX_URL)%']

defaults:
stateless: true
pagination_items_per_page: '%env(int:PAGINATION_ITEMS_PER_PAGE)%'
pagination_maximum_items_per_page: '%env(int:PAGINATION_MAXIMUM_ITEMS_PER_PAGE)%'
cache_headers:
max_age: 3600
shared_max_age: 3600
vary: ['Content-Type', 'Authorization', 'Origin']
extra_properties:
# Note: The api-platform/core 3.4 recipe sets `standard_put` eventhough
# https://api-platform.com/docs/core/upgrade-guide/#api-platform-34
# (probably) tells us to remove it
# standard_put: true
# https://api-platform.com/docs/core/upgrade-guide/#api-platform-34
rfc_7807_compliant_errors: true
# Note: The api-platform/core 3.4 recipe wants `use_symfony_listeners` to be true
use_symfony_listeners: false

# https://api-platform.com/docs/core/upgrade-guide/#upgrade-guide
serializer:
hydra_prefix: true
28 changes: 14 additions & 14 deletions config/packages/cache.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
framework:
cache:
# Unique name of your app: used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name
cache:
# Unique name of your app: used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name

# The "app" cache stores to the filesystem by default.
# The data in this cache should persist between deploys.
# Other options include:
# The "app" cache stores to the filesystem by default.
# The data in this cache should persist between deploys.
# Other options include:

# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost
# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost

# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu

# Namespaced pools use the above "app" backend by default
#pools:
#my.dedicated.cache: null
# Namespaced pools use the above "app" backend by default
#pools:
#my.dedicated.cache: null
40 changes: 20 additions & 20 deletions config/packages/framework.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# see https://symfony.com/doc/current/reference/configuration/framework.html
framework:
secret: "%env(APP_SECRET)%"
annotations: false
http_method_override: false
handle_all_throwables: true
secret: '%env(APP_SECRET)%'
annotations: false
http_method_override: false
handle_all_throwables: true

# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
handler_id: null
cookie_secure: auto
cookie_samesite: lax
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
handler_id: null
cookie_secure: auto
cookie_samesite: lax

#esi: true
#fragments: true
php_errors:
log: true
#esi: true
#fragments: true
php_errors:
log: true

assets:
base_path: "%env(APP_PATH_PREFIX)%"
assets:
base_path: '%env(APP_PATH_PREFIX)%'

when@test:
framework:
test: true
session:
storage_factory_id: session.storage.factory.mock_file
framework:
test: true
session:
storage_factory_id: session.storage.factory.mock_file
16 changes: 8 additions & 8 deletions config/packages/http_discovery.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
services:
Psr\Http\Message\RequestFactoryInterface: "@http_discovery.psr17_factory"
Psr\Http\Message\ResponseFactoryInterface: "@http_discovery.psr17_factory"
Psr\Http\Message\ServerRequestFactoryInterface: "@http_discovery.psr17_factory"
Psr\Http\Message\StreamFactoryInterface: "@http_discovery.psr17_factory"
Psr\Http\Message\UploadedFileFactoryInterface: "@http_discovery.psr17_factory"
Psr\Http\Message\UriFactoryInterface: "@http_discovery.psr17_factory"
Psr\Http\Message\RequestFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\ResponseFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\ServerRequestFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\StreamFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\UploadedFileFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\UriFactoryInterface: '@http_discovery.psr17_factory'

http_discovery.psr17_factory:
class: Http\Discovery\Psr17Factory
http_discovery.psr17_factory:
class: Http\Discovery\Psr17Factory
18 changes: 9 additions & 9 deletions config/packages/nelmio_cors.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
nelmio_cors:
defaults:
origin_regex: true
allow_origin: ["%env(CORS_ALLOW_ORIGIN)%"]
allow_methods: ["GET", "OPTIONS"]
allow_headers: ["Content-Type", "X-Api-Key"]
expose_headers: ["Link"]
max_age: 3600
paths:
"^/": null
defaults:
origin_regex: true
allow_origin: ['%env(CORS_ALLOW_ORIGIN)%']
allow_methods: ['GET', 'OPTIONS']
allow_headers: ['Content-Type', 'X-Api-Key']
expose_headers: ['Link']
max_age: 3600
paths:
'^/': null
16 changes: 8 additions & 8 deletions config/packages/routing.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
framework:
router:
utf8: true
router:
utf8: true

# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost

when@prod:
framework:
router:
strict_requirements: null
framework:
router:
strict_requirements: null
Loading