Skip to content

Commit

Permalink
Use Prettier to format YAML
Browse files Browse the repository at this point in the history
Added formatting of YAML files to Prettier, formatted comments in YAML files so that they end up in the correct indentation and changed YAML files that are formatted with an indent of 2 space to 4

Fix #8805
  • Loading branch information
Fydon committed Feb 18, 2019
1 parent 96bcd78 commit f061aa7
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 53 deletions.
4 changes: 2 additions & 2 deletions generators/client/templates/angular/package.json.ejs
Expand Up @@ -157,14 +157,14 @@
},
<%_ if (!skipCommitHook) { _%>
"lint-staged": {
"{,src/**/}*.{md,json,ts,css,scss}": [
"{,src/**/}*.{md,json,ts,css,scss,yml}": [
"prettier --write",
"git add"
]
},
<%_ } _%>
"scripts": {
"prettier:format": "prettier --write \"{,src/**/}*.{md,json,ts,css,scss}\"",
"prettier:format": "prettier --write \"{,src/**/}*.{md,json,ts,css,scss,yml}\"",
"lint": "tslint --project tsconfig.json -e 'node_modules/**'",
"lint:fix": "<%= clientPackageManager %> run lint <%= optionsForwarder %>--fix",
"ngc": "ngc -p tsconfig-aot.json",
Expand Down
4 changes: 2 additions & 2 deletions generators/client/templates/react/package.json.ejs
Expand Up @@ -178,14 +178,14 @@ limitations under the License.
},
<%_ if (!skipCommitHook) { _%>
"lint-staged": {
"{,src/**/}*.{md,json,ts,tsx,css,scss}": [
"{,src/**/}*.{md,json,ts,tsx,css,scss,yml}": [
"prettier --write",
"git add"
]
},
<%_ } _%>
"scripts": {
"prettier:format": "prettier --write \"{,src/**/}*.{md,json,ts,tsx,css,scss}\"",
"prettier:format": "prettier --write \"{,src/**/}*.{md,json,ts,tsx,css,scss,yml}\"",
"lint": "tslint --project tsconfig.json -e 'node_modules/**'",
"lint:fix": "<%= clientPackageManager %> run lint <%= optionsForwarder %>--fix",
"cleanup": "rimraf <%= DIST_DIR %>",
Expand Down
2 changes: 1 addition & 1 deletion generators/generator-base-private.js
Expand Up @@ -1301,7 +1301,7 @@ module.exports = class extends Generator {
*/
registerPrettierTransform(generator = this) {
// Prettier is clever, it uses correct rules and correct parser according to file extension.
const prettierFilter = filter(['{,src/**/}*.{md,json,ts,tsx,scss,css}'], { restore: true });
const prettierFilter = filter(['{,src/**/}*.{md,json,ts,tsx,scss,css,yml}'], { restore: true });
// this pipe will pass through (restore) anything that doesn't match typescriptFilter
generator.registerTransformStream([prettierFilter, prettierTransform(prettierOptions), prettierFilter.restore]);
}
Expand Down
8 changes: 4 additions & 4 deletions generators/server/templates/src/main/docker/app.yml.ejs
Expand Up @@ -201,10 +201,10 @@ services:
- INIT_SLEEP_SECONDS=5
- CONSUL_URL=consul
- CONSUL_PORT=8500
# Uncomment to load configuration into Consul from a Git repository
# as configured in central-server-config/git2consul.json
# Also set SPRING_CLOUD_CONSUL_CONFIG_FORMAT=files on your apps
# - CONFIG_MODE=git
# Uncomment to load configuration into Consul from a Git repository
# as configured in central-server-config/git2consul.json
# Also set SPRING_CLOUD_CONSUL_CONFIG_FORMAT=files on your apps
# - CONFIG_MODE=git
<%_ } _%>
<%_ if (authenticationType === 'oauth2' && applicationType !== 'microservice') { _%>
keycloak:
Expand Down
4 changes: 2 additions & 2 deletions generators/server/templates/src/main/docker/couchbase.yml.ejs
Expand Up @@ -11,5 +11,5 @@ services:
- 11210:11210
environment:
- BUCKET=<%= baseName %>
# volumes:
# - ~/volumes/jhipster/<%= baseName.toLowerCase() %>/couchbase/:/opt/couchbase/var
# volumes:
# - ~/volumes/jhipster/<%= baseName.toLowerCase() %>/couchbase/:/opt/couchbase/var
2 changes: 1 addition & 1 deletion generators/server/templates/src/main/docker/kafka.yml.ejs
Expand Up @@ -21,7 +21,7 @@ services:
zookeeper:
image: <%= DOCKER_ZOOKEEPER %>
ports:
- 2181:2181
- 2181:2181
kafka:
image: <%= DOCKER_KAFKA %>
environment:
Expand Down
26 changes: 13 additions & 13 deletions generators/server/templates/src/main/docker/keycloak.yml.ejs
Expand Up @@ -18,16 +18,16 @@
-%>
version: '2'
services:
keycloak:
image: <%= DOCKER_KEYCLOAK %>
command: ["-b", "0.0.0.0", "-Dkeycloak.migration.action=import", "-Dkeycloak.migration.provider=dir", "-Dkeycloak.migration.dir=/opt/jboss/keycloak/realm-config", "-Dkeycloak.migration.strategy=OVERWRITE_EXISTING", "-Djboss.socket.binding.port-offset=1000"]
volumes:
- ./realm-config:/opt/jboss/keycloak/realm-config
environment:
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=admin
- DB_VENDOR=h2
ports:
- 9080:9080
- 9443:9443
- 10990:10990
keycloak:
image: <%= DOCKER_KEYCLOAK %>
command: ["-b", "0.0.0.0", "-Dkeycloak.migration.action=import", "-Dkeycloak.migration.provider=dir", "-Dkeycloak.migration.dir=/opt/jboss/keycloak/realm-config", "-Dkeycloak.migration.strategy=OVERWRITE_EXISTING", "-Djboss.socket.binding.port-offset=1000"]
volumes:
- ./realm-config:/opt/jboss/keycloak/realm-config
environment:
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=admin
- DB_VENDOR=h2
ports:
- 9080:9080
- 9443:9443
- 10990:10990
Expand Up @@ -315,12 +315,12 @@ jhipster:
# CORS is disabled by default on microservices, as you should access them through a gateway.
# If you want to enable it, please uncomment the configuration below.
# cors:
# allowed-origins: "*"
# allowed-methods: "*"
# allowed-headers: "*"
# exposed-headers: "Authorization,Link,X-Total-Count"
# allow-credentials: true
# max-age: 1800
# allowed-origins: "*"
# allowed-methods: "*"
# allowed-headers: "*"
# exposed-headers: "Authorization,Link,X-Total-Count"
# allow-credentials: true
# max-age: 1800
<%_ } _%>
<%_ if (authenticationType === 'jwt') { _%>
security:
Expand Down
Expand Up @@ -88,11 +88,11 @@ hystrix:
feign:
hystrix:
enabled: true
# client:
# config:
# default:
# connectTimeout: 5000
# readTimeout: 5000
# client:
# config:
# default:
# connectTimeout: 5000
# readTimeout: 5000

# See https://github.com/Netflix/Hystrix/wiki/Configuration
hystrix:
Expand All @@ -101,9 +101,9 @@ hystrix:
execution:
isolation:
strategy: SEMAPHORE
# See https://github.com/spring-cloud/spring-cloud-netflix/issues/1330
# thread:
# timeoutInMilliseconds: 10000
# See https://github.com/spring-cloud/spring-cloud-netflix/issues/1330
# thread:
# timeoutInMilliseconds: 10000
shareSecurityContext: true

<%_ } _%>
Expand Down Expand Up @@ -288,17 +288,17 @@ info:

jhipster:
# By default CORS is disabled. Uncomment to enable.
#cors:
#allowed-origins: "*"
#allowed-methods: "*"
#allowed-headers: "*"
<%_ if (authenticationType === 'session') { _%>
#exposed-headers: "Link,X-Total-Count"
<%_ } else { _%>
#exposed-headers: "Authorization,Link,X-Total-Count"
<%_ } _%>
#allow-credentials: true
#max-age: 1800
# cors:
# allowed-origins: "*"
# allowed-methods: "*"
# allowed-headers: "*"
<%_ if (authenticationType === 'session') { _%>
# exposed-headers: "Link,X-Total-Count"
<%_ } else { _%>
# exposed-headers: "Authorization,Link,X-Total-Count"
<%_ } _%>
# allow-credentials: true
# max-age: 1800
mail:
from: <%= baseName %>@localhost
swagger:
Expand Down
Expand Up @@ -20,6 +20,6 @@
# This file will be used at compile time to generate Spring-MVC endpoint stubs using openapi-generator
openapi: "3.0.1"
info:
title: "<%= baseName %>"
version: 0.0.1
title: "<%= baseName %>"
version: 0.0.1
paths: {}
Expand Up @@ -141,7 +141,7 @@ spring:
<%_ if (authenticationType === 'oauth2') { _%>
security:
oauth2:
# client configuration needed : for condition in Spring Boot
# client configuration needed : for condition in Spring Boot
client:
access-token-uri: http://DO_NOT_CALL:9080/auth/realms/jhipster/protocol/openid-connect/token
user-authorization-uri: http://DO_NOT_CALL:9080/auth/realms/jhipster/protocol/openid-connect/auth
Expand Down

0 comments on commit f061aa7

Please sign in to comment.