Skip to content

Conversation

@Pranav-yadav
Copy link
Contributor

Summary:

  • Although we have .editorconfig, on Windows machines most of the times the IDEs default to CRLF as default EOL config
  • we've already specified the eol config as lf in .editorconfig at root level
  • this diff syncs same config for prettier as well

NOTE: Using [skip ci] as it's non code change and is tested for formatting.

Changelog:

[GENERAL] [CHANGED] - Specify eol config in .prettierrc as lf at the root level

Test Plan:

  • yarn run format --> nothing should change

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 12, 2023
@Pranav-yadav
Copy link
Contributor Author

NOTE: Using [skip ci] as it's non code change and is tested for formatting.

Feel free to manually trigger the tests if necessary.

P.S. Save Energy! 🌏🤗

@Pranav-yadav
Copy link
Contributor Author

Pranav-yadav commented Apr 13, 2023

ping @cortinico :)

Edit: P.S. Why we don't yet skip CI (both for gh PRs and for commits pushed through fb-internal), for DOC (non core code) changes?
Of course it has some major security aspects related to the use of labels, but I think we can setup something that would skip CI for PRs with only *.md changes. E.g. using label (like skip-ci) or something else.
Also, for directly pushed commits the [skip ci] tag in commit msg should skip CI. Don't know it works in that case...

@cortinico
Copy link
Contributor

/rebase

@cortinico
Copy link
Contributor

Of course it has some major security aspects related to the use of labels, but I think we can setup something that would skip CI for PRs with only *.md changes. E.g. using label (like skip-ci) or something else.
Also, for directly pushed commits the [skip ci] tag in commit msg should skip CI. Don't know it works in that case...

We generally don't want to skip CI as we don't have much docs or other non code content in this repo. Your change also needs to run on CI as, albeit minimal, it could break internal Meta setup so we need to run CI regardless.

@Pranav-yadav
Copy link
Contributor Author

Pranav-yadav commented Apr 13, 2023

Sure.
Lmk if I should rm [skip ci] from commit msg.

@cortinico
Copy link
Contributor

Lmk if I should rm [skip ci] from commit msg.

Yes please remove it (I'm surprised it worked actually)

@Pranav-yadav
Copy link
Contributor Author

Lmk if I should rm [skip ci] from commit msg.

Yes please remove it (I'm surprised it worked actually)

Actually, the reason it worked is that both gh and Circle CI support these tags ([skip ci], [ci skip], etc.).
More about skipping CI on GitHub and Circle CI 👍

- we've already specified the `eol` config
as `lf` in `.editorconfig`
- this diff syncs same config for prettier as well
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,616,941 +0
android hermes armeabi-v7a 7,930,102 +0
android hermes x86 9,103,314 +0
android hermes x86_64 8,958,150 +0
android jsc arm64-v8a 9,183,449 +0
android jsc armeabi-v7a 8,374,218 +0
android jsc x86 9,241,405 +0
android jsc x86_64 9,499,935 +0

Base commit: 3b4037e
Branch: main

@cortinico
Copy link
Contributor

Checking at documentation, seems like this is not needed as the default value for endOfLine is lf since 2.0.0: https://prettier.io/docs/en/options.html

@Pranav-yadav
Copy link
Contributor Author

Pranav-yadav commented Apr 17, 2023

Checking at documentation, seems like this is not needed as the default value for endOfLine is lf since 2.0.0: https://prettier.io/docs/en/options.html

Yeah I had checked that earlier, but, vscode on Windows 11 still defaults to crlf for RN codebase, for other repos it works fine. How to fix that?

Edit: Another approach I know is having .vscode configs but, I'm not sure if there are significant amount of devs who use vscode as primary ide for RN development. WDYT? Let me know your view on adding .vscode configs at root level for this repo.

@facebook-github-bot
Copy link
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Apr 17, 2023
@facebook-github-bot
Copy link
Contributor

@cortinico merged this pull request in 4ad2fc8.

@Pranav-yadav Pranav-yadav deleted the chore/prettierrc branch April 17, 2023 19:49
jeongshin pushed a commit to jeongshin/react-native that referenced this pull request May 7, 2023
Summary:
- Although we have `.editorconfig`, on Windows machines most of the times the IDEs default to `CRLF` as default EOL config
- we've already specified the `eol` config as `lf` in `.editorconfig` at root level
- this diff syncs same config for prettier as well

>NOTE: Using `[skip ci]` as it's non code change and is tested for formatting.

## Changelog:

[GENERAL] [CHANGED] - Specify `eol` config in `.prettierrc` as `lf` at the root level

Pull Request resolved: facebook#36884

Test Plan: - `yarn run format`  --> _nothing should change_

Reviewed By: christophpurrer

Differential Revision: D45056330

Pulled By: cortinico

fbshipit-source-id: 166cbba04728e04521de58144abf0576730c8edd
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
- Although we have `.editorconfig`, on Windows machines most of the times the IDEs default to `CRLF` as default EOL config
- we've already specified the `eol` config as `lf` in `.editorconfig` at root level
- this diff syncs same config for prettier as well

>NOTE: Using `[skip ci]` as it's non code change and is tested for formatting.

## Changelog:

[GENERAL] [CHANGED] - Specify `eol` config in `.prettierrc` as `lf` at the root level

Pull Request resolved: facebook#36884

Test Plan: - `yarn run format`  --> _nothing should change_

Reviewed By: christophpurrer

Differential Revision: D45056330

Pulled By: cortinico

fbshipit-source-id: 166cbba04728e04521de58144abf0576730c8edd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants