Skip to content

ci: Ensure consistent code formatting in /ui with Prettier#5149

Merged
franciscojavierarceo merged 1 commit into
feast-dev:masterfrom
peruukki:ui-prettier
Mar 23, 2025
Merged

ci: Ensure consistent code formatting in /ui with Prettier#5149
franciscojavierarceo merged 1 commit into
feast-dev:masterfrom
peruukki:ui-prettier

Conversation

@peruukki

@peruukki peruukki commented Mar 15, 2025

Copy link
Copy Markdown
Contributor

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):

  • 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 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. 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 ci since adding a new CI check seems the most significant change (according to Cursor at least 😄).

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>
@peruukki peruukki requested a review from a team as a code owner March 15, 2025 14:52
Comment thread ui/README.md
@peruukki

Copy link
Copy Markdown
Contributor Author

This still needs a review, maybe from @franciscojavierarceo? 🙏

@HaoXuAI

HaoXuAI commented Mar 22, 2025

Copy link
Copy Markdown
Collaborator

So is it possible to add a command line in Makefile to format the code?

@franciscojavierarceo franciscojavierarceo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm.

would you mind adding a makefile command to do this as well in a follow up PR?

@franciscojavierarceo franciscojavierarceo merged commit 621879e into feast-dev:master Mar 23, 2025
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants