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

Establish style guide #40

Closed
corvus-ch opened this issue Apr 8, 2020 · 4 comments
Closed

Establish style guide #40

corvus-ch opened this issue Apr 8, 2020 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@corvus-ch
Copy link
Contributor

Require all jsonnet code to be compliant with jsonnetfmt using the default options. For CI/CD pipelines, the command jsonnetfmt --test **/*.jsonnet can be used, while autoformatting can be done using jsonnetfmt -i **/*.jsonnet.

jsonnetfmt is documented at https://jsonnet.org/learning/tools.html.

For YAML files, we should use yamllint For CI/CD pipelines, the command yamllint -f parsable --no-warnings **/*.yml can be used. For checking before commiting, yamllint **/*.yml will do the trick.

Rule wise, we might opt to make line-length a warning instead an error and or increase the character count from 80 to something like 120. Subject to be discussed.

@tobru tobru changed the title Establish stylle guide Establish style guide Apr 14, 2020
@corvus-ch
Copy link
Contributor Author

In a discussion with @simu we figured that there is already a mess with naming of exported things in libraries:

  • The Jsonnet standard library uses camelCasing.
  • Kapitan is follwing python conventions and uses snake_case.
  • The Kube library follows golang convention and uses PascalCasing
  • The commodore library does not follow any consistent style and use camelCase and snake_case.

I suggest to follow the lead of Jsonnet and take camelCase as the standard for exported functions and variables.

@corvus-ch
Copy link
Contributor Author

Consider to also use https://editorconfig.org/. While we can check for this in CI/CD, having an editor config file results in a better developer experience.

@srueg
Copy link
Contributor

srueg commented Sep 4, 2020

@corvus-ch corvus-ch mentioned this issue Sep 7, 2020
3 tasks
@corvus-ch corvus-ch self-assigned this Sep 7, 2020
@corvus-ch corvus-ch added the documentation Improvements or additions to documentation label Sep 7, 2020
@corvus-ch
Copy link
Contributor Author

Closed by #88.

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

No branches or pull requests

2 participants