-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add yamllint scaffold, and prettify variables.yaml
Signed-off-by: Jack Luar <[email protected]>
- Loading branch information
Showing
4 changed files
with
266 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: ORFS variables.yaml tester and linter | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
docs-test-job: | ||
name: 'Tests for variables.yaml' | ||
runs-on: ubuntu-latest | ||
container: | ||
image: openroad/ubuntu-cpp20 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
- name: Run YAML script | ||
run: | | ||
python3 flow/scripts/generate-variable-docs.py | ||
- name: Run YAML Lint | ||
run: | | ||
pip install yamllint==1.35.1 | ||
yamllint flow/scripts/variables.yaml | ||
docs-pr-update: | ||
name: 'Create PR to update ORFS FlowVariables.md' | ||
needs: | ||
- docs-test-job | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Run generate-variable-docs.py | ||
run: | | ||
python3 flow/scripts/generate-variable-docs.py | ||
- name: Create branch if diff exists | ||
id: docs-update | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
if [ -n "$(git status --porcelain)" ]; then | ||
echo "has_update=true" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "has_update=false" >> "$GITHUB_OUTPUT" | ||
fi | ||
git add . | ||
git commit --signoff -m "[Docs]: Update ORFS FlowVariables.md" | ||
- name: Only push if not master | ||
if: "github.event.client_payload.branch != 'master'" | ||
id: remote-update-pr | ||
run: | | ||
git push origin "HEAD:refs/pull/${{ github.event.client_payload.branch }}/head" | ||
- name: Create docs update PR | ||
if: "steps.remote-update.outputs.has_update == 'true' && github.event.client_payload.branch == 'master'" | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
token: ${{ github.token }} | ||
signoff: true | ||
delete-branch: true | ||
title: "[BOT] Update ORFS variables" | ||
reviewers: | | ||
vvbandeira | ||
maliberty | ||
draft: true | ||
branch: bot-update-variables | ||
commit-message: | | ||
[BOT] Update ORFS variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
extends: default | ||
|
||
rules: | ||
# General formatting | ||
indentation: | ||
level: error # options: 'error' (strict), 'warning' (less strict) | ||
spaces: 2 # number of spaces per indentation level | ||
line-length: | ||
max: 120 # maximum allowed length for lines | ||
level: warning | ||
allow-non-breakable-words: false # non-breakable words exceeding line-length | ||
|
||
# Document structure | ||
document-start: | ||
level: error # documents should start with '---' | ||
|
||
# Trailing spaces | ||
trailing-spaces: | ||
level: error # no trailing spaces allowed | ||
|
||
# Comments | ||
comments: | ||
level: warning | ||
require-starting-space: true # comments should have a space after '#' | ||
|
||
# Special characters | ||
key-duplicates: | ||
level: error # duplicate keys are not allowed | ||
truthy: | ||
level: warning # warn on 'yes/no' and 'on/off'; prefer 'true/false' | ||
|
||
# File properties | ||
empty-lines: | ||
max: 2 # no more than 2 consecutive empty lines | ||
level: warning | ||
new-line-at-end-of-file: | ||
level: warning # files should end with a newline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.