Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: update coding guide (#9416)
Danny Xu9d965055f729
diff --git a/docs/api-style-guide.md b/docs/api-style-guide.mddeleted file mode 100644index aef49e43f0..0000000000--- a/docs/api-style-guide.md+++ /dev/null@@ -1,4 +0,0 @@-# Bytebase API Guide--1. Follow [Google AIP](https://google.aip.dev/).-1. In cases of conflicts between AIP and the proto guide, follow AIP. For instance, the enum name `TYPE_HELLO` should be changed to `HELLO`.diff --git a/docs/fe-style-guide.md b/docs/fe-style-guide.mdindex 2777623ac5..39d6c13c5c 100644--- a/docs/fe-style-guide.md+++ b/docs/fe-style-guide.md@@ -1,27 +1,3 @@-# Bytebase Frontend Style Guide--We are following [Bytebase's API Style Guide](https://github.com/bytebase/bytebase/blob/main/docs/api-style-guide.md) to ensure our style guide is **consistent**.--# URL naming--## Use slugs in URLs--Bytebase uses [slugs](https://en.wikipedia.org/wiki/Clean_URL#Slug) in URLs for resource identification. We use `/issue/hello-world-101` instead of `/issue/101`--_Rationale_: This makes URLs more clean and human-readable, especially when sharing via social media.--## Use lower case, kebab-case for phrases--Use `/anomaly-center` instead of `/anomalycenter` or `/anomalyCenter`--_Rationale_: Using `/anomalycenter` makes it more difficult to read. `/anomalyCenter` makes it more difficult to memoize and type because of mixed cases. Using `/anomaly-center` is good for readability and improves consistency with slugs.--## Use singular form even for collection resource--Use `/issue` instead of `/issues` to display the list of issues.--_Rationale_: Plural forms have several variations and it's hard for non-native English speakers to remember all the rules. And in practice, using singular form for collection resource won't cause confusion with the singular resource because they use different resource paths, e.g. `/issue` versus `/issue/:id`.-# Naming## Variables and properties@@ -68,9 +44,3 @@ We are using Vue, TypeScript and Tailwind CSS. Following their recommended styleWe are using [ESLint](https://eslint.org/) and [Prettier](https://prettier.io/) as our lint and format tools. [plugin:vue/vue3-recommended](https://eslint.vuejs.org/) as our default lint rules.See [the configuration file](https://github.com/bytebase/bytebase/blob/main/frontend/.eslintrc.js) to learn more about the rules.--# References--1. [Bytebase's API Style Guide](https://github.com/bytebase/bytebase/blob/main/docs/api-style-guide.md)-1. [Google's AIP](https://google.aip.dev/)-1. [Kubernetes API reference](https://kubernetes.io/docs/reference/)diff --git a/docs/style-guide.md b/docs/style-guide.mdnew file mode 100644index 0000000000..3d675a310f--- /dev/null+++ b/docs/style-guide.md@@ -0,0 +1,23 @@+# Style Guide++1. Follow the style guide before referring to existing code patterns and conventions.+1. Use American English for naming. For simplicity, avoid using "xxxList". The ambiguity between singular and plural forms often arises from inadequate design.+1. Prioritizing simplicity leading to effective and maintainable software.++## API+1. Follow [Google AIP](https://google.aip.dev/).+2. In cases of conflicts between AIP and the proto guide, follow AIP. For instance, the enum name should be `HELLO` instead of `TYPE_HELLO`.++## Go+1. https://google.github.io/styleguide/go/++## TypeScript+1. https://google.github.io/styleguide/tsguide.html+1. https://google.github.io/styleguide/jsguide.html+1. [Frontend Style Guide](fe-style-guide.md).++## Database Schema+1. [Schema Update Guide](schema-update-guide.md)++## Writing+1. [Writing Guide](writing-guide.md).