Skip to content

Commit

Permalink
Merge branch 'main' into with_parens
Browse files Browse the repository at this point in the history
  • Loading branch information
jpy-git authored Apr 2, 2022
2 parents 0f0a01a + 1af29fb commit bd7373c
Show file tree
Hide file tree
Showing 21 changed files with 339 additions and 302 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/diff_shades.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- name: Install diff-shades and support dependencies
run: |
python -m pip install 'click<8.1.0' packaging urllib3
python -m pip install click packaging urllib3
python -m pip install https://github.com/ichard26/diff-shades/archive/stable.zip
- name: Calculate run configuration & metadata
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Install diff-shades and support dependencies
run: |
python -m pip install https://github.com/ichard26/diff-shades/archive/stable.zip
python -m pip install 'click<8.1.0' packaging urllib3
python -m pip install click packaging urllib3
python -m pip install -r .github/mypyc-requirements.txt
# After checking out old revisions, this might not exist so we'll use a copy.
cat scripts/diff_shades_gha_helper.py > helper.py
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/diff_shades_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ jobs:
- name: Try to find pre-existing PR comment
if: steps.metadata.outputs.needs-comment == 'true'
id: find-comment
uses: peter-evans/find-comment@d2dae40ed151c634e4189471272b57e76ec19ba8
uses: peter-evans/find-comment@1769778a0c5bd330272d749d12c036d65e70d39d
with:
issue-number: ${{ steps.metadata.outputs.pr-number }}
comment-author: "github-actions[bot]"
body-includes: "diff-shades"

- name: Create or update PR comment
if: steps.metadata.outputs.needs-comment == 'true'
uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
uses: peter-evans/create-or-update-comment@c9fcb64660bc90ec1cc535646af190c992007c32
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ steps.metadata.outputs.pr-number }}
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@

<!-- Changes to how Black is packaged, such as dependency requirements -->

- Use `tomli` instead of `tomllib` on Python 3.11 builds where `tomllib` is not
available (#2987)

### Parser

<!-- Changes to the parser or to version autodetection -->
Expand Down
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,15 @@ def make_pypi_svg(version: str) -> None:
# Prettier support formatting some MyST syntax but not all, so let's disable the
# unsupported yet still enabled by default ones.
myst_disable_syntax = [
"colon_fence",
"myst_block_break",
"myst_line_comment",
"math_block",
]

# Optional MyST Syntaxes
myst_enable_extensions = []

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down
49 changes: 49 additions & 0 deletions docs/contributing/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contributing

```{toctree}
---
hidden:
---
the_basics
gauging_changes
issue_triage
release_process
reference/reference_summary
```

Welcome! Happy to see you willing to make the project better. Have you read the entire
[user documentation](https://black.readthedocs.io/en/latest/) yet?

```{rubric} Bird's eye view
```

In terms of inspiration, _Black_ is about as configurable as _gofmt_ (which is to say,
not very). This is deliberate. _Black_ aims to provide a consistent style and take away
opportunities for arguing about style.

Bug reports and fixes are always welcome! Please follow the
[issue template on GitHub](https://github.com/psf/black/issues/new) for best results.

Before you suggest a new feature or configuration knob, ask yourself why you want it. If
it enables better integration with some workflow, fixes an inconsistency, speeds things
up, and so on - go for it! On the other hand, if your answer is "because I don't like a
particular formatting" then you're not ready to embrace _Black_ yet. Such changes are
unlikely to get accepted. You can still try but prepare to be disappointed.

```{rubric} Contents
```

This section covers the following topics:

- {doc}`the_basics`
- {doc}`gauging_changes`
- {doc}`release_process`
- {doc}`reference/reference_summary`

For an overview on contributing to the _Black_, please checkout {doc}`the_basics`.

If you need a reference of the functions, classes, etc. available to you while
developing _Black_, there's the {doc}`reference/reference_summary` docs.
43 changes: 0 additions & 43 deletions docs/contributing/index.rst

This file was deleted.

16 changes: 16 additions & 0 deletions docs/guides/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Guides

```{toctree}
---
hidden:
---
introducing_black_to_your_project
using_black_with_other_tools
```

Wondering how to do something specific? You've found the right place! Listed below are
topic specific guides available:

- {doc}`introducing_black_to_your_project`
- {doc}`using_black_with_other_tools`
14 changes: 0 additions & 14 deletions docs/guides/index.rst

This file was deleted.

139 changes: 139 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<!--
black documentation master file, created by
sphinx-quickstart on Fri Mar 23 10:53:30 2018.
-->

# The uncompromising code formatter

> “Any color you like.”
By using _Black_, you agree to cede control over minutiae of hand-formatting. In return,
_Black_ gives you speed, determinism, and freedom from `pycodestyle` nagging about
formatting. You will save time and mental energy for more important matters.

_Black_ makes code review faster by producing the smallest diffs possible. Blackened
code looks the same regardless of the project you're reading. Formatting becomes
transparent after a while and you can focus on the content instead.

Try it out now using the [Black Playground](https://black.vercel.app).

```{admonition} Note - Black is now stable!
*Black* is [successfully used](https://github.com/psf/black#used-by) by
many projects, small and big. *Black* has a comprehensive test suite, with efficient
parallel tests, our own auto formatting and parallel Continuous Integration runner.
Now that we have become stable, you should not expect large formatting to changes in
the future. Stylistic changes will mostly be responses to bug reports and support for new Python
syntax.
Also, as a safety measure which slows down processing, *Black* will check that the
reformatted code still produces a valid AST that is effectively equivalent to the
original (see the
[Pragmatism](./the_black_code_style/current_style.md#pragmatism)
section for details). If you're feeling confident, use `--fast`.
```

```{note}
{doc}`Black is licensed under the MIT license <license>`.
```

## Testimonials

**Mike Bayer**, author of [SQLAlchemy](https://www.sqlalchemy.org/):

> _I can't think of any single tool in my entire programming career that has given me a
> bigger productivity increase by its introduction. I can now do refactorings in about
> 1% of the keystrokes that it would have taken me previously when we had no way for
> code to format itself._
**Dusty Phillips**,
[writer](https://smile.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=dusty+phillips):

> _Black is opinionated so you don't have to be._
**Hynek Schlawack**, creator of [attrs](https://www.attrs.org/), core developer of
Twisted and CPython:

> _An auto-formatter that doesn't suck is all I want for Xmas!_
**Carl Meyer**, [Django](https://www.djangoproject.com/) core developer:

> _At least the name is good._
**Kenneth Reitz**, creator of [requests](http://python-requests.org/) and
[pipenv](https://docs.pipenv.org/):

> _This vastly improves the formatting of our code. Thanks a ton!_
## Show your style

Use the badge in your project's README.md:

```md
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
```

Using the badge in README.rst:

```rst
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
```

Looks like this:

```{image} https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
```

## Contents

```{toctree}
---
maxdepth: 3
includehidden:
---
the_black_code_style/index
```

```{toctree}
---
maxdepth: 3
includehidden:
caption: User Guide
---
getting_started
usage_and_configuration/index
integrations/index
guides/index
faq
```

```{toctree}
---
maxdepth: 2
includehidden:
caption: Development
---
contributing/index
change_log
authors
```

```{toctree}
---
hidden:
caption: Project Links
---
GitHub <https://github.com/psf/black>
PyPI <https://pypi.org/project/black>
Chat <https://discord.gg/RtVdv86PrH>
```

# Indices and tables

- {ref}`genindex`
- {ref}`search`
Loading

0 comments on commit bd7373c

Please sign in to comment.