Skip to content
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

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

Closed
javydekoning opened this issue Apr 3, 2022 · 0 comments
Closed

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

javydekoning opened this issue Apr 3, 2022 · 0 comments
Milestone

Comments

@javydekoning
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants