From 8b538d45364f33fa3b5565829ccbf561031c624c Mon Sep 17 00:00:00 2001 From: Aaron Steers <18150651+aaronsteers@users.noreply.github.com> Date: Sun, 12 Jul 2020 23:32:08 -0700 Subject: [PATCH 1/5] wip style guides --- styleguides/README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 styleguides/README.md diff --git a/styleguides/README.md b/styleguides/README.md new file mode 100644 index 0000000..6265bed --- /dev/null +++ b/styleguides/README.md @@ -0,0 +1,38 @@ +# DataOps Project Style Guides + +_This resource can be used as a starting point for deciding on a style guide for your team, +covering topics such as naming conventions, code formatting rules, and other coding +standards._ + +## Python Style Guide + +_Save time, write better code, use [Black](https://black.readthedocs.io/en/stable/). For Python code, the auto-formatter [Black](https://black.readthedocs.io/en/stable/) is recommended for all new projects._ + +From the docs: + +> By using Black, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting. You will save time and mental energy for more important matters. +> +> Black makes code review faster by producing the smallest diffs possible. Blackened code looks the same regardless of the project you’re reading. Formatting becomes transparent after a while and you can focus on the content instead. + +## SQL Style Guide + +SQL code is beautiful when it is Pythonic. That is to say, SQL code should try to meet the following objectives: + +- readability of the code is prioritized highly +- it is obvious where the start of each new expression lies +- line lengths are limited so as to eliminate horizontal scrolling (width of 90 or 100 characters, max) +- caps are used sparingly and capitalization rules applied consistently +- columns are named succinctly but clearly + +Additionally: + +- Column names should match to a global glossary - having the same definition and data type regardless of table, with 2 exceptions: + 1. When a column is appended to another table as a foreign lookup, it's context should be provided. + - _For example, the columns `user_name` and `cost_center` when provided through a `manager_id` join should be aliased as `manager_name` and `manager_cost_center`, respectively._ + 2. Columns should _not_ be globally prefixed with the name of the entity unless that additional context provides some clear value. + - _Example A: the `dim_users`.`manager_id` column does not need to be prefixed with `user_`. +- Columns should be named in a way that their use is obvious, without trial and error. + - ... + +### Available Auto-Formatters: +- From d739d774dd2da7375400ad35437b66eaf88fd8b7 Mon Sep 17 00:00:00 2001 From: Aaron Steers <18150651+aaronsteers@users.noreply.github.com> Date: Mon, 13 Jul 2020 09:39:06 -0700 Subject: [PATCH 2/5] added my cool tool --- setup/windows.md | 1 + 1 file changed, 1 insertion(+) diff --git a/setup/windows.md b/setup/windows.md index 24ec4b6..fd3a4e4 100644 --- a/setup/windows.md +++ b/setup/windows.md @@ -74,6 +74,7 @@ Now that you have the core tools installed, you can click to install any of the - [choco://microsoft-teams.install](choco://microsoft-teams.install) - [choco://microsoft-windows-terminal](choco://microsoft-windows-terminal) - [choco://microsoftazurestorageexplorer](choco://microsoftazurestorageexplorer) +- [choco://my-cool-tool](choco://my-cool-tool) - [choco://powerbi](choco://powerbi) - [choco://r.project](choco://r.project) - [choco://sql-server-management-studio](choco://sql-server-management-studio) From 5ff15a7860c33c8c51bb6066218beb92c1018423 Mon Sep 17 00:00:00 2001 From: Aaron Steers <18150651+aaronsteers@users.noreply.github.com> Date: Mon, 13 Jul 2020 09:57:30 -0700 Subject: [PATCH 3/5] updated contributing doc --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 072f59f..b85b182 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,6 @@ # [Docs](./README.md) > Contributing to DataOps Docs + There are two main options for contributing to this repo: issues and pull requests. ## Issues From fc908a6964aa22c5ef56ff29b743e3069054805c Mon Sep 17 00:00:00 2001 From: Aaron Steers Date: Mon, 13 Jul 2020 19:59:26 -0700 Subject: [PATCH 4/5] Update windows.md --- setup/windows.md | 1 - 1 file changed, 1 deletion(-) diff --git a/setup/windows.md b/setup/windows.md index fd3a4e4..24ec4b6 100644 --- a/setup/windows.md +++ b/setup/windows.md @@ -74,7 +74,6 @@ Now that you have the core tools installed, you can click to install any of the - [choco://microsoft-teams.install](choco://microsoft-teams.install) - [choco://microsoft-windows-terminal](choco://microsoft-windows-terminal) - [choco://microsoftazurestorageexplorer](choco://microsoftazurestorageexplorer) -- [choco://my-cool-tool](choco://my-cool-tool) - [choco://powerbi](choco://powerbi) - [choco://r.project](choco://r.project) - [choco://sql-server-management-studio](choco://sql-server-management-studio) From e3c79d95bfbb5d8505ed094d407fa44d1a7c5dc9 Mon Sep 17 00:00:00 2001 From: Aaron Steers Date: Mon, 13 Jul 2020 19:59:46 -0700 Subject: [PATCH 5/5] Update CONTRIBUTING.md --- CONTRIBUTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b85b182..072f59f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,5 @@ # [Docs](./README.md) > Contributing to DataOps Docs - There are two main options for contributing to this repo: issues and pull requests. ## Issues