clincha-org / clincha

Configuration and monitoring of clinch-home infrastructure
https://clinch-home.com
1 stars 1 forks source link

Lint #110

Open clincha opened 11 months ago

clincha commented 11 months ago

Lint the code

FrankXenarthra commented 11 months ago

@clincha I'm interested in working on that issue. I checked the file extensions and most of them are yaml files.

Summarized output of yamllint below.

Error: line too long ( ... > 80 characters) (line-length) no new line character at the end of file (new-line-at-end-of-file) syntax error: expected '', but found '' (syntax) too many blank lines (1 > 0) (empty-lines) too many spaces inside brackets (brackets) trailing spaces (trailing-spaces)

Warnings: missing document start "---" (document-start) missing starting space in comment (comments) truthy value should be one of [false, true] (truthy)

Any warnings or errors that should be excluded?

clincha commented 11 months ago

Hey @FrankXenarthra, thanks for offering to help out.

Most of them are YAML but there are also HCL files. There is also a linter for Ansible called ansible-lint which will certainly raise errors. There may also be one for Packer and Terraform but I'm not certain. If you feel like a challenge you could link them as well.

Here's what I think should be excluded:

Error: line too long ( ... > 80 characters) (line-length) no new line character at the end of file (new-line-at-end-of-file) syntax error: expected '', but found '' (syntax) too many blank lines (1 > 0) (empty-lines) too many spaces inside brackets (brackets) trailing spaces (trailing-spaces)

Warnings: missing document start "---" (document-start) missing starting space in comment (comments) truthy value should be one of [false, true] (truthy)

FrankXenarthra commented 11 months ago

@clincha I'm happy to support you and to gather some experience. Challenge accepted. Thank you for the clarification about the needed yaml rules. I would prefer to handle each type in a separate commit and already prepared the yaml one. The README.md had to be excluded (only source of trailing-spaces)

Should I create an issue for each file type and link it to this issue then?

clincha commented 11 months ago

No need for a new issue each time unless you want to, feel free to just link it to this one.

FrankXenarthra commented 11 months ago

@clincha Apologies for all the references. Pull Request is ready for review now https://github.com/clincha/clincha/pull/112

FrankXenarthra commented 10 months ago

@clincha If you are still interested I could proceed with the linting of Ansible files. These are the rules mentioned by ansible-lint (document-start and line too long are only a few):

package-latest Package installs should not use latest role-name Role name Ansible does not match ^+$ pattern role-name Role name Documentation does not match ^+$ pattern var-naming File defines variable 'velero_clientId' that violates variable naming standards var-naming File defines variable 'velero_resourceGroup' that violates variable naming standards var-naming File defines variable 'velero_storageAccount' that violates variable naming standards var-naming File defines variable 'velero_subscriptionId' that violates variable naming standards var-naming File defines variable 'velero_tenantId' that violates variable naming standards yaml line too long (... > 80 characters) (line-length)

Should some of the be excluded?

Many thanks!