Skip to content
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

Lint YAML files (mainly semantic conventions). #1814

Merged
merged 4 commits into from
Jul 15, 2021
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
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not using make here because of the -f github special option.


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
arminru marked this conversation as resolved.
Show resolved Hide resolved
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
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