Skip to content

chore: Add black and format python code#419

Merged
gjreda merged 2 commits into
mainfrom
add-black
Aug 25, 2023
Merged

chore: Add black and format python code#419
gjreda merged 2 commits into
mainfrom
add-black

Conversation

@gjreda

@gjreda gjreda commented Aug 24, 2023

Copy link
Copy Markdown
Collaborator

fixes #416

Except for changes to the workspace .vscode/settings.json and .husky, this PR is entirely formatting changes.

@gjreda gjreda marked this pull request as ready for review August 24, 2023 22:33
@codecov

codecov Bot commented Aug 24, 2023

Copy link
Copy Markdown

Codecov Report

Merging #419 (a40cf9c) into main (3db59ee) will increase coverage by 1.85%.
The diff coverage is 80.35%.

❗ Current head a40cf9c differs from pull request most recent head 719f37b. Consider uploading reports for the commit 719f37b to get more accurate results

@@            Coverage Diff             @@
##             main     #419      +/-   ##
==========================================
+ Coverage   80.90%   82.75%   +1.85%     
==========================================
  Files         188      184       -4     
  Lines       11216    10840     -376     
  Branches     1141     1144       +3     
==========================================
- Hits         9074     8971     -103     
+ Misses       2127     1854     -273     
  Partials       15       15              
Files Changed Coverage Δ
python/generate_schema.py 0.00% <0.00%> (ø)
python/main.py 0.00% <0.00%> (ø)
python/sidecar/cli.py 0.00% <ø> (ø)
python/sidecar/ranker.py 100.00% <ø> (ø)
python/sidecar/search.py 48.57% <ø> (ø)
python/sidecar/stopwords.py 100.00% <ø> (ø)
python/sidecar/typing.py 97.57% <ø> (ø)
python/sidecar/chat.py 89.06% <66.66%> (ø)
python/sidecar/storage.py 84.26% <71.42%> (ø)
python/sidecar/http.py 81.92% <80.00%> (ø)
... and 6 more

... and 24 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@gjreda gjreda requested review from cguedes and danvk August 24, 2023 22:53
cguedes
cguedes previously approved these changes Aug 25, 2023

@cguedes cguedes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is great @gjreda. Just left a note about the 88 col size limit (vs 120 in the web).
But it's ok to keep it with black's default.

Please merge main and ask again for my approval.

Comment thread .vscode/settings.json
"editor.formatOnSave": false,
"editor.defaultFormatter": "ms-python.python",
"editor.codeActionsOnSave": []
"editor.rulers": [88],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why 88?

Comment thread pyproject.toml

[tool.ruff]
line-length = 120 # same length we have prettier/JS set to
line-length = 88 # black default

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see now that 88 is black default. For the web we adopted 120 instead of the default 80.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

88 has become the defacto python default thanks to black adoption. previously it was 79.

@gjreda gjreda merged commit 5684fa9 into main Aug 25, 2023
@gjreda gjreda deleted the add-black branch August 25, 2023 16:34
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.

Add black for python autoformatting

2 participants