Code conventions
Backend
We are following conventions described in Effective Go document.
Go to our Go Report Card to check how well we are doing.
Frontend
We are following conventions described in Angular Style Guide and Material Design Guidelines.
Additionally, check the list of rules and tips, that we are using:
- Private method and variable names should end with a
_
. - In order to keep all tooltips consistent across whole application, we have decided to use 500 ms delay and auto-hide option. It allows us to avoid flickering when moving the mouse over the pages and to hide tooltips after the mouse is elsewhere but the focus is still on the element with tooltip.
An overview of the features provided by the dashboard can be found here.
Code style check and formatting
The code style check suite includes format checks can be executed with:
npm run check
The code formatting can be executed with:
npm run fix
These check and formatting involves in go, ts, scss, html, license and i18n files.
We use following tools and settings for each check and formatting:
code | tools | setting |
---|---|---|
go | golangci-lint | .golangci.yml |
ts | gts | eslintConfig in package.json and .prettierrc.js |
scss | stylelint | stylelint in package.json |
html | js-beautify | options in format.sh |
license | licence-check-and-add | license-checker-config.json |
i18n | xliffmerge | xliffmergeOptions in package.json |
Copyright 2019 The Kubernetes Dashboard Authors
当前内容版权归 Kubernetes 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Kubernetes .