From d154f8b2786a0bc11585e0876b4f46c3e17f2a88 Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 15 Oct 2021 13:04:42 -0700 Subject: [PATCH] update docs to avoid long run times for formatting (#7064) --- docs/contributing-to-airbyte/code-style.md | 5 ++--- docs/contributing-to-airbyte/developing-locally.md | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/contributing-to-airbyte/code-style.md b/docs/contributing-to-airbyte/code-style.md index 71ee349b202ee..62775bf7011d1 100644 --- a/docs/contributing-to-airbyte/code-style.md +++ b/docs/contributing-to-airbyte/code-style.md @@ -8,14 +8,13 @@ First, download the style configuration. curl https://raw.githubusercontent.com/google/styleguide/gh-pages/intellij-java-google-style.xml -o ~/Downloads/intellij-java-google-style.xml ``` -Install it in IntelliJ:‌ +Install it in IntelliJ: 1. Go to `Preferences > Editor > Code Style` 2. Press the little cog: 1. `Import Scheme > IntelliJ IDEA code style XML` 2. Select the file we just downloaded -3. Select `GoogleStyle` in the drop down +3. Select `GoogleStyle` in the dropdown 4. Change default `Hard wrap at` in `Wrapping and Braces` tab to **150**. 5. We prefer `import foo.bar.ClassName` over `import foo.bar.*`. Even in cases where we import multiple classes from the same package. This can be set by going to `Preferences > Code Style > Java > Imports` and changing `Class count to use import with '*'` to 9999 and \`Names count to use static import with '\*' to 9999. 6. You're done! - diff --git a/docs/contributing-to-airbyte/developing-locally.md b/docs/contributing-to-airbyte/developing-locally.md index e95ba817f2c2a..5ee89861c84d8 100644 --- a/docs/contributing-to-airbyte/developing-locally.md +++ b/docs/contributing-to-airbyte/developing-locally.md @@ -8,7 +8,6 @@ The following technologies are required to build Airbyte locally. 4. `Docker` 5. `Postgresql` 6. `Jq` -7. `CMake` {% hint style="info" %} Manually switching between different language versions can get hairy. We recommend using a version manager such as [`pyenv`](https://github.com/pyenv/pyenv) or [`jenv`](https://github.com/jenv/jenv). @@ -57,6 +56,7 @@ export CPPFLAGS="-I/usr/local/opt/openssl/include" ## Run in `dev` mode with `docker-compose` +These instructions explain how to run a version of Airbyte that you are developing on (e.g. has not been released yet). ```bash SUB_BUILD=PLATFORM ./gradlew build VERSION=dev docker-compose up @@ -78,7 +78,17 @@ SUB_BUILD=PLATFORM ./gradlew :airbyte-tests:acceptanceTests ## Run formatting automation/tests -To format code in the repo, simply run `./gradlew format` at the base of the repo. +Airbyte runs a code formatter as part of the build to enforce code styles. You should run the formatter yourself before submitting a PR (otherwise the build will fail). + +The command to run formatting varies slightly depending on which part of the codebase you are working in. +### Platform +If you are working in the platform run `SUB_BUILD=PLATFORM ./gradlew format` from the root of the repo. + +### Connector +If you are working on an individual connectors run: `./gradlew :airbyte-integrations::format`. + +### Connector Infrastructure +Finally, if you are working in any module in `:airbyte-integrations:bases` or `:airbyte-cdk:python`, run `SUB_BUILD=CONNECTORS_BASE ./gradlew format`. Note: If you are contributing a Python file without imports or function definitions, place the following comment at the top of your file: