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

Add CSS&JS formatting #737

Merged
merged 5 commits into from
Jul 18, 2021
Merged

Add CSS&JS formatting #737

merged 5 commits into from
Jul 18, 2021

Conversation

ckiee
Copy link
Member

@ckiee ckiee commented Jul 18, 2021

This PR adds:

  • a GitHub Action to check formatting is good.
  • an xtask subcommand to run prettier, pinned to the aforementioned Action's version.

@ckiee ckiee force-pushed the prettier-ci branch 3 times, most recently from 36ed01e to cc08677 Compare July 18, 2021 15:02
Copy link
Member

@zarik5 zarik5 left a comment

Choose a reason for hiding this comment

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

You should add a prettier.rc file, since different people can have a different configuration default. Also prettier.rc should be configured to keep the formatting a s close to the original code as possible (for example use 4 spaces indentation). You can pick the prettier.rc file in the new-dashboard branch.

alvr/xtask/src/main.rs Outdated Show resolved Hide resolved
@ckiee
Copy link
Member Author

ckiee commented Jul 18, 2021

You should add a prettier.rc file, since different people can have a different configuration default.

Wrong:

Prettier intentionally doesn’t support any kind of global configuration. This is to make sure that when a project is copied to another computer, Prettier’s behavior stays the same. Otherwise, Prettier wouldn’t be able to guarantee that everybody in a team gets the same consistent results.

~prettier.io


Also prettier.rc should be configured to keep the formatting a s close to the original code as possible (for example use 4 spaces indentation)

I chose to not do that to avoid the inevitable configuration fight and with the .git-blame-ignore-revs there is no real reason to minimize changes.


Also, if we are moving away from the defaults I'd like to bring your attention to why tabs are important

@ckiee ckiee changed the title Add CSS&JS CI format checking Add CSS&JS formatting Jul 18, 2021
@ckiee
Copy link
Member Author

ckiee commented Jul 18, 2021

Ended up using 4 spaces after a discussion on Discord. Merging.

@ckiee ckiee merged commit fb620b6 into alvr-org:master Jul 18, 2021
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.

None yet

2 participants