Skip to content

Commit

Permalink
update docs to avoid long run times for formatting (#7064)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgardens authored Oct 15, 2021
1 parent 713fe61 commit d154f8b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 2 additions & 3 deletions docs/contributing-to-airbyte/code-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

14 changes: 12 additions & 2 deletions docs/contributing-to-airbyte/developing-locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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
Expand All @@ -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:<directory the connector is in e.g. source-postgres>: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:

Expand Down

0 comments on commit d154f8b

Please sign in to comment.