ci: Ensure consistent code formatting in /ui with Prettier#5149
Merged
Conversation
I tried some Prettier options (https://prettier.io/docs/options), but the defaults seem perfectly fine for this project (see also Prettier's option philosophy in https://prettier.io/docs/option-philosophy): - most changes are in unifying quotes to double quotes, which we mostly use in src/, but have single quotes in the files in config/ that were auto generated when ejecting create-react-app - we mostly had es5 style trailing commas (https://prettier.io/docs/options#trailing-commas) in src/, but inserting trailing commas wherever possible minimizes changed lines when adding items to multi-line lists All formatting changes in code or config files were the result of running `yarn format`. Signed-off-by: Harri Lehtola <peruukki@hotmail.com>
Contributor
Author
|
This still needs a review, maybe from @franciscojavierarceo? 🙏 |
Collaborator
|
So is it possible to add a command line in Makefile to format the code? |
franciscojavierarceo
approved these changes
Mar 23, 2025
franciscojavierarceo
left a comment
Member
There was a problem hiding this comment.
lgtm.
would you mind adding a makefile command to do this as well in a follow up PR?
peruukki
added a commit
to peruukki/feast
that referenced
this pull request
Mar 25, 2025
This was requested in feast-dev#5149. Signed-off-by: Harri Lehtola <peruukki@hotmail.com>
redhatHameed
pushed a commit
that referenced
this pull request
Mar 25, 2025
This was requested in #5149. Signed-off-by: Harri Lehtola <peruukki@hotmail.com>
hhhyunwoo
pushed a commit
to hhhyunwoo/feast
that referenced
this pull request
Mar 26, 2025
This was requested in feast-dev#5149. Signed-off-by: Harri Lehtola <peruukki@hotmail.com> Signed-off-by: Hyunwoo Kim <qrlagusdn@naver.com>
hhhyunwoo
pushed a commit
to hhhyunwoo/feast
that referenced
this pull request
Mar 26, 2025
This was requested in feast-dev#5149. Signed-off-by: Harri Lehtola <peruukki@hotmail.com> Signed-off-by: Hyunwoo Kim <qrlagusdn@naver.com>
hhhyunwoo
pushed a commit
to hhhyunwoo/feast
that referenced
this pull request
Mar 26, 2025
This was requested in feast-dev#5149. Signed-off-by: Harri Lehtola <peruukki@hotmail.com> Signed-off-by: Hyunwoo Kim <qrlagusdn@naver.com>
jfw-ppi
pushed a commit
to jfw-ppi/feast
that referenced
this pull request
Jun 7, 2025
…#5149) I tried some Prettier options (https://prettier.io/docs/options), but the defaults seem perfectly fine for this project (see also Prettier's option philosophy in https://prettier.io/docs/option-philosophy): - most changes are in unifying quotes to double quotes, which we mostly use in src/, but have single quotes in the files in config/ that were auto generated when ejecting create-react-app - we mostly had es5 style trailing commas (https://prettier.io/docs/options#trailing-commas) in src/, but inserting trailing commas wherever possible minimizes changed lines when adding items to multi-line lists All formatting changes in code or config files were the result of running `yarn format`. Signed-off-by: Harri Lehtola <peruukki@hotmail.com> Signed-off-by: Jacob Weinhold <29459386+j-wine@users.noreply.github.com>
jfw-ppi
pushed a commit
to jfw-ppi/feast
that referenced
this pull request
Jun 7, 2025
This was requested in feast-dev#5149. Signed-off-by: Harri Lehtola <peruukki@hotmail.com> Signed-off-by: Jacob Weinhold <29459386+j-wine@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Format all code in /ui with Prettier, for consistent formatting. Also enforce the formatting with a check in the unit-test-ui GitHub Actions job.
I have been missing using Prettier when working with Feast UI code, and haven't been really able to do it because it would change other parts of files too, and there was no defined way of formatting.
Which issue(s) this PR fixes:
None. I initially thought of creating an issue to discuss this, but a PR seemed more concrete and not much more effort.
Misc
I tried some Prettier options, but the defaults seem perfectly fine for this project (see also Prettier's option philosophy):
All formatting changes in code or config files were the result of running
yarn format. Sorry about the large number of changes, but since they were done by Prettier, I feel quite confident that the functionality has remained unchanged. I clicked around in the UI after these changes and didn't notice anything changed.I wasn't sure which conventional commit prefix to apply here, went with
cisince adding a new CI check seems the most significant change (according to Cursor at least 😄).