Check self format for the whole repo (#3750)

`black .` is changing things in gallery and scripts for me
This commit is contained in:
Shantanu 2023-06-25 06:53:26 -07:00 committed by GitHub
parent 93989e995d
commit e1036119f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 9 deletions

View File

@ -103,4 +103,4 @@ jobs:
python -m pip install -e ".[uvloop]" python -m pip install -e ".[uvloop]"
- name: Format ourselves - name: Format ourselves
run: python -m black --check src/ run: python -m black --check .

View File

@ -243,11 +243,9 @@ def format_repos(repos: Tuple[Path, ...], options: Namespace) -> None:
def main() -> None: def main() -> None:
parser = ArgumentParser( parser = ArgumentParser(description="""Black Gallery is a script that
description="""Black Gallery is a script that
automates the process of applying different Black versions to a selected automates the process of applying different Black versions to a selected
PyPI package and seeing the results between versions.""" PyPI package and seeing the results between versions.""")
)
group = parser.add_mutually_exclusive_group(required=True) group = parser.add_mutually_exclusive_group(required=True)
group.add_argument("-p", "--pypi-package", help="PyPI package to download.") group.add_argument("-p", "--pypi-package", help="PyPI package to download.")

View File

@ -49,8 +49,7 @@ def make_width_table() -> Iterable[Tuple[int, int, int]]:
def main() -> None: def main() -> None:
table_path = join(dirname(__file__), "..", "src", "black", "_width_table.py") table_path = join(dirname(__file__), "..", "src", "black", "_width_table.py")
with open(table_path, "w") as f: with open(table_path, "w") as f:
f.write( f.write(f"""# Generated by {basename(__file__)}
f"""# Generated by {basename(__file__)}
# wcwidth {wcwidth.__version__} # wcwidth {wcwidth.__version__}
# Unicode {wcwidth.list_versions()[-1]} # Unicode {wcwidth.list_versions()[-1]}
import sys import sys
@ -62,8 +61,7 @@ def main() -> None:
from typing import Final from typing import Final
WIDTH_TABLE: Final[List[Tuple[int, int, int]]] = [ WIDTH_TABLE: Final[List[Tuple[int, int, int]]] = [
""" """)
)
for triple in make_width_table(): for triple in make_width_table():
f.write(f" {triple!r},\n") f.write(f" {triple!r},\n")
f.write("]\n") f.write("]\n")