mirror of
https://gitlab.com/simple-stock-bots/simple-stock-bot.git
synced 2026-06-03 21:00:26 +00:00
Apply ruff linting fixes and add pytest-asyncio
- Add pytest-asyncio to dev-reqs.txt for async test support - Fix ruff formatting issues in symbol_router.py - Fix ruff formatting issues in D_info.py and T_info.py - Remove unused imports from test files (fixed by ruff --fix) - Minor code style fixes in bot files Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
"""Function that routes symbols to the correct API provider.
|
||||
"""
|
||||
"""Function that routes symbols to the correct API provider."""
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
|
||||
@@ -9,3 +9,4 @@ types-cachetools==5.3.0.6
|
||||
types-pytz==2023.3.1.1
|
||||
ruff==0.15.2
|
||||
pytest==9.0.2
|
||||
pytest-asyncio==0.25.3
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
"""Functions and Info specific to the discord Bot
|
||||
"""
|
||||
"""Functions and Info specific to the discord Bot"""
|
||||
|
||||
import re
|
||||
|
||||
|
||||
+3
-5
@@ -42,7 +42,7 @@ async def status(ctx: commands):
|
||||
message = ""
|
||||
try:
|
||||
message = "Contact MisterBiggs#0465 if you need help.\n"
|
||||
message += s.status(f"Bot recieved your message in: {bot.latency*10:.4f} seconds") + "\n"
|
||||
message += s.status(f"Bot recieved your message in: {bot.latency * 10:.4f} seconds") + "\n"
|
||||
|
||||
except Exception as ex:
|
||||
logging.critical(ex)
|
||||
@@ -217,9 +217,7 @@ async def handle_options(message, symbols):
|
||||
embed = nextcord.Embed(title=options_data["Option Symbol"], description=options_data["Underlying"], color=0x3498DB)
|
||||
|
||||
# Key details
|
||||
details = (
|
||||
f"Expiration: {options_data['Expiration']}\n" f"Side: {options_data['side']}\n" f"Strike: {options_data['strike']}"
|
||||
)
|
||||
details = f"Expiration: {options_data['Expiration']}\nSide: {options_data['side']}\nStrike: {options_data['strike']}"
|
||||
embed.add_field(name="Details", value=details, inline=False)
|
||||
|
||||
# Pricing info
|
||||
@@ -232,7 +230,7 @@ async def handle_options(message, symbols):
|
||||
embed.add_field(name="Pricing", value=pricing_info, inline=False)
|
||||
|
||||
# Volume and open interest
|
||||
volume_info = f"Open Interest: {options_data['Open Interest']}\n" f"Volume: {options_data['Volume']}"
|
||||
volume_info = f"Open Interest: {options_data['Open Interest']}\nVolume: {options_data['Volume']}"
|
||||
embed.add_field(name="Activity", value=volume_info, inline=False)
|
||||
|
||||
# Greeks
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
"""Functions and Info specific to the Telegram Bot
|
||||
"""
|
||||
"""Functions and Info specific to the Telegram Bot"""
|
||||
|
||||
import re
|
||||
|
||||
|
||||
+1
-1
@@ -232,7 +232,7 @@ def generate_options_reply(options_data: dict):
|
||||
message_text += pricing_info
|
||||
|
||||
# Volume and open interest
|
||||
volume_info = f"*Open Interest:* `{options_data['Open Interest']}`\n" f"*Volume:* `{options_data['Volume']}`\n\n"
|
||||
volume_info = f"*Open Interest:* `{options_data['Open Interest']}`\n*Volume:* `{options_data['Volume']}`\n\n"
|
||||
message_text += volume_info
|
||||
|
||||
# Greeks
|
||||
|
||||
Reference in New Issue
Block a user