Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated search terms and corresponding image for code style settings #15387

Merged
merged 1 commit into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/assets/docs/save_actions_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions docs/contributing-to-airbyte/code-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ Install it in IntelliJ:
1. `Import Scheme > IntelliJ IDEA code style XML`
2. Select the file we just downloaded
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. We add the `final` keyword wherever possible. It's a drag to have to do it manually, however, so we set up the IDE to do it for us. You can either set this as the default for your IDE or you can set it just for the Airbyte project(s) that you are using.
1. Turn on the inspection. Go into IntelliJ Preferences...
1. Editor > Inspections > Search (with the quotation marks included) "Field may be 'final'" > check the box
2. Editor > Inspections > Search "local variable or parameter can be final" > check the box
3. Apply the changes.
2. Turn on the auto add final. Go into IntelliJ Preferences...
1. Plugins - install Save Actions if not already installed.
2. Go to Save Actions in the preferences left nav (NOT Tools > Actions on Save -- that is a different tool)
1. Activate save actions on save > check the box
2. Active save actions on shortcut > check the box
3. Activate save actions on batch > check the box
4. Add final modifier to field > check the box
5. Add final modifier to local variable or parameter > check the box
6. Apply the changes.
4. Change default `Hard wrap at` in `Wrapping and Braces` tab to **150**
5. Airbyte prefers to have explicit imports (e.g. `import foo.bar.ClassName` over `import foo.bar.*`. 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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Use explicit imports (example: import foo.bar.ClassName over import foo.bar.*) even when importing multiple classes from the same package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fat fingered and merged the PR without adding this change to the branch. I'll create a new branch with these changes and re-request your review. Apologies but I agree that change to be more directive is better since it leaves little room for ambiguity on having explicit imports

6. Add the `final` keyword wherever possible. You can either set this as the default for your IDE or you can set it just for the Airbyte project(s) that you are using
1. Turn on the inspection. Go into `Preferences > Editor > Inspections`
1. Search `"Field may be 'final'"` > check the box
2. Search `"local variable or parameter can be 'final'"` > check the box
3. Apply the changes
2. Turn on the auto add final. Go into IntelliJ Preferences
1. Plugins - install Save Actions if not already installed
2. Go to Save Actions in the preferences [left navigation column](../assets/docs/save_actions_settings.png) (NOT Tools > Actions on Save -- that is a different tool)
1. `Activate save actions on save` > check the box
2. `Active save actions on shortcut` > check the box
3. `Activate save actions on batch` > check the box
4. `Add final modifier to field` > check the box
5. `Add final modifier to local variable or parameter` > check the box
6. Apply the changes
7. You're done!