-
-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhancement: YAMLLINT using --strict causes error and incorrect error…
… count (#3612)
- Loading branch information
Showing
20 changed files
with
377 additions
and
53 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,44 @@ | ||
##################### | ||
##################### | ||
## Azure Pipelines ## | ||
##################### | ||
##################### | ||
|
||
# Error: 6:1 [trailing-spaces] trailing spaces | ||
trigger: main | ||
# Warning: 8:1 [document-start] missing document start "---" | ||
|
||
pool: | ||
vmImage: 'ubuntu-latest' | ||
jobs: | ||
- job: Build | ||
# Error: trailing-spaces] trailing spaces | ||
|
||
steps: | ||
- task: UseNode@1 | ||
inputs: | ||
versionSpec: 12.x | ||
checkLatest: true | ||
empty: | ||
# Error: [indentation] wrong indentation: expected 2 but found 0 | ||
|
||
- job: Test | ||
steps: | ||
|
||
# Error: [empty-lines] too many blank lines (3 > 2) | ||
|
||
|
||
|
||
- script: npm install | ||
# Error: [indentation] wrong indentation: expected 4 but found 2 | ||
- script: npm test | ||
- script: echo "Testing!" | ||
|
||
# Error: [trailing-spaces] trailing spaces | ||
|
||
|
||
# Error: [indentation] wrong indentation: expected 4 but found 2 | ||
- script: npm test | ||
# Error: [empty-lines] too many blank lines (1 > 0) | ||
|
||
|
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,28 @@ | ||
##################### | ||
##################### | ||
## GitHub Actions ## | ||
##################### | ||
##################### | ||
|
||
# Rule: document-start - Missing document start marker | ||
name: CI | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest # Rule: trailing-spaces - Trailing spaces are disallowed | ||
steps: | ||
- uses: actions/checkout@v2 # Rule: indentation - Expected 6 spaces but found 5 | ||
- name: Run a one-line script # Rule: syntax - Expected <block end>, but found '-' | ||
# Rule: trailing-spaces - Trailing spaces are disallowed | ||
run: echo Hello, world! | ||
- name: Two-line script | ||
run: | | ||
echo Add other actions to build, | ||
echo test | ||
- name: Three-line script | ||
run: | | ||
echo Line 1 | ||
echo Line 2 # Rule: indentation - Expected 6 spaces but found 5 | ||
echo Line 3 # Rule: trailing-spaces - Trailing spaces are disallowed | ||
# Rule: empty-lines - Too many blank lines (1 > 0) | ||
|
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,26 @@ | ||
##################### | ||
##################### | ||
##### GitLab CI ##### | ||
##################### | ||
##################### | ||
|
||
# Rule: document-start - Missing document start marker | ||
stages: | ||
# Rule: wrong indentation: expected at least 1 | ||
- build | ||
- test | ||
build_job: | ||
stage: build | ||
script: | ||
- echo "Building..." # Rule: trailing-spaces - Trailing spaces are disallowed | ||
# Rule: syntax error: expected <block end>, but found '<block sequence start>' (syntax) | ||
- echo "Build complete!" # Rule: empty-lines - Empty lines in a block avoided | ||
test_job: | ||
stage: test | ||
script: | ||
- echo "Testing..." | ||
- # Rule: empty-values - Empty values should be avoided | ||
- echo "Test complete!" | ||
- echo "Another test" | ||
# Rule: empty-lines - Too many blank lines (1 > 0) | ||
|
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,40 @@ | ||
######################## | ||
######################## | ||
## Data Serialization ## | ||
######################## | ||
######################## | ||
|
||
# Rule: document-start - Missing document start marker | ||
# Rule: empty-lines - Too many blank lines (4 > 2) | ||
|
||
|
||
|
||
|
||
data: | ||
- id: 1 | ||
name: John Doe | ||
- id: 2 | ||
name: Jane Smith | ||
- id: 3 | ||
- &anchor | ||
foo: bar | ||
# Rule: anchors - found undeclared alias "unknown" | ||
- <<: *unknown | ||
extra: value | ||
- &anchor Foo Bar | ||
- &anchor [item 1, item 2] | ||
- items: | ||
- item1 | ||
- item2 | ||
name: Alice Johnson # Rule: indentation - Inconsistent indentation | ||
address: | ||
# Rule: trailing-spaces - Trailing spaces are disallowed | ||
street: 123 Main St | ||
city: Anytown | ||
zip: 12345 | ||
state: CA | ||
country: USA | ||
garage: { key1: 4, key2: 8 } | ||
phone: | ||
# Rule: empty-lines - Too many blank lines (1 > 0) | ||
|
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,23 @@ | ||
########################## | ||
########################## | ||
## Kubernetes Manifests ## | ||
########################## | ||
########################## | ||
|
||
# Rule: document-start - Missing document start marker | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: mypod | ||
spec: | ||
containers: | ||
- name: mycontainer # Rule: indentation - Inconsistent indentation | ||
image: myimage | ||
# Rule: trailing-spaces - Trailing spaces are disallowed | ||
ports: | ||
- containerPort: 80 # Rule: indentation - Inconsistent indentation | ||
- containerPort: 443 # Rule: indentation - Inconsistent indentation | ||
- name: mysidecar | ||
image: sidecarimage | ||
ports: | ||
- containerPort: 8080 |
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,25 @@ | ||
####################### | ||
####################### | ||
## Ansible Playbooks ## | ||
####################### | ||
####################### | ||
|
||
# Rule: document-start - Missing document start marker | ||
- hosts: localhost | ||
tasks: | ||
- name: Install package | ||
# Rule: trailing-spaces - Trailing spaces are disallowed | ||
apt: | ||
name: nginx | ||
state: present | ||
# syntax error: expected <block end>, but found '<block sequence start>' (syntax) | ||
- name: Start service | ||
service: # Rule: indentation - Inconsistent indentation | ||
name: nginx # Rule: indentation - Inconsistent indentation | ||
state: started # Rule: indentation - Inconsistent indentation | ||
- hosts: all | ||
tasks: | ||
- name: Echo message | ||
command: echo "Hello World" | ||
# Rule: empty-lines - Too many blank lines (1 > 0) | ||
|
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,27 @@ | ||
######################## | ||
######################## | ||
## Configuration File ## | ||
######################## | ||
######################## | ||
|
||
# Rule: document-start - Missing document start marker | ||
database: | ||
host: localhost | ||
port: 5432 | ||
user: admin | ||
password: admin | ||
server: | ||
host: 0.0.0.0 | ||
port: 8080 | ||
ssl: | ||
enabled: true | ||
certificate: /path/to/cert.pem | ||
key: /path/to/key.pem | ||
# Rule: trailing-spaces - Trailing spaces are disallowed | ||
logging: | ||
level: DEBUG # Rule: indentation - Inconsistent indentation | ||
# syntax error: expected <block end>, but found '<block sequence start>' (syntax) | ||
file: /var/log/webapp.log | ||
features: | ||
enable_feature_x: True | ||
enable_feature_y: false |
File renamed without changes.
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,25 @@ | ||
##################### | ||
##################### | ||
## Azure Pipelines ## | ||
##################### | ||
##################### | ||
--- | ||
trigger: | ||
- main | ||
|
||
pool: | ||
vmImage: "ubuntu-latest" | ||
|
||
jobs: | ||
- job: Build | ||
steps: | ||
- task: UseNode@1 | ||
inputs: | ||
versionSpec: "12.x" | ||
checkLatest: true | ||
|
||
- job: Test | ||
steps: | ||
- script: npm install | ||
- script: npm test | ||
- script: echo "Testing!" |
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,24 @@ | ||
##################### | ||
##################### | ||
## GitHub Actions ## | ||
##################### | ||
##################### | ||
--- | ||
name: CI | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run a one-line script | ||
run: echo Hello, world! | ||
- name: Two-line script | ||
run: | | ||
echo Add other actions to build, | ||
echo test, and deploy your project. | ||
- name: Three-line script | ||
run: | | ||
echo Line 1 | ||
echo Line 2 | ||
echo Line 3 |
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,22 @@ | ||
##################### | ||
##################### | ||
##### GitLab CI ##### | ||
##################### | ||
##################### | ||
--- | ||
stages: | ||
- build | ||
- test | ||
|
||
build_job: | ||
stage: build | ||
script: | ||
- echo "Building..." | ||
- echo "Build complete!" | ||
|
||
test_job: | ||
stage: test | ||
script: | ||
- echo "Testing..." | ||
- echo "Test complete!" | ||
- echo "Another test" |
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,20 @@ | ||
######################## | ||
######################## | ||
## Data Serialization ## | ||
######################## | ||
######################## | ||
--- | ||
data: | ||
- id: 1 | ||
name: John Doe | ||
- id: 2 | ||
name: Jane Smith | ||
- id: 3 | ||
name: Alice Johnson | ||
|
||
address: | ||
street: 123 Main St | ||
city: Anytown | ||
zip: 12345 | ||
state: CA | ||
country: USA |
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,21 @@ | ||
########################## | ||
########################## | ||
## Kubernetes Manifests ## | ||
########################## | ||
########################## | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: mypod | ||
spec: | ||
containers: | ||
- name: mycontainer | ||
image: myimage | ||
ports: | ||
- containerPort: 80 | ||
- containerPort: 443 | ||
- name: mysidecar | ||
image: sidecarimage | ||
ports: | ||
- containerPort: 8080 |
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,21 @@ | ||
####################### | ||
####################### | ||
## Ansible Playbooks ## | ||
####################### | ||
####################### | ||
--- | ||
- hosts: localhost | ||
tasks: | ||
- name: Install package | ||
apt: | ||
name: nginx | ||
state: present | ||
- name: Start service | ||
service: | ||
name: nginx | ||
state: started | ||
|
||
- hosts: all | ||
tasks: | ||
- name: Echo message | ||
command: echo "Hello World" |
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,27 @@ | ||
######################## | ||
######################## | ||
## Configuration File ## | ||
######################## | ||
######################## | ||
--- | ||
database: | ||
host: localhost | ||
port: 5432 | ||
user: admin | ||
password: admin | ||
|
||
server: | ||
host: 0.0.0.0 | ||
port: 8080 | ||
ssl: | ||
enabled: true | ||
certificate: /path/to/cert.pem | ||
key: /path/to/key.pem | ||
|
||
logging: | ||
level: DEBUG | ||
file: /var/log/webapp.log | ||
|
||
features: | ||
enable_feature_x: true | ||
enable_feature_y: false |
Oops, something went wrong.