Repository: reflex-dev/reflex
Pull request: ruff-format: unify Black with Ruff `v0.1`
### All Submissions:

- [x] Have you followed the guidelines stated in [CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md) file?
- [x] Have you checked to ensure there aren't any other open [Pull Requests](https://github.com/reflex-dev/reflex/pulls ) for the desired changed?

<!-- You can erase any parts of this template not applicable to your Pull Request. -->

### Type of change

As Ruff lint is already used I would suggest using also `ruff-format` for better consistency between lint and formatted 

fixes #2928 


Problem statement:
Fully Migrate off Black to Ruff
Reflex is already using Ruff for linting and formatting. Yet their is still a legacy dependency on the black formatter. At this point, Ruff seems to be on course to completely take over as industry standard and the sooner Reflex standardizes the better. I see that the file `scripts/pyi_generator.py` uses the black library to format pyi files but this should be easy to switch over.

Also, it is not possible to use the Ruff VS Code Extension as the pyproject is locked to an older version of Ruff.

Hints from issue discussion:
Hi @dapomeranz thanks for pointing this out. We do have plans of fully migrating to Ruff at some point. The team is currently focused on other high-priority issues at the moment. However, we're open to receiving a PR regarding this from the community.
Noting that there is a related PR #2837 
Relevant Discord Conversation:
https://discord.com/channels/1029853095527727165/1061493979889278986/1222242970691174462

Commit message: Fix or

Co-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>

Patch to review:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 560598e9e06..e36cbdfe631 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,17 +1,14 @@
 fail_fast: true
 
 repos:
-  - repo: https://github.com/psf/black
-    rev: 22.10.0
-    hooks:
-      - id: black
-        args: [integration, reflex, tests]
 
   - repo: https://github.com/charliermarsh/ruff-pre-commit
-    rev: v0.0.244
+    rev: v0.1.0
     hooks:
+      - id: ruff-format
+        args: [integration, reflex, tests]
       - id: ruff
-        args: [--fix, --exit-non-zero-on-fix]
+        args: ["--fix", "--exit-non-zero-on-fix"]
         exclude: '^integration/benchmarks/'
 
   - repo: https://github.com/RobertCraigie/pyright-python
diff --git a/benchmarks/test_benchmark_compile_components.py b/benchmarks/test_benchmark_compile_components.py
index fa54d1ad7bd..3c26149e857 100644
--- a/benchmarks/test_benchmark_compile_components.py
+++ b/benchmarks/test_benchmark_compile_components.py
@@ -162,7 +162,8 @@ def app_with_10_components(
     yield AppHarness.create(
         root=root,
         app_source=functools.partial(
-            AppWithTenComponentsOnePage, render_component=render_component  # type: ignore
+            AppWithTenComponentsOnePage,
+            render_component=render_component,  # type: ignore
         ),
     )  # type: ignore
 
@@ -184,7 +185,8 @@ def app_with_100_components(
     yield AppHarness.create(
         root=root,
         app_source=functools.partial(
-            AppWithHundredComponentOnePage, render_component=render_component  # type: ignore
+            AppWithHundredComponentOnePage,
+            render_component=render_component,  # type: ignore
         ),
     )  # type: ignore
 
@@ -206,7 +208,8 @@ def app_with_1000_components(
     yield AppHarness.create(
         root=root,
         app_source=functools.partial(
-            AppWithThousandComponentsOnePage, render_component=render_component  # type: ignore
+            AppWithThousandComponentsOnePage,
+            render_component=render_component,  # type: ignore
         ),
     )  # type: ignore
 
diff --git a/benchmarks/test_benchmark_compile_pages.py b/benchmarks/test_benchmark_compile_pages.py
index 986962a2431..f62973c04d6 100644
--- a/benchmarks/test_benchmark_compile_pages.py
+++ b/benchmarks/test_benchmark_compile_pages.py
@@ -225,7 +225,12 @@ def app_with_ten_pages(
         an AppHarness instance
     """
     root = tmp_path_factory.mktemp(f"app10")
-    yield AppHarness.create(root=root, app_source=functools.partial(AppWithTenPages, render_comp=render_multiple_pages))  # type: ignore
+    yield AppHarness.create(
+        root=root,
+        app_source=functools.partial(
+            AppWithTenPages, render_comp=render_multiple_pages
+        ),
+    )  # type: ignore
 
 
 @pytest.fixture(scope="session")
@@ -245,7 +250,8 @@ def app_with_hundred_pages(
     yield AppHarness.create(
         root=root,
         app_source=functools.partial(
-            AppWithHundredPages, render_comp=render_multiple_pages  # type: ignore
+            AppWithHundredPages,
+            render_comp=render_multiple_pages,  # type: ignore
         ),
     )  # type: ignore
 
@@ -267,7 +273,8 @@ def app_with_thousand_pages(
     yield AppHarness.create(
         root=root,
         app_source=functools.partial(  # type: ignore
-            AppWithThousandPages, render_comp=render_multiple_pages  # type: ignore
+            AppWithThousandPages,
+            render_comp=render_multiple_pages,  # type: ignore
         ),
     )  # type: ignore
 
@@ -289,7 +296,8 @@ def app_with_ten_thousand_pages(
     yield AppHarness.create(
         root=root,
         app_source=functools.partial(
-            AppWithTenThousandPages, render_comp=render_multiple_pages  # type: ignore
+            AppWithTenThousandPages,
+            render_comp=render_multiple_pages,  # type: ignore
         ),
     )  # type: ignore
 
diff --git a/integration/test_call_script.py b/integration/test_call_script.py
index 6dd0f5e6a92..18e66cff5bd 100644
--- a/integration/test_call_script.py
+++ b/integration/test_call_script.py
@@ -324,12 +324,14 @@ def test_call_script(
     yield_callback_button.click()
     update_counter_button.click()
     assert call_script.poll_for_value(counter, exp_not_equal="0") == "4"
-    assert call_script.poll_for_value(
-        results, exp_not_equal="[]"
-    ) == '["%s1",null,{"%s3":42,"a":[1,2,3],"s":"js","o":{"a":1,"b":2}},"async %s4"]' % (
-        script,
-        script,
-        script,
+    assert (
+        call_script.poll_for_value(results, exp_not_equal="[]")
+        == '["%s1",null,{"%s3":42,"a":[1,2,3],"s":"js","o":{"a":1,"b":2}},"async %s4"]'
+        % (
+            script,
+            script,
+            script,
+        )
     )
     reset_button.click()
     assert call_script.poll_for_value(counter, exp_not_equal="4") == "0"
diff --git a/integration/test_dynamic_routes.py b/integration/test_dynamic_routes.py
index 3c8c257ec14..5061ee6cc7c 100644
--- a/integration/test_dynamic_routes.py
+++ b/integration/test_dynamic_routes.py
@@ -55,11 +55,15 @@ def index():
             rx.link("index", href="/", id="link_index"),
             rx.link("page_X", href="/static/x", id="link_page_x"),
             rx.link(
-                "next", href="/page/" + DynamicState.next_page, id="link_page_next"  # type: ignore
+                "next",
+                href="/page/" + DynamicState.next_page,
+                id="link_page_next",  # type: ignore
             ),
             rx.link("missing", href="/missing", id="link_missing"),
             rx.chakra.list(
-                rx.foreach(DynamicState.order, lambda i: rx.chakra.list_item(rx.text(i))),  # type: ignore
+                rx.foreach(
+                    DynamicState.order, lambda i: rx.chakra.list_item(rx.text(i))
+                ),  # type: ignore
             ),
         )
 
diff --git a/integration/test_table.py b/integration/test_table.py
index 0a6153c2b89..a13d2b3e505 100644
--- a/integration/test_table.py
+++ b/integration/test_table.py
@@ -79,7 +79,11 @@ def another():
                         ),
                     ),
                     rx.chakra.tfoot(  # type: ignore
-                        rx.chakra.tr(rx.chakra.td("footer1"), rx.chakra.td("footer2"), rx.chakra.td("footer3"))  # type: ignore
+                        rx.chakra.tr(
+                            rx.chakra.td("footer1"),
+                            rx.chakra.td("footer2"),
+                            rx.chakra.td("footer3"),
+                        )  # type: ignore
                     ),
                     rx.chakra.table_caption("random caption"),
                     variant="striped",
diff --git a/pyproject.toml b/pyproject.toml
index d7807b023d6..561efd947ce 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -97,16 +97,12 @@ build-backend = "poetry.core.masonry.api"
 [tool.pyright]
 
 [tool.ruff]
-
-select = ["B", "D", "E", "F", "I", "SIM", "W"]
-
-ignore = ["B008", "D203", "D205", "D213", "D401", "D406", "D407", "E501", "F403", "F405", "F541"]
-
+exclude = ["*.pyi"]
 target-version = "py37"
-
-[tool.ruff.per-file-ignores]
-
+lint.select = ["B", "D", "E", "F", "I", "SIM", "W"]
+lint.ignore = ["B008", "D203", "D205", "D213", "D401", "D406", "D407", "E501", "F403", "F405", "F541"]
+[tool.ruff.lint.per-file-ignores]
 "__init__.py" = ["F401"]
-"tests/*.py" = ["D100", "D103", "D104"]
+"tests/*.py" = ["D100", "D103", "D104", "B018"]
 "reflex/.templates/*.py" = ["D100", "D103", "D104"]
 "*.pyi" = ["ALL"]
diff --git a/reflex/.templates/apps/demo/code/pages/datatable.py b/reflex/.templates/apps/demo/code/pages/datatable.py
index 2a7e79c9350..3747d59943d 100644
--- a/reflex/.templates/apps/demo/code/pages/datatable.py
+++ b/reflex/.templates/apps/demo/code/pages/datatable.py
@@ -201,10 +201,10 @@ class DataTableState(State):
 data_show = """[
     ["1", "Harry James Potter", "31 July 1980", True, "Gryffindor", "11'  Holly  phoenix feather", "Stag", "Half-blood"],
     ["2", "Ronald Bilius Weasley", "1 March 1980", True,"Gryffindor", "12' Ash unicorn tail hair", "Jack Russell terrier", "Pure-blood"],
-    ["3", "Hermione Jean Granger", "19 September, 1979", True, "Gryffindor", "10¾'  vine wood dragon heartstring", "Otter", "Muggle-born"],	
-    ["4", "Albus Percival Wulfric Brian Dumbledore", "Late August 1881", True, "Gryffindor", "15' Elder Thestral tail hair core", "Phoenix", "Half-blood"],	
-    ["5", "Rubeus Hagrid", "6 December 1928", False, "Gryffindor", "16'  Oak unknown core", "None", "Part-Human (Half-giant)"], 
-    ["6", "Fred Weasley", "1 April, 1978", True, "Gryffindor", "Unknown", "Unknown", "Pure-blood"], 
+    ["3", "Hermione Jean Granger", "19 September, 1979", True, "Gryffindor", "10¾'  vine wood dragon heartstring", "Otter", "Muggle-born"],
+    ["4", "Albus Percival Wulfric Brian Dumbledore", "Late August 1881", True, "Gryffindor", "15' Elder Thestral tail hair core", "Phoenix", "Half-blood"],
+    ["5", "Rubeus Hagrid", "6 December 1928", False, "Gryffindor", "16'  Oak unknown core", "None", "Part-Human (Half-giant)"],
+    ["6", "Fred Weasley", "1 April, 1978", True, "Gryffindor", "Unknown", "Unknown", "Pure-blood"],
     ["7", "George Weasley", "1 April, 1978", True, "Gryffindor", "Unknown", "Unknown", "Pure-blood"],
 ]"""
 
diff --git a/reflex/.templates/apps/demo/code/pages/forms.py b/reflex/.templates/apps/demo/code/pages/forms.py
index 38efc3e0fe0..c494573dea8 100644
--- a/reflex/.templates/apps/demo/code/pages/forms.py
+++ b/reflex/.templates/apps/demo/code/pages/forms.py
@@ -18,8 +18,8 @@
                 rx.chakra.checkbox("Checked", id="check"),
                 rx.chakra.switch("Switched", id="switch"),
             ),
-            rx.chakra.button("Submit", 
-                       type_="submit", 
+            rx.chakra.button("Submit",
+                       type_="submit",
                        bg="#ecfdf5",
                        color="#047857",
                        border_radius="lg",
diff --git a/reflex/app.py b/reflex/app.py
index 4af18336763..8a7a4521fd4 100644
--- a/reflex/app.py
+++ b/reflex/app.py
@@ -350,11 +350,17 @@ async def postprocess(
         for middleware in self.middleware:
             if asyncio.iscoroutinefunction(middleware.postprocess):
                 out = await middleware.postprocess(
-                    app=self, state=state, event=event, update=update  # type: ignore
+                    app=self,
+                    state=state,
+                    event=event,
+                    update=update,  # type: ignore
                 )
             else:
                 out = middleware.postprocess(
-                    app=self, state=state, event=event, update=update  # type: ignore
+                    app=self,
+                    state=state,
+                    event=event,
+                    update=update,  # type: ignore
                 )
             if out is not None:
                 return out  # type: ignore
diff --git a/reflex/components/chakra/disclosure/accordion.py b/reflex/components/chakra/disclosure/accordion.py
index 7fd61ca6133..f92bc3ad9b1 100644
--- a/reflex/components/chakra/disclosure/accordion.py
+++ b/reflex/components/chakra/disclosure/accordion.py
@@ -35,7 +35,7 @@ def create(
         icon_pos="right",
         allow_multiple: Optional[Var[bool]] = None,
         allow_toggle: Optional[Var[bool]] = None,
-        **props
+        **props,
     ) -> Component:
         """Create an accordion component.
 
diff --git a/reflex/components/chakra/media/icon.py b/reflex/components/chakra/media/icon.py
index 8b4fb3581cb..00ea4057919 100644
--- a/reflex/components/chakra/media/icon.py
+++ b/reflex/components/chakra/media/icon.py
@@ -37,9 +37,9 @@ def create(cls, *children, **props):
             raise AttributeError(
                 f"Passing children to Icon component is not allowed: remove positional arguments {children} to fix"
             )
-        if "tag" not in props.keys():
+        if "tag" not in props:
             raise AttributeError("Missing 'tag' keyword-argument for Icon")
-        if type(props["tag"]) != str or props["tag"].lower() not in ICON_LIST:
+        if not isinstance(props["tag"], str) or props["tag"].lower() not in ICON_LIST:
             raise ValueError(
                 f"Invalid icon tag: {props['tag']}. Please use one of the following: {sorted(ICON_LIST)}"
             )
diff --git a/reflex/components/component.py b/reflex/components/component.py
index c1b33b1f757..81b2a016bc3 100644
--- a/reflex/components/component.py
+++ b/reflex/components/component.py
@@ -1397,7 +1397,7 @@ def __init__(self, *args, **kwargs):
                 else:
                     value = base_value
             else:
-                value = Var.create(value, _var_is_string=type(value) is str)
+                value = Var.create(value, _var_is_string=isinstance(value, str))
 
             # Set the prop.
             self.props[format.to_camel_case(key)] = value
@@ -1583,9 +1583,7 @@ def _get_dynamic_imports(self) -> str:
         library_import = f"const {self.alias if self.alias else self.tag} = dynamic(() => import('{import_name}')"
         mod_import = (
             # https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading#with-named-exports
-            f".then((mod) => mod.{self.tag})"
-            if not self.is_default
-            else ""
+            f".then((mod) => mod.{self.tag})" if not self.is_default else ""
         )
         return "".join((library_import, mod_import, opts_fragment))
 
diff --git a/reflex/components/core/cond.py b/reflex/components/core/cond.py
index 246fd17f759..737b650d8fe 100644
--- a/reflex/components/core/cond.py
+++ b/reflex/components/core/cond.py
@@ -172,7 +172,7 @@ def cond(condition: Any, c1: Any, c2: Any = None):
     def create_var(cond_part):
         return Var.create_safe(
             cond_part,
-            _var_is_string=type(cond_part) is str or isinstance(cond_part, Color),
+            _var_is_string=isinstance(cond_part, (str, Color)),
         )
 
     # convert the truth and false cond parts into vars so the _var_data can be obtained.
diff --git a/reflex/components/core/match.py b/reflex/components/core/match.py
index f1f4a20965a..169efe3342f 100644
--- a/reflex/components/core/match.py
+++ b/reflex/components/core/match.py
@@ -67,7 +67,7 @@ def _create_condition_var(cls, cond: Any) -> BaseVar:
         Raises:
             ValueError: If the condition is not provided.
         """
-        match_cond_var = Var.create(cond, _var_is_string=type(cond) is str)
+        match_cond_var = Var.create(cond, _var_is_string=isinstance(cond, str))
 
         if match_cond_var is None:
             raise ValueError("The condition must be set")
@@ -119,7 +119,7 @@ def _create_case_var_with_var_data(cls, case_element):
         _var_data = case_element._var_data if isinstance(case_element, Style) else None  # type: ignore
         case_element = Var.create(
             case_element,
-            _var_is_string=type(case_element) is str or isinstance(case_element, Color),
+            _var_is_string=isinstance(case_element, (str, Color)),
         )
         if _var_data is not None:
             case_element._var_data = VarData.merge(case_element._var_data, _var_data)  # type: ignore
diff --git a/reflex/components/datadisplay/code.pyi b/reflex/components/datadisplay/code.pyi
index 9c67f00deb0..11258490c5b 100644
--- a/reflex/components/datadisplay/code.pyi
+++ b/reflex/components/datadisplay/code.pyi
@@ -1082,7 +1082,7 @@ class CodeBlock(Component):
         on_unmount: Optional[
             Union[EventHandler, EventSpec, list, function, BaseVar]
         ] = None,
-        **props
+        **props,
     ) -> "CodeBlock":
         """Create a text component.
 
diff --git a/reflex/components/lucide/icon.py b/reflex/components/lucide/icon.py
index fd0776725e2..051b8391254 100644
--- a/reflex/components/lucide/icon.py
+++ b/reflex/components/lucide/icon.py
@@ -51,18 +51,18 @@ def map_deprecated_icon_names_05(tag: str) -> str:
             return tag
 
         if children:
-            if len(children) == 1 and type(children[0]) == str:
+            if len(children) == 1 and isinstance(children[0], str):
                 props["tag"] = children[0]
                 children = []
             else:
                 raise AttributeError(
                     f"Passing multiple children to Icon component is not allowed: remove positional arguments {children[1:]} to fix"
                 )
-        if "tag" not in props.keys():
+        if "tag" not in props:
             raise AttributeError("Missing 'tag' keyword-argument for Icon")
 
         if (
-            type(props["tag"]) != str
+            not isinstance(props["tag"], str)
             or map_deprecated_icon_names_05(format.to_snake_case(props["tag"]))
             not in LUCIDE_ICON_LIST
         ):
diff --git a/reflex/components/markdown/markdown.py b/reflex/components/markdown/markdown.py
index 933b7375698..ca54d0aa5da 100644
--- a/reflex/components/markdown/markdown.py
+++ b/reflex/components/markdown/markdown.py
@@ -102,8 +102,8 @@ def create(cls, *children, **props) -> Component:
         Returns:
             The markdown component.
         """
-        assert len(children) == 1 and types._isinstance(
-            children[0], Union[str, Var]
+        assert (
+            len(children) == 1 and types._isinstance(children[0], Union[str, Var])
         ), "Markdown component must have exactly one child containing the markdown source."
 
         # Custom styles are deprecated.
@@ -257,9 +257,7 @@ def format_component_map(self) -> dict[str, str]:
         }
 
         # Separate out inline code and code blocks.
-        components[
-            "code"
-        ] = f"""{{({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{
+        components["code"] = f"""{{({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{
     const match = (className || '').match(/language-(?<lang>.*)/);
     const language = match ? match[1] : '';
     if (language) {{
@@ -277,9 +275,7 @@ def format_component_map(self) -> dict[str, str]:
     ) : (
         {self.format_component("codeblock", language=Var.create_safe("language", _var_is_local=False))}
     );
-      }}}}""".replace(
-            "\n", " "
-        )
+      }}}}""".replace("\n", " ")
 
         return components
 
diff --git a/reflex/components/radix/themes/components/icon_button.py b/reflex/components/radix/themes/components/icon_button.py
index 47dc1be86c4..13b09411016 100644
--- a/reflex/components/radix/themes/components/icon_button.py
+++ b/reflex/components/radix/themes/components/icon_button.py
@@ -57,7 +57,7 @@ def create(cls, *children, **props) -> Component:
             The IconButton component.
         """
         if children:
-            if type(children[0]) == str:
+            if isinstance(children[0], str):
                 children = [
                     Icon.create(
                         children[0],
@@ -68,7 +68,7 @@ def create(cls, *children, **props) -> Component:
                 "IconButton requires a child icon. Pass a string as the first child or a rx.icon."
             )
         if "size" in props:
-            if type(props["size"]) == str:
+            if isinstance(props["size"], str):
                 RADIX_TO_LUCIDE_SIZE = {
                     "1": "12px",
                     "2": "24px",
diff --git a/reflex/components/radix/themes/components/radio_group.py b/reflex/components/radix/themes/components/radio_group.py
index 15c378aaff5..965e6755f92 100644
--- a/reflex/components/radix/themes/components/radio_group.py
+++ b/reflex/components/radix/themes/components/radio_group.py
@@ -145,11 +145,7 @@ def create(
 
         # convert only non-strings to json(JSON.stringify) so quotes are not rendered
         # for string literal types.
-        if (
-            type(default_value) is str
-            or isinstance(default_value, Var)
-            and default_value._var_type is str
-        ):
+        if isinstance(default_value, str) or (isinstance(default_value, Var) and default_value._var_type is str):
             default_value = Var.create(default_value, _var_is_string=True)  # type: ignore
         else:
             default_value = (
diff --git a/reflex/custom_components/custom_components.py b/reflex/custom_components/custom_components.py
index 687ee994d92..39d5d16202e 100644
--- a/reflex/custom_components/custom_components.py
+++ b/reflex/custom_components/custom_components.py
@@ -555,7 +555,6 @@ def _ensure_dist_dir(version_to_publish: str, build: bool):
     if build:
         # Need to check if the files here are for the version to be published.
         if dist_dir.exists():
-
             # Check if the distribution files are for the version to be published.
             needs_rebuild = False
             for suffix in CustomComponents.DISTRIBUTION_FILE_SUFFIXES:
diff --git a/reflex/event.py b/reflex/event.py
index bef86cdc5b5..057355c9828 100644
--- a/reflex/event.py
+++ b/reflex/event.py
@@ -169,7 +169,7 @@ def __call__(self, *args: Var) -> EventSpec:
 
             # Otherwise, convert to JSON.
             try:
-                values.append(Var.create(arg, _var_is_string=type(arg) is str))
+                values.append(Var.create(arg, _var_is_string=isinstance(arg, str)))
             except TypeError as e:
                 raise TypeError(
                     f"Arguments to event handlers must be Vars or JSON-serializable. Got {arg} of type {type(arg)}."
@@ -350,7 +350,9 @@ def as_event_spec(self, handler: EventHandler) -> EventSpec:
                 ]
             elif isinstance(on_upload_progress, Callable):
                 # Call the lambda to get the event chain.
-                events = call_event_fn(on_upload_progress, self.on_upload_progress_args_spec)  # type: ignore
+                events = call_event_fn(
+                    on_upload_progress, self.on_upload_progress_args_spec
+                )  # type: ignore
             else:
                 raise ValueError(f"{on_upload_progress} is not a valid event handler.")
             on_upload_progress_chain = EventChain(
@@ -400,7 +402,7 @@ def fn():
     return EventSpec(
         handler=EventHandler(fn=fn),
         args=tuple(
-            (Var.create_safe(k), Var.create_safe(v, _var_is_string=type(v) is str))
+            (Var.create_safe(k), Var.create_safe(v, _var_is_string=isinstance(v, str)))
             for k, v in kwargs.items()
         ),
     )
diff --git a/reflex/reflex.py b/reflex/reflex.py
index d11dc6ab335..960d19fbdac 100644
--- a/reflex/reflex.py
+++ b/reflex/reflex.py
@@ -528,7 +528,12 @@ def deploy(
 
     hosting_cli.deploy(
         app_name=app_name,
-        export_fn=lambda zip_dest_dir, api_url, deploy_url, frontend, backend, zipping: export_utils.export(
+        export_fn=lambda zip_dest_dir,
+        api_url,
+        deploy_url,
+        frontend,
+        backend,
+        zipping: export_utils.export(
             zip_dest_dir=zip_dest_dir,
             api_url=api_url,
             deploy_url=deploy_url,
diff --git a/reflex/utils/console.py b/reflex/utils/console.py
index 82339f95e35..a541030643f 100644
--- a/reflex/utils/console.py
+++ b/reflex/utils/console.py
@@ -174,7 +174,9 @@ def ask(
     Returns:
         A string with the user input.
     """
-    return Prompt.ask(question, choices=choices, default=default, show_choices=show_choices)  # type: ignore
+    return Prompt.ask(
+        question, choices=choices, default=default, show_choices=show_choices
+    )  # type: ignore
 
 
 def progress():
diff --git a/reflex/utils/format.py b/reflex/utils/format.py
index 5d554fe55af..70f6b5b2517 100644
--- a/reflex/utils/format.py
+++ b/reflex/utils/format.py
@@ -330,7 +330,7 @@ def format_cond(
     cond = f"isTrue({cond})"
 
     def create_var(cond_part):
-        return Var.create_safe(cond_part, _var_is_string=type(cond_part) is str)
+        return Var.create_safe(cond_part, _var_is_string=isinstance(cond_part, str))
 
     # Format prop conds.
     if is_prop:
diff --git a/reflex/utils/imports.py b/reflex/utils/imports.py
index 8d678b4eb0f..628b3543760 100644
--- a/reflex/utils/imports.py
+++ b/reflex/utils/imports.py
@@ -66,7 +66,9 @@ def name(self) -> str:
             The name(tag name with alias) of tag.
         """
         if self.alias:
-            return self.alias if self.is_default else " as ".join([self.tag, self.alias])  # type: ignore
+            return (
+                self.alias if self.is_default else " as ".join([self.tag, self.alias])
+            )  # type: ignore
         else:
             return self.tag or ""
 
diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py
index e69eb3c5a0b..8f80ca0e497 100644
--- a/reflex/utils/prerequisites.py
+++ b/reflex/utils/prerequisites.py
@@ -1182,18 +1182,18 @@ def _get_rx_chakra_component_to_migrate() -> set[str]:
         rx_chakra_object = getattr(reflex.chakra, rx_chakra_name)
         try:
             if (
-                inspect.ismethod(rx_chakra_object)
-                and inspect.isclass(rx_chakra_object.__self__)
-                and issubclass(rx_chakra_object.__self__, ChakraComponent)
-            ):
-                names_to_migrate.add(rx_chakra_name)
-
-            elif inspect.isclass(rx_chakra_object) and issubclass(
-                rx_chakra_object, ChakraComponent
+                (
+                    inspect.ismethod(rx_chakra_object)
+                    and inspect.isclass(rx_chakra_object.__self__)
+                    and issubclass(rx_chakra_object.__self__, ChakraComponent)
+                )
+                or (
+                    inspect.isclass(rx_chakra_object)
+                    and issubclass(rx_chakra_object, ChakraComponent)
+                )
+                or rx_chakra_name in whitelist
             ):
                 names_to_migrate.add(rx_chakra_name)
-            elif rx_chakra_name in whitelist:
-                names_to_migrate.add(rx_chakra_name)
 
         except Exception:
             raise
diff --git a/reflex/utils/processes.py b/reflex/utils/processes.py
index c08901b7eb4..dfe3f5cc632 100644
--- a/reflex/utils/processes.py
+++ b/reflex/utils/processes.py
@@ -137,7 +137,9 @@ def new_process(args, run: bool = False, show_logs: bool = False, **kwargs):
     # Add the node bin path to the PATH environment variable.
     env = {
         **os.environ,
-        "PATH": os.pathsep.join([node_bin_path if node_bin_path else "", os.environ["PATH"]]),  # type: ignore
+        "PATH": os.pathsep.join(
+            [node_bin_path if node_bin_path else "", os.environ["PATH"]]
+        ),  # type: ignore
         **kwargs.pop("env", {}),
     }
     kwargs = {
diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py
index 20869697917..a7f8acb63f2 100644
--- a/reflex/utils/pyi_generator.py
+++ b/reflex/utils/pyi_generator.py
@@ -738,9 +738,7 @@ def _write_pyi_file(self, module_path: Path, source: str):
                 mode=black.mode.Mode(is_pyi=True),
             ).splitlines():
                 # Bit of a hack here, since the AST cannot represent comments.
-                if "def create(" in formatted_line:
-                    pyi_content.append(formatted_line + "  # type: ignore")
-                elif "Figure" in formatted_line:
+                if "def create(" in formatted_line or "Figure" in formatted_line:
                     pyi_content.append(formatted_line + "  # type: ignore")
                 else:
                     pyi_content.append(formatted_line)
diff --git a/reflex/utils/serializers.py b/reflex/utils/serializers.py
index a9312957a89..1e1de7507b4 100644
--- a/reflex/utils/serializers.py
+++ b/reflex/utils/serializers.py
@@ -359,7 +359,7 @@ def serialize_image(image: Img) -> str:
                 mime_type = MIME[image_format]
             except KeyError:
                 # Unknown mime_type: warn and return image/png and hope the browser can sort it out.
-                warnings.warn(
+                warnings.warn(  # noqa: B028
                     f"Unknown mime type for {image} {image_format}. Defaulting to image/png"
                 )
                 mime_type = "image/png"
diff --git a/reflex/utils/types.py b/reflex/utils/types.py
index bf175524667..413a88dd818 100644
--- a/reflex/utils/types.py
+++ b/reflex/utils/types.py
@@ -193,7 +193,7 @@ def get_attribute_access_type(cls: GenericType, name: str) -> GenericType | None
         insp = sqlalchemy.inspect(cls)
         if name in insp.columns:
             return insp.columns[name].type.python_type
-        if name not in insp.all_orm_descriptors.keys():
+        if name not in insp.all_orm_descriptors:
             return None
         descriptor = insp.all_orm_descriptors[name]
         if hint := get_property_hint(descriptor):
diff --git a/reflex/vars.py b/reflex/vars.py
index acbaa5e29e1..6a2efce592d 100644
--- a/reflex/vars.py
+++ b/reflex/vars.py
@@ -818,14 +818,20 @@ def get_operand_full_name(operand):
             if fn is not None:
                 if invoke_fn:
                     # invoke the function on left operand.
-                    operation_name = f"{left_operand_full_name}.{fn}({right_operand_full_name})"  # type: ignore
+                    operation_name = (
+                        f"{left_operand_full_name}.{fn}({right_operand_full_name})"
+                    )  # type: ignore
                 else:
                     # pass the operands as arguments to the function.
-                    operation_name = f"{left_operand_full_name} {op} {right_operand_full_name}"  # type: ignore
+                    operation_name = (
+                        f"{left_operand_full_name} {op} {right_operand_full_name}"
+                    )  # type: ignore
                     operation_name = f"{fn}({operation_name})"
             else:
                 # apply operator to operands (left operand <operator> right_operand)
-                operation_name = f"{left_operand_full_name} {op} {right_operand_full_name}"  # type: ignore
+                operation_name = (
+                    f"{left_operand_full_name} {op} {right_operand_full_name}"
+                )  # type: ignore
                 operation_name = format.wrap(operation_name, "(")
         else:
             # apply operator to left operand (<operator> left_operand)
diff --git a/tests/compiler/test_compiler.py b/tests/compiler/test_compiler.py
index 137ff04d347..c29e2946c6e 100644
--- a/tests/compiler/test_compiler.py
+++ b/tests/compiler/test_compiler.py
@@ -208,7 +208,9 @@ def test_create_document_root():
         utils.NextScript.create(src="foo.js"),
         utils.NextScript.create(src="bar.js"),
     ]
-    root = utils.create_document_root(head_components=comps, html_lang="rx", html_custom_attrs={"project": "reflex"})  # type: ignore
+    root = utils.create_document_root(
+        head_components=comps, html_lang="rx", html_custom_attrs={"project": "reflex"}
+    )  # type: ignore
     # Two children in head.
     assert isinstance(root, utils.Html)
     assert len(root.children[0].children) == 2
diff --git a/tests/components/core/test_colors.py b/tests/components/core/test_colors.py
index 717d41de795..a98d4e86afc 100644
--- a/tests/components/core/test_colors.py
+++ b/tests/components/core/test_colors.py
@@ -31,7 +31,9 @@ def create_color_var(color):
             "var(--${state__color_state.color}-${state__color_state.shade})",
         ),
         (
-            create_color_var(rx.color(f"{ColorState.color_part}ato", f"{ColorState.shade}")),  # type: ignore
+            create_color_var(
+                rx.color(f"{ColorState.color_part}ato", f"{ColorState.shade}")
+            ),  # type: ignore
             "var(--${state__color_state.color_part}ato-${state__color_state.shade})",
         ),
         (
@@ -39,7 +41,9 @@ def create_color_var(color):
             "var(--${state__color_state.color}-${state__color_state.shade})",
         ),
         (
-            create_color_var(f'{rx.color(f"{ColorState.color}", f"{ColorState.shade}")}'),  # type: ignore
+            create_color_var(
+                f'{rx.color(f"{ColorState.color}", f"{ColorState.shade}")}'
+            ),  # type: ignore
             "var(--${state__color_state.color}-${state__color_state.shade})",
         ),
     ],
diff --git a/tests/utils/test_types.py b/tests/utils/test_types.py
index f701f810d68..3ad3a26e178 100644
--- a/tests/utils/test_types.py
+++ b/tests/utils/test_types.py
@@ -13,7 +13,6 @@
     ],
 )
 def test_validate_literal_error_msg(params, allowed_value_str, value_str):
-
     with pytest.raises(ValueError) as err:
         types.validate_literal(*params)
 


Code review comments:
diff_hunk: @@ -1082,7 +1082,7 @@ class CodeBlock(Component):
         on_unmount: Optional[
             Union[EventHandler, EventSpec, list, function, BaseVar]
         ] = None,
-        **props
+        **props,
path: reflex/components/datadisplay/code.pyi
text: @user1:
```suggestion
        **props
```