-
Notifications
You must be signed in to change notification settings - Fork 66
A0-2005: Create yamllint configuration for linting YAML files in .github directory #943
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
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
2f5211a
Test yamllint action
e797a4d
Add: Separate job for yaml lint [WIP]
e30b038
Merge branch 'main' into A0-2005-gha-yamllint
3901098
Add main and current feature branch for testing
c971081
typo
928b3ae
echo ref_name
e7a64c7
Better paths
d5c45ea
Try to trigger
5ed2ed5
vars
5ce15cf
as env
5e30c0c
double asterisk
0d44eb1
those envs are sketchy
47cb9d9
missing one env, removed this branched from 'push' event
4eafc10
some git tinkering
9518c1e
try without fetching
d639854
Fetch is a must-have, removed 'push' triggers
3f1ae32
Test diff
c47c8f0
variable test
0d48dd3
Replace '\n' with ' '
af594f0
quiet 'git fetch'
8d796eb
try to lint
ce6bae8
check again
bec9a08
Try without additional repo path
dad2948
Try again with output
73982d3
Try as an env
35c32b3
i hate it
7dca1c3
Test to trigger linter after editing new files
77a2580
Test to trigger linter after editing new files - remove those changes
b1efdb9
Better grep
4c7d446
Add .yamllint config and remove nested lint in e2e-tests-main-devnet
7aaf2d6
Fixed lenght of line
7ee4cc4
Enforced true and false instead of other boolean values
cea6876
Set line-length to error
65bf32c
Merge branch 'main' into A0-2005-gha-yamllint
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,39 @@ | ||
| --- | ||
| name: GH Action YAML linter | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - ".github/**/**.yml" | ||
| - ".github/**/**.yaml" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.ref }}-${{ github.workflow }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| main: | ||
| name: YAML Lint | ||
| runs-on: ubuntu-20.04 | ||
| steps: | ||
| - name: GIT | Checkout source code | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: Cardinal-Cryptography/aleph-node | ||
| token: ${{ secrets.CI_GH_TOKEN }} | ||
|
|
||
| - name: GIT | Check diff | ||
| id: check-diff | ||
| run: | | ||
| git fetch --quiet origin ${GITHUB_BASE_REF}:refs/remotes/origin/${GITHUB_BASE_REF} | ||
| YAML_FILES=`git --no-pager diff origin/${GITHUB_BASE_REF} --name-only \ | ||
| | grep -E ".github\/.*\/.*(.yaml|.yml)" | tr '\n' ' '` | ||
| echo "Changed YAML files: ${YAML_FILES}" | ||
| echo "YAML_FILES=`echo $YAML_FILES`" >> $GITHUB_ENV | ||
|
|
||
| - name: LINT | Execute yaml-lint | ||
| uses: ibiqlik/action-yamllint@v3.1.1 | ||
| with: | ||
| strict: true | ||
| file_or_dir: ${{ env.YAML_FILES }} | ||
| config_file: .yamllint | ||
This file contains hidden or 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,57 @@ | ||
| --- | ||
| extends: default | ||
|
|
||
| rules: | ||
| braces: | ||
| min-spaces-inside: 0 | ||
| max-spaces-inside: 0 | ||
| min-spaces-inside-empty: -1 | ||
| max-spaces-inside-empty: -1 | ||
| brackets: | ||
| min-spaces-inside: 0 | ||
| max-spaces-inside: 0 | ||
| min-spaces-inside-empty: -1 | ||
| max-spaces-inside-empty: -1 | ||
| colons: | ||
| max-spaces-before: 0 | ||
| max-spaces-after: 1 | ||
| commas: | ||
| max-spaces-before: 0 | ||
| min-spaces-after: 1 | ||
| max-spaces-after: 1 | ||
| comments: | ||
| level: warning | ||
| require-starting-space: true | ||
| min-spaces-from-content: 2 | ||
| comments-indentation: disable | ||
| document-end: disable | ||
| document-start: enable | ||
| empty-lines: | ||
| max: 2 | ||
| max-start: 1 | ||
| max-end: 1 | ||
| empty-values: | ||
| forbid-in-block-mappings: false | ||
| forbid-in-flow-mappings: false | ||
| hyphens: | ||
| max-spaces-after: 1 | ||
| indentation: | ||
| spaces: consistent | ||
| indent-sequences: true | ||
| check-multi-line-strings: false | ||
| key-duplicates: enable | ||
| key-ordering: disable | ||
| line-length: | ||
| max: 100 | ||
| level: error | ||
| allow-non-breakable-words: true | ||
| allow-non-breakable-inline-mappings: false | ||
| new-line-at-end-of-file: enable | ||
| new-lines: | ||
| type: unix | ||
| trailing-spaces: enable | ||
| truthy: | ||
| allowed-values: | ||
| - "true" | ||
| - "false" | ||
| check-keys: false |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.