Skip to content

Commit

Permalink
Lint YAML files (mainly semantic conventions). (#1814)
Browse files Browse the repository at this point in the history
Co-authored-by: Armin Ruech <[email protected]>
  • Loading branch information
Oberon00 and arminru authored Jul 15, 2021
1 parent faae76d commit d872294
Show file tree
Hide file tree
Showing 13 changed files with 756 additions and 716 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/auto-assign-tc-members.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: 'Auto Assign'
on:
on:
pull_request_target:
types: [opened, ready_for_review]

jobs:
add-owner:
runs-on: ubuntu-latest
steps:
- name: run
uses: kentaro-m/[email protected]
with:
configuration-path: ".github/auto_assign.yml"
repo-token: '${{ secrets.GITHUB_TOKEN }}'
- name: run
uses: kentaro-m/[email protected]
with:
configuration-path: ".github/auto_assign.yml"
repo-token: '${{ secrets.GITHUB_TOKEN }}'
14 changes: 14 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ jobs:
- name: run markdownlint
run: make markdownlint

yamllint:
runs-on: ubuntu-latest
steps:
- name: check out code
uses: actions/checkout@v2

- uses: actions/setup-python@v2

- name: install yamllint
run: make install-yamllint

- name: run yamllint
run: yamllint . -f github

markdown-link-check:
runs-on: ubuntu-latest
steps:
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/stale-pr.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: "Close stale pull requests"
on:
schedule:
- cron: "12 3 * * *" # arbitrary time not to DDOS GitHub
- cron: "12 3 * * *" # arbitrary time not to DDOS GitHub

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'This PR was marked stale due to lack of activity. It will be closed in 7 days.'
close-pr-message: 'Closed as inactive. Feel free to reopen if this PR is still being worked on.'
exempt-pr-labels: 'release:after-ga'
days-before-stale: 7
days-before-close: 7
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'This PR was marked stale due to lack of activity. It will be closed in 7 days.'
close-pr-message: 'Closed as inactive. Feel free to reopen if this PR is still being worked on.'
exempt-pr-labels: 'release:after-ga'
days-before-stale: 7
days-before-close: 7
1 change: 0 additions & 1 deletion .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ MD033: false

# fenced-code-language
MD040: false

15 changes: 15 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
extends: default

rules:
document-start: disable
octal-values: enable
truthy:
allowed-values: ['true', 'false', 'on'] # 'on' for GH action trigger
line-length:
max: 200
indentation:
check-multi-line-strings: false
indent-sequences: consistent
brackets:
max-spaces-inside: 1
max-spaces-inside-empty: 0
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ install-markdownlint:
markdownlint:
@for f in $(ALL_DOCS); do echo $$f; $(MARKDOWN_LINT) -c .markdownlint.yaml $$f || exit 1; done

.PHONY: install-yamllint
install-yamllint:
# Using a venv is recommended
pip install -U yamllint~=1.26.1

.PHONY: yamllint
yamllint:
yamllint .

# Generate markdown tables from YAML definitions
.PHONY: table-generation
table-generation:
Expand Down
2 changes: 1 addition & 1 deletion semantic_conventions/resource/cloud_provider/aws/eks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ groups:
type: string
brief: >
The ARN of an EKS cluster.
examples: ['arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster']
examples: ['arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster']
1 change: 0 additions & 1 deletion semantic_conventions/resource/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ groups:
brief: >
Container image tag.
examples: ['0.1']

Loading

0 comments on commit d872294

Please sign in to comment.