Skip to content

Commit 88babfe

Browse files
style: auto-format with ruff
1 parent 2fc528e commit 88babfe

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

codeflash/code_utils/env_utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
def check_formatter_installed(
1616
formatter_cmds: list[str], exit_on_failure: bool = True, language: str = "python"
1717
) -> bool:
18-
from codeflash.cli_cmds.console import logger # noqa: PLC0415
19-
from codeflash.code_utils.formatter import format_code # noqa: PLC0415
20-
from codeflash.languages.registry import get_language_support_by_common_formatters # noqa: PLC0415
18+
from codeflash.cli_cmds.console import logger
19+
from codeflash.code_utils.formatter import format_code
20+
from codeflash.languages.registry import get_language_support_by_common_formatters
2121

2222
if not formatter_cmds or formatter_cmds[0] == "disabled":
2323
return True
@@ -68,7 +68,7 @@ def check_formatter_installed(
6868

6969
@lru_cache(maxsize=1)
7070
def get_codeflash_api_key() -> str:
71-
from codeflash.cli_cmds.console import logger # noqa: PLC0415
71+
from codeflash.cli_cmds.console import logger
7272

7373
# Check environment variable first
7474
env_api_key = os.environ.get("CODEFLASH_API_KEY")
@@ -79,7 +79,7 @@ def get_codeflash_api_key() -> str:
7979
# If we have an env var but it's not in shell config, save it for persistence
8080
if env_api_key and not shell_api_key:
8181
try:
82-
from codeflash.either import is_successful # noqa: PLC0415
82+
from codeflash.either import is_successful
8383

8484
logger.debug("env_utils.py:get_codeflash_api_key - Saving API key from environment to shell config")
8585
result = save_api_key_to_rc(env_api_key)
@@ -108,7 +108,7 @@ def get_codeflash_api_key() -> str:
108108
f"{api_secret_docs_message}"
109109
)
110110
if is_repo_a_fork():
111-
from codeflash.code_utils.code_utils import exit_with_message # noqa: PLC0415
111+
from codeflash.code_utils.code_utils import exit_with_message
112112

113113
msg = (
114114
"Codeflash API key not detected in your environment. It appears you're running Codeflash from a GitHub fork.\n"
@@ -128,7 +128,7 @@ def get_codeflash_api_key() -> str:
128128

129129

130130
def ensure_codeflash_api_key() -> bool:
131-
from codeflash.cli_cmds.console import logger # noqa: PLC0415
131+
from codeflash.cli_cmds.console import logger
132132

133133
try:
134134
get_codeflash_api_key()

codeflash/code_utils/shell_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def is_powershell() -> bool:
4040
2. COMSPEC pointing to powershell.exe
4141
3. TERM_PROGRAM indicating Windows Terminal (often uses PowerShell)
4242
"""
43-
from codeflash.cli_cmds.console import logger # noqa: PLC0415
43+
from codeflash.cli_cmds.console import logger
4444

4545
if os.name != "nt":
4646
return False
@@ -73,7 +73,7 @@ def is_powershell() -> bool:
7373

7474
def read_api_key_from_shell_config() -> Optional[str]:
7575
"""Read API key from shell configuration file."""
76-
from codeflash.cli_cmds.console import logger # noqa: PLC0415
76+
from codeflash.cli_cmds.console import logger
7777

7878
shell_rc_path = get_shell_rc_path()
7979
# Ensure shell_rc_path is a Path object for consistent handling
@@ -130,7 +130,7 @@ def get_api_key_export_line(api_key: str) -> str:
130130

131131
def save_api_key_to_rc(api_key: str) -> Result[str, str]:
132132
"""Save API key to the appropriate shell configuration file."""
133-
from codeflash.cli_cmds.console import logger # noqa: PLC0415
133+
from codeflash.cli_cmds.console import logger
134134

135135
shell_rc_path = get_shell_rc_path()
136136
# Ensure shell_rc_path is a Path object for consistent handling

0 commit comments

Comments
 (0)