Skip to content

Commit

Permalink
Cleanup YAML Linting and Enable Rules (#2301)
Browse files Browse the repository at this point in the history
* Fix yaml linting issues

* Enable yamllint rules

* Replace comment

* Address linting and set line-length longer

Co-authored-by: Lukas Gravley <admiralawkbar@github.com>
  • Loading branch information
lindluni and admiralAwkbar committed Jan 6, 2022
1 parent 42981a4 commit f0e69a5
Show file tree
Hide file tree
Showing 19 changed files with 46 additions and 38 deletions.
1 change: 1 addition & 0 deletions .automation/test/cloudformation/cloudformation_bad_2.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
AWSTemplateFormatVersion: "2010-09-09"
Description: A sample template
Resources:
Expand Down
1 change: 1 addition & 0 deletions .automation/test/cloudformation/cloudformation_good_2.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
AWSTemplateFormatVersion: "2010-09-09"
Description: A sample template
Resources:
Expand Down
1 change: 1 addition & 0 deletions .automation/test/github_actions/actions_bad_01.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Github Actions Bad
on:
push:
Expand Down
1 change: 1 addition & 0 deletions .automation/test/github_actions/actions_good_01.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: GitHub Actions Good
on:
push:
Expand Down
1 change: 1 addition & 0 deletions .automation/test/openapi/openapi_bad_1.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
---
openapi: '3.0.0'
3 changes: 2 additions & 1 deletion .automation/test/openapi/openapi_good_1.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
openapi: 3.0.0
info:
title: Example
Expand All @@ -8,6 +9,6 @@ info:
description: Test for super-linter
servers:
- url: 'http://localhost:3000'
paths: {}
paths: { }
tags:
- name: example
3 changes: 2 additions & 1 deletion .automation/test/tekton/bad/tekton_bad_1.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
Expand Down Expand Up @@ -30,4 +31,4 @@ spec:
mountPath: /var/run/docker.sock
volumes:
- name: sample-example-volume
emptyDir: {}
emptyDir: { }
3 changes: 2 additions & 1 deletion .automation/test/tekton/good/tekton_good_1.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
Expand Down Expand Up @@ -30,4 +31,4 @@ spec:
mountPath: /var/run/docker.sock
volumes:
- name: example-volume
emptyDir: {}
emptyDir: { }
18 changes: 9 additions & 9 deletions .github/linters/.ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#############################
# Exclude paths from linter #
#############################
#exclude_paths:
# exclude_paths:

########################
# Make output parsable #
Expand All @@ -23,23 +23,23 @@ quiet: true
#####################
# Path to rules dir #
#####################
#rulesdir:
# rulesdir:

################
# Tags to skip #
################
skip_list:
- 'empty-string-compare' # Allow compare to empty string
- '204' # Allow string length greater than 160 chars
- 'no-changed-when' # False positives for running command shells
- 'command-instead-of-module' # Allow git commands for push, add, etc...
- 'command-instead-of-shell' # Allow use of shell when you want
- 'no-handler' # Allow step to run like handler
- 'empty-string-compare' # Allow compare to empty string
- '204' # Allow string length greater than 160 chars
- 'no-changed-when' # False positives for running command shells
- 'command-instead-of-module' # Allow git commands for push, add, etc...
- 'command-instead-of-shell' # Allow use of shell when you want
- 'no-handler' # Allow step to run like handler

##################
# Tags to follow #
##################
#tags:
# tags:

#############
# Use rules #
Expand Down
3 changes: 2 additions & 1 deletion .github/linters/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ plugins:
#########
# Rules #
#########
# rules:
rules: { }


##############################
# Overrides for JSON parsing #
Expand Down
8 changes: 4 additions & 4 deletions .github/linters/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
#########################
#########################

#configure golangci-lint
#See https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
# configure golangci-lint
# https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml

issues:
exclude-rules:
- path: _test\.go
Expand All @@ -26,8 +27,7 @@ linters:
- revive
linters-settings:
errcheck:
# report about assignment of errors to blank
# identifier: `num, _ := strconv.Atoi(numStr)`;
# report about assignment of errors to blank identifier
# default is false: such cases aren't reported by default.
check-blank: true
govet:
Expand Down
14 changes: 7 additions & 7 deletions .github/linters/.hadolint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
## Hadolint config file ##
##########################
ignored:
- DL4001 # Ignore wget and curl in same file
- DL4006 # ignore pipefail as we dont want to add layers
- DL3018 # We do pin version in pipfile.lock
- DL3013 # We do pin version in pipfile.lock
- DL3003 # Ignore workdir so we dont add layers
- SC2016 # ignore as its intepreted later
- DL3044 # Ignore using env in env
- DL4001 # Ignore wget and curl in same file
- DL4006 # ignore pipefail as we don't want to add layers
- DL3018 # We do pin version in pipfile.lock
- DL3013 # We do pin version in pipfile.lock
- DL3003 # Ignore workdir so we don't add layers
- SC2016 # ignore as its interpreted later
- DL3044 # Ignore using env in env
2 changes: 1 addition & 1 deletion .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ rules:
key-duplicates: enable
line-length:
level: warning
max: 600
max: 1024
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
new-line-at-end-of-file: disable
Expand Down
1 change: 0 additions & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
# yamllint disable rule:line-length
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
template: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-DEV-slim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,6 @@ jobs:
-e OUTPUT_DETAILS=detailed \
-e ACTIONS_RUNNER_DEBUG=true \
-e ERROR_ON_MISSING_EXEC_BIT=true \
-e YAML_LINTER_RULES=.github/linters/.yaml-linter.yml \
-v "${GITHUB_WORKSPACE}:/tmp/lint" \
"ghcr.io/github/super-linter:slim-${GITHUB_SHA}"
1 change: 1 addition & 0 deletions .github/workflows/deploy-DEV-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,6 @@ jobs:
-e OUTPUT_DETAILS=detailed \
-e ACTIONS_RUNNER_DEBUG=true \
-e ERROR_ON_MISSING_EXEC_BIT=true \
-e YAML_LINTER_RULES=.github/linters/.yaml-linter.yml \
-v "${GITHUB_WORKSPACE}:/tmp/lint" \
"ghcr.io/github/super-linter:${GITHUB_SHA}"
1 change: 0 additions & 1 deletion .github/workflows/stack-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
on:
pull_request:


###############
# Set the Job #
###############
Expand Down
18 changes: 9 additions & 9 deletions TEMPLATES/.ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#############################
# Exclude paths from linter #
#############################
#exclude_paths:
# exclude_paths:

########################
# Make output parsable #
Expand All @@ -23,23 +23,23 @@ quiet: true
#####################
# Path to rules dir #
#####################
#rulesdir:
# rulesdir:

################
# Tags to skip #
################
skip_list:
- 'empty-string-compare' # Allow compare to empty string
- '204' # Allow string length greater than 160 chars
- 'no-changed-when' # False positives for running command shells
- 'command-instead-of-module' # Allow git commands for push, add, etc...
- 'command-instead-of-shell' # Allow use of shell when you want
- 'no-handler' # Allow step to run like handler
- 'empty-string-compare' # Allow compare to empty string
- '204' # Allow string length greater than 160 chars
- 'no-changed-when' # False positives for running command shells
- 'command-instead-of-module' # Allow git commands for push, add, etc...
- 'command-instead-of-shell' # Allow use of shell when you want
- 'no-handler' # Allow step to run like handler

##################
# Tags to follow #
##################
#tags:
# tags:

#############
# Use rules #
Expand Down
3 changes: 1 addition & 2 deletions TEMPLATES/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

#############################
#############################
## JavaScript Linter rules ##
Expand Down Expand Up @@ -38,7 +37,7 @@ plugins:
#########
# Rules #
#########
# rules: {}
rules: { }

##############################
# Overrides for JSON parsing #
Expand Down

0 comments on commit f0e69a5

Please sign in to comment.