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

connectors-ci: automatic code formatting #27314

Closed
alafanechere opened this issue Jun 13, 2023 · 2 comments · Fixed by #27353
Closed

connectors-ci: automatic code formatting #27314

alafanechere opened this issue Jun 13, 2023 · 2 comments · Fixed by #27353

Comments

@alafanechere
Copy link
Contributor

alafanechere commented Jun 13, 2023

We should expose a format command like to format the connector code:
airbyte-ci connectors format

Local execution behavior:

  • The formatted code is exported back the local airbyte repo

CI execution behavior:

  • The formatted code is committed and pushed to the current branch
  • The formatting job should run in the same GHA workflow as tests but in a different and upstream step.
  • If tests locally have the formatted code commit the commit message can skip CI by using the [skip ci] commit message prefix.

For Python connectors the code will be formatted with black and isort
For Java connectors the code will be formatted with ./gradlew format
We also add the copyright header to the connector code if missing.

Code formatting happens at the connector level.
The modified files should only belong to the connector code, not to other project.

@alafanechere
Copy link
Contributor Author

Re-opening because we had to disable auto format. Especially because Java formatter was removing code while formatting... See https://airbytehq-team.slack.com/archives/C03VDJ4FMJB/p1687370336899669

@bnchrch
Copy link
Contributor

bnchrch commented Oct 10, 2023

@bnchrch bnchrch closed this as completed Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants