requests-cache / aiohttp-client-cache

An async persistent cache for aiohttp requests
MIT License
116 stars 20 forks source link

Add Prettier and auto-format files #224

Closed alessio-locatelli closed 6 months ago

alessio-locatelli commented 7 months ago

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.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

JWCook commented 6 months ago

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.

alessio-locatelli commented 6 months ago

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 https://github.com/prettier/prettier/issues/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.