From a2b0b386c586bcd58b26365cf0c50015f72aae36 Mon Sep 17 00:00:00 2001 From: Kyle Gottfried <6462596+Spitfire1900@users.noreply.github.com> Date: Fri, 22 Mar 2024 22:45:39 -0400 Subject: [PATCH] yapf format --- pyproject.toml | 8 ++++++++ xontrib_pygitstatus/event_hooks.py | 3 ++- xontrib_pygitstatus/main.py | 3 --- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 34e41cd..d2de2c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,3 +87,11 @@ select = [ "TCH", # flake8-type-checking "RUF", # ruff specific rules ] + +[tool.yapf] +based_on_style = "pep8" +column_limit = "120" +coalesce_brackets = "True" +each_dict_entry_on_separate_line = "False" +dedent_closing_brackets = "False" +split_before_named_assigns = "False" diff --git a/xontrib_pygitstatus/event_hooks.py b/xontrib_pygitstatus/event_hooks.py index 34fbb22..3b8e33c 100644 --- a/xontrib_pygitstatus/event_hooks.py +++ b/xontrib_pygitstatus/event_hooks.py @@ -1,9 +1,10 @@ -def activate_env(path:str): +def activate_env(path: str): # lazy import to reduce startup cost from xontrib.voxapi import Vox vox = Vox() vox.activate(path) + def listen_cd(olddir, newdir, **_): activate_env(newdir) diff --git a/xontrib_pygitstatus/main.py b/xontrib_pygitstatus/main.py index a48a190..627a277 100644 --- a/xontrib_pygitstatus/main.py +++ b/xontrib_pygitstatus/main.py @@ -7,8 +7,5 @@ def _load_xontrib_(xsh: XonshSession, **_): print("Autoloading xontrib: xontrib-pygitstatus") - from .event_hooks import listen_cd xsh.builtins.events.on_chdir(listen_cd) - -