From 5908fed9819056bb130f755ce3d142443a4be768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Gregorczyk?= Date: Wed, 11 Sep 2024 11:48:54 +0200 Subject: [PATCH] fix code formatting (#105) --- .github/workflows/black.yml | 2 +- projects/jdwp/build.mk | 2 +- projects/jdwp/codegen/dataclass_generator.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 5c068ca..fd4a05e 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 - uses: psf/black@stable with: - options: "--check --verbose --extend-exclude \"codegen\"" + options: "--check --verbose src: "./projects/jdwp" diff --git a/projects/jdwp/build.mk b/projects/jdwp/build.mk index ebbe01c..22f4220 100644 --- a/projects/jdwp/build.mk +++ b/projects/jdwp/build.mk @@ -10,7 +10,7 @@ jdwp-check: jdwp-host-prepare buck2 run //projects/jdwp:main buck2 test //projects/jdwp/... pyre check - black projects/jdwp --check --extend-exclude "codegen" + black projects/jdwp --check jdwp-format: black-host black projects/jdwp diff --git a/projects/jdwp/codegen/dataclass_generator.py b/projects/jdwp/codegen/dataclass_generator.py index b710354..f336b98 100644 --- a/projects/jdwp/codegen/dataclass_generator.py +++ b/projects/jdwp/codegen/dataclass_generator.py @@ -108,9 +108,9 @@ def compute_struct_names(root: Struct, name: str) -> typing.Mapping[Struct, str] tagged_union_type = typing.cast(TaggedUnion, type) for case_value, case_struct in tagged_union_type.cases: case_name = format_enum_name(case_value) - names[ - case_struct - ] = f"{names[parent]}{sanitized_field_name}Case{case_name}" + names[case_struct] = ( + f"{names[parent]}{sanitized_field_name}Case{case_name}" + ) return names