Skip to content

style(generator): format on the CI APIC-415 #342

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

Merged
merged 9 commits into from
Apr 6, 2022
Merged

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented Apr 6, 2022

🧭 What and Why

🎟 JIRA Ticket: APIC-415

Expose the formatter function through the cli, and use it on the generators

🧪 Test

yarn docker format java generators

@millotp millotp self-assigned this Apr 6, 2022
@netlify
Copy link

netlify bot commented Apr 6, 2022

Deploy Preview for api-clients-automation canceled.

Name Link
🔨 Latest commit 5b95839
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/624d74060117c70081842a81

@algolia-bot
Copy link
Collaborator

algolia-bot commented Apr 6, 2022

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the generated/main branch.

@shortcuts
Copy link
Member

Not sure if it's done for testing purposes, but it would make sense to run it locally first :D

@millotp
Copy link
Collaborator Author

millotp commented Apr 6, 2022

Yes I was just testing to see if having the wrong format would throw :)

@millotp millotp requested review from a team, eunjae-lee and shortcuts and removed request for a team April 6, 2022 11:03
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

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

Non blocking comment, it looks nice!

Comment on lines +33 to +37
diff=$(git status --porcelain ./generators | wc -l)
if [[ $diff > 0 ]]; then
echo "Format the generators folder by running 'yarn docker format java generators'"
fi
exit $diff
Copy link
Member

Choose a reason for hiding this comment

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

This could be the ultimate step of this job, with the same thing we do for the CTS

      - name: Check diff with pushed code
        run: |
          git --no-pager diff
          exit $(git status --porcelain | wc -l)

So we know what's the diff and can debug, wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As it's not something you can debug by hand file by file I don't think it matters, the only solution is to run the provided command, which will affect every files.

Copy link
Member

Choose a reason for hiding this comment

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

My comment was more about splitting logic but anyway it's not a big deal here, I'm fine with that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants