Skip to content

Commit 7020a18

Browse files
authored
Merge pull request #377 from dflook/more-linting
2 parents 2433674 + d9811db commit 7020a18

33 files changed

+204
-108
lines changed

.config/.markdownlint.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ no-inline-html:
55
allowed_elements: ['p', 'img']
66
ul-style:
77
style: sublist
8-

.config/.v8rrc.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
customCatalog:
2+
schemas:
3+
- name: Example Workflow
4+
fileMatch: ["example_workflows/*.yaml"]
5+
location: https://json.schemastore.org/github-workflow.json
6+
7+
- name: Markdown Lint
8+
fileMatch: ["changelog.markdownlint.yaml"]
9+
location: "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json"
10+
11+
- name: GitHub Issue Template configuration
12+
fileMatch: [".github/ISSUE_TEMPLATE/config.yml"]
13+
location: "https://json.schemastore.org/github-issue-config.json"
14+
15+
patterns: ['**/*.yaml', '**/*.yml']

.config/.yamllint.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
document-start: disable
6+
line-length:
7+
max: 255
8+
truthy:
9+
check-keys: false
10+
comments:
11+
min-spaces-from-content: 1
12+
octal-values:
13+
forbid-implicit-octal: true
14+
forbid-explicit-octal: true

.config/ruff.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
line-length = 120
2+
3+
target-version = "py39"
4+
5+
src = ["docs-gen", "image/src"]
6+
7+
include = [
8+
"docs-gen/*.py",
9+
"image/src/*.py",
10+
"image/src/setup.py",
11+
"tools/*.py",
12+
]
13+
14+
[lint]
15+
# Allow fix for all enabled rules (when `--fix`) is provided.
16+
fixable = ["ALL"]
17+
unfixable = []
18+
19+
# Allow unused variables when underscore-prefixed.
20+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
21+
22+
[lint.flake8-quotes]
23+
inline-quotes = "single"
24+
multiline-quotes = "single"
25+
docstring-quotes = "double"
26+
27+
[format]
28+
quote-style = "single"
29+
docstring-code-format = true

.github/ISSUE_TEMPLATE/problem.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ body:
4949
id: debugging-enabled
5050
attributes:
5151
label: Has debug logging been enabled?
52-
options:
53-
- label: Yes, the `ACTIONS_STEP_DEBUG` secret was set to `true` when capturing the workflow log above. I understand that if I have not done this, I may not recieve a response.
52+
options:
53+
- label: Yes, the `ACTIONS_STEP_DEBUG` secret was set to `true` when capturing the workflow log above. I understand that if I have not done this, I may not receive a response.
5454
required: true

.github/workflows/release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ jobs:
5252
run: |
5353
BASE_TAG=$(docker buildx imagetools inspect danielflook/terraform-github-actions-base:latest --format '{{json .}}' | jq -r '.manifest.annotations."ref.tag"')
5454
BASE_DIGEST=$(docker buildx imagetools inspect "danielflook/terraform-github-actions-base:$BASE_TAG" --format '{{json .}}' | jq -r '.manifest.digest')
55-
55+
5656
gh attestation verify --repo dflook/terraform-github-actions "oci://index.docker.io/danielflook/terraform-github-actions-base@$BASE_DIGEST"
57-
57+
5858
sed -i "s|FROM danielflook/terraform-github-actions-base:latest|FROM danielflook/terraform-github-actions-base@$BASE_DIGEST|" "image/Dockerfile"
59-
59+
6060
docker buildx build \
6161
--build-arg FETCH_CHECKSUMS=yes \
6262
--build-arg VERSION="${RELEASE_TAG:1}" \
@@ -156,12 +156,12 @@ jobs:
156156
git -C "$HOME/$action" tag --force -a -m"$RELEASE_TAG" "$major.$minor-dockerhub"
157157
git -C "$HOME/$action" push --force
158158
git -C "$HOME/$action" push --force --tags
159-
159+
160160
# git tags that use GitHub Container Registry for the image
161161
git -C "$HOME/$action" checkout ghcr || git -C "$HOME/$action" checkout -b ghcr
162162
prepare_release
163163
sed -i "s| image:.*| image: docker://ghcr.io/dflook/terraform-github-actions@$IMAGE_DIGEST|" "$HOME/$action/action.yaml"
164-
164+
165165
git -C "$HOME/$action" add -A
166166
git -C "$HOME/$action" commit -m "$RELEASE_TAG-ghcr"
167167
git -C "$HOME/$action" tag --force -a -m"$RELEASE_TAG" "$RELEASE_TAG-ghcr"

.github/workflows/test-apply.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ jobs:
878878
contents: read
879879
pull-requests: write
880880
env:
881-
GITHUB_TOKEN: No
881+
GITHUB_TOKEN: "No"
882882
TERRAFORM_ACTIONS_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
883883
steps:
884884
- name: Checkout
@@ -1029,7 +1029,7 @@ jobs:
10291029
echo "::error:: output changes not set correctly"
10301030
exit 1
10311031
fi
1032-
1032+
10331033
if [[ "$TO_ADD" -ne 1 ]]; then
10341034
echo "::error:: to_add not set correctly"
10351035
exit 1

.github/workflows/test-binary-plan.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,4 @@ jobs:
137137
if [[ "$FAILURE_REASON" != "plan-changed" ]]; then
138138
echo "::error:: failure-reason not set correctly"
139139
exit 1
140-
fi
140+
fi

.github/workflows/test-changes-only.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,4 +229,3 @@ jobs:
229229
echo "::error:: failure-reason not set correctly"
230230
exit 1
231231
fi
232-

.github/workflows/test-cloud.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ jobs:
265265
echo "::error:: Variables not set correctly"
266266
exit 1
267267
fi
268-
268+
269269
if ! grep -q "Terraform will perform the following actions" "$TEXT_PLAN_PATH"; then
270270
echo "::error:: text_plan_path not set correctly"
271271
exit 1
@@ -275,7 +275,7 @@ jobs:
275275
echo "::error:: json_plan_path should not be set"
276276
exit 1
277277
fi
278-
278+
279279
if [[ "$RUN_ID" != "run-"* ]]; then
280280
echo "::error:: output run_id not set correctly"
281281
exit 1
@@ -358,7 +358,7 @@ jobs:
358358
echo "::error:: output not set correctly"
359359
exit 1
360360
fi
361-
361+
362362
if ! grep -q "Terraform will perform the following actions" "$TEXT_PLAN_PATH"; then
363363
echo "::error:: text_plan_path not set correctly"
364364
exit 1
@@ -448,7 +448,7 @@ jobs:
448448
echo "::error:: output changes not set correctly"
449449
exit 1
450450
fi
451-
451+
452452
if ! grep -q "Terraform will perform the following actions" "$TEXT_PLAN_PATH"; then
453453
echo "::error:: text_plan_path not set correctly"
454454
exit 1
@@ -458,7 +458,7 @@ jobs:
458458
echo "::error:: json_plan_path should be set"
459459
exit 1
460460
fi
461-
461+
462462
if [[ "$RUN_ID" != "run-"* ]]; then
463463
echo "::error:: output run_id not set correctly"
464464
exit 1
@@ -485,12 +485,12 @@ jobs:
485485
echo "::error:: Variables not set correctly"
486486
exit 1
487487
fi
488-
488+
489489
if ! grep -q "Terraform will perform the following actions" "$TEXT_PLAN_PATH"; then
490490
echo "::error:: text_plan_path not set correctly"
491491
exit 1
492492
fi
493-
493+
494494
if [[ ! -f "$JSON_PLAN_PATH" ]]; then
495495
echo "::error:: json_plan_path should be set"
496496
exit 1
@@ -536,7 +536,7 @@ jobs:
536536
echo "::error:: changes output not set correctly"
537537
exit 1
538538
fi
539-
539+
540540
if [[ "$APPLY_OUTPUT_LEN" != "5" ]]; then
541541
echo "::error:: Variables not set correctly"
542542
exit 1
@@ -610,7 +610,7 @@ jobs:
610610
echo "::error:: changes output not set correctly"
611611
exit 1
612612
fi
613-
613+
614614
if [[ "$SAVED_APPLY_OUTPUT_LEN" != "8" ]]; then
615615
echo "::error:: Variables not set correctly"
616616
exit 1
@@ -620,7 +620,7 @@ jobs:
620620
echo "::error:: text_plan_path not set correctly"
621621
exit 1
622622
fi
623-
623+
624624
if [[ ! -f "$SAVED_PLAN_JSON_PLAN_PATH" ]]; then
625625
echo "::error:: json_plan_path should be set"
626626
exit 1
@@ -630,7 +630,7 @@ jobs:
630630
echo "::error:: output run_id not set correctly"
631631
exit 1
632632
fi
633-
633+
634634
if [[ "$SAVED_APPLY_RUN_ID" != "run-"* ]]; then
635635
echo "::error:: output run_id not set correctly"
636636
exit 1
@@ -674,7 +674,7 @@ jobs:
674674
echo "::error:: changes output not set correctly"
675675
exit 1
676676
fi
677-
677+
678678
if [[ "$SAVED_APPLY_OUTPUT_LEN" != "8" ]]; then
679679
echo "::error:: Variables not set correctly"
680680
exit 1

0 commit comments

Comments
 (0)