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 Prettier and auto-format files #224

Merged
merged 4 commits into from
Feb 12, 2024
Merged

Add Prettier and auto-format files #224

merged 4 commits into from
Feb 12, 2024

Conversation

alessio-locatelli
Copy link
Collaborator

@alessio-locatelli alessio-locatelli commented Feb 10, 2024

Since in the Python code you prefer single quotes ', in the Prettier config I specified "singleQuote": true for consistency. But I can revert the Prettier config to the default value (double quotes) if you want.

This PR can be reviewed by looking at the diff, or by looking at the commits one at a time.

Copy link

codecov bot commented Feb 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (84a5d90) 97.22% compared to head (ac512b8) 97.22%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #224   +/-   ##
=======================================
  Coverage   97.22%   97.22%           
=======================================
  Files          10       10           
  Lines        1010     1010           
  Branches      171      171           
=======================================
  Hits          982      982           
  Misses         18       18           
  Partials       10       10           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JWCook
Copy link
Member

JWCook commented Feb 12, 2024

Looks good to me. Thanks!

The only thing I don't quite like about Prettier's markdown formatting is adding extra newlines around all code blocks, MyST directives, anchors, headings, etc. Do you know if that's configurable? If not, it's okay; I'd still prefer having the benefits of auto-formatting.

@JWCook JWCook merged commit 3aa2e5e into main Feb 12, 2024
8 checks passed
@alessio-locatelli
Copy link
Collaborator Author

alessio-locatelli commented Feb 12, 2024

The only thing I don't quite like about Prettier's markdown formatting is adding extra newlines around all code blocks, MyST directives, anchors, headings, etc. Do you know if that's configurable? If not, it's okay; I'd still prefer having the benefits of auto-formatting.

I was able to found only prettier/prettier#6491

I agree that tools like Black and Prettier could sometimes have more options, but the alternative is just another tool, because the benefits of auto-fixing and auto-formatting are too great compared to each contributor doing something unique.

@JWCook JWCook deleted the add_prettier branch February 12, 2024 17:45
@JWCook JWCook added this to the v0.12 milestone Apr 12, 2024
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.

2 participants