Skip to content

feat: CI/CD improvements - Consider implementing yamllint #463

@javydekoning

Description

@javydekoning

Some examples have inconsistent indentation. For example:

https://github.com/awslabs/aws-deployment-framework/blob/master/samples/sample-ecs-cluster/template.yml#L8-L13

Others like the below have incorrect syntax:

scm: # Source control management
auto-create-repositories: enabled # If true and using CodeCommit as source, the repository will be automatically created
default-scm-branch: master # The default branch is used when the pipeline does not specify a specific branch. If this parameter is not specified, it defaults to the "master" branch.

auto-create-repositories should be a property of scm: hence needs to be indented.

To start I'm proposing to implement yamllint with the following .yamllint config file:

---
yaml-files:
  - '*.yaml'
  - '*.yml'
  - '.yamllint'

rules:
  braces: enable
  brackets: enable
  colons: enable
  commas: enable
  comments:
    level: warning
  comments-indentation:
    level: warning
  document-end: disable
  document-start: disable
  empty-lines: enable
  empty-values: disable
  hyphens: enable
  indentation: enable
  key-duplicates: enable
  key-ordering: disable
  line-length: disable
  new-line-at-end-of-file: disable
  new-lines: enable
  octal-values: disable
  quoted-strings: disable
  trailing-spaces: enable
  truthy:
    level: warning

This should catch the above syntax error and improve overall code consistency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions