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

Use defaults for Black code formatting #103

Merged
merged 3 commits into from
Oct 7, 2022
Merged

Conversation

maxrjones
Copy link
Member

Description of proposed changes

Simplifies pre-commit and tool configuration, Fixes #102

@codecov-commenter
Copy link

codecov-commenter commented Oct 7, 2022

Codecov Report

Merging #103 (a36a958) into main (a36a958) will not change coverage.
The diff coverage is n/a.

❗ Current head a36a958 differs from pull request most recent head 34c3a91. Consider uploading reports for the commit 34c3a91 to get more accurate results

@@            Coverage Diff            @@
##              main      #103   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          182       182           
  Branches        33        33           
=========================================
  Hits           182       182           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@maxrjones maxrjones mentioned this pull request Oct 7, 2022
5 tasks
Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

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

Looks good, I've actually been annoyed with the single quotes because my editor converts them to double quotes on save, this change will be very nice 😁

Btw, not critical, but it seems like black=22.10.0 (released 6 Oct 2022) can format Jupyter notebooks now. I just tried it and it formats the doc/demo.ipynb file. Up to you if you want to do it here or in a separate PR (will need to update black's version in .pre-commit-config.yaml.

diff --git a/doc/demo.ipynb b/doc/demo.ipynb
index f26d916..5735d96 100644
--- a/doc/demo.ipynb
+++ b/doc/demo.ipynb
@@ -552,14 +552,16 @@
     }
    ],
    "source": [
-    "store = fsspec.get_mapper('az://carbonplan-share/example_cmip6_data.zarr', account_name='carbonplan')\n",
+    "store = fsspec.get_mapper(\n",
+    "    \"az://carbonplan-share/example_cmip6_data.zarr\", account_name=\"carbonplan\"\n",
+    ")\n",
     "ds = xr.open_zarr(store, consolidated=True)\n",
     "\n",
-    "# the attributes contain a lot of useful information, but clutter the print out when we inspect the outputs \n",
-    "# throughout this demo, clearing it to avoid confusion \n",
+    "# the attributes contain a lot of useful information, but clutter the print out when we inspect the outputs\n",
+    "# throughout this demo, clearing it to avoid confusion\n",
     "ds.attrs = {}\n",
     "\n",
-    "# inspect the dataset \n",
+    "# inspect the dataset\n",
     "display(ds)"
    ]
   },

@maxrjones
Copy link
Member Author

| Btw, not critical, but it seems like black=22.10.0 (released 6 Oct 2022) can format Jupyter notebooks now. I just tried it and it formats the doc/demo.ipynb file. Up to you if you want to do it here or in a separate PR (will need to update black's version in .pre-commit-config.yaml.

Oh nice! I'll add it to this PR to keep it all together

@maxrjones maxrjones merged commit 54ebaa7 into main Oct 7, 2022
@maxrjones maxrjones deleted the use-black-defaults branch October 7, 2022 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use default configuration for code formatting with black
4 participants