Skip to content

Commit 901dace

Browse files
author
Gonzalo Diaz
committed
[CONFIG] [Docker] [make] New config file for yamllint tool
1 parent 77faa61 commit 901dace

File tree

5 files changed

+41
-11
lines changed

5 files changed

+41
-11
lines changed

.yamlignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.trunk/*

.yamllint

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
extends: default
3+
4+
ignore-from-file: .yamlignore
5+
6+
rules:
7+
comments:
8+
min-spaces-from-content: 1
9+
10+
# yamllint disable rule:line-length
11+
#
12+
# References:
13+
# False positive: interpreting GitHub actions "on:" as a truthy value #430
14+
# https://github.com/adrienverge/yamllint/issues/430
15+
#
16+
# YAML formatting not compliant with yamllint "spaces before comments" requirement #433
17+
# https://github.com/redhat-developer/vscode-yaml/issues/433#issuecomment-1235681987
18+
#
19+
# yamllint enable rule:line-length

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ ENV WORKDIR=/app
55
WORKDIR ${WORKDIR}
66

77
###############################################################################
8-
FROM node:20.14.0-alpine3.20 AS mdlint
8+
FROM base AS lint
99

1010
ENV WORKDIR=/app
1111
WORKDIR ${WORKDIR}
1212

1313
COPY ./docs ${WORKDIR}/docs
14-
RUN apk add --update --no-cache make
14+
RUN apk add --update --no-cache make nodejs npm
15+
RUN apk add --update --no-cache yamllint
16+
1517
RUN npm install -g --ignore-scripts markdownlint-cli
1618

1719
###############################################################################

Makefile

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ dependencies:
6969
${PACKAGE_TOOL} restore --verbosity ${VERBOSITY_LEVEL}
7070
@echo "################################################################################"
7171

72-
mdlint:
73-
markdownlint '**/*.md' --ignore '**/bin/*' && echo '✔ Your code looks good.'
72+
lint/markdown:
73+
markdownlint '**/*.md' --ignore node_modules && echo '✔ Your code looks good.'
74+
lint/yaml:
75+
yamllint --stric . && echo '✔ Your code looks good.'
7476

75-
lint: test/static test/styling mdlint
77+
lint: lint/markdown lint/yaml test/styling test/static
7678

7779
test/static: dependencies
7880

@@ -115,20 +117,26 @@ clean:
115117
find ${TEST_PROJECT_DIRECTORY} -path "*/obj/*" -print -exec rm -fr {} ';' || true
116118

117119
compose/build: env
120+
docker-compose --profile lint build
118121
docker-compose --profile testing build
119122

120123
compose/rebuild: env
121124
docker-compose --profile lint build --no-cache
122125
docker-compose --profile testing build --no-cache
123126

124-
compose/mdlint: env
125-
docker-compose --profile lint build
126-
docker-compose --profile lint run --rm algorithm-exercises-csharp-mdlint make mdlint
127+
compose/lint/markdown: compose/build
128+
docker-compose --profile lint run --rm algorithm-exercises-csharp-lint make lint/markdown
129+
130+
compose/lint/yaml: compose/build
131+
docker-compose --profile lint run --rm algorithm-exercises-csharp-lint make lint/yaml
132+
133+
compose/test/styling: compose/build
134+
docker-compose --profile lint run --rm algorithm-exercises-csharp-lint make test/styling
127135

128136
compose/test/static: compose/build
129137
docker-compose --profile testing run --rm algorithm-exercises-csharp make test/static
130138

131-
compose/lint: compose/test/static compose/mdlint
139+
compose/lint: compose/lint/markdown compose/lint/yaml compose/test/styling compose/test/static
132140

133141
compose/run: compose/build
134142
docker-compose --profile testing run --rm algorithm-exercises-csharp make test

compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ services:
1111
- ./coverage:/app/coverage
1212
profiles: ["testing"]
1313

14-
algorithm-exercises-csharp-mdlint:
15-
image: algorithm-exercises-csharp:mdlint
14+
algorithm-exercises-csharp-lint:
15+
image: algorithm-exercises-csharp:lint
1616
build:
1717
context: .
1818
target: mdlint

0 commit comments

Comments
 (0)