Skip to content

Commit

Permalink
fix: fmt in justfile (#24)
Browse files Browse the repository at this point in the history
* fix: fmt in justfile

* fix: run fmt

* fix: run fmt

* bump version
  • Loading branch information
seblum authored Jul 3, 2024
1 parent 0394c75 commit 70a2337
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
3 changes: 1 addition & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ test:

# Format code using Poetry and black
fmt:
poetry run black .
poetry run ruff
poetry run ruff check . --fix

# Clean up generated files
@clean:
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "slotBooker"
version = "2.2.0"
version = "2.2.1"
description = ""
authors = ["Sebastian Blum <hello@seblum.com>"]
packages = [{include = "slotbooker", from = "src"}]
Expand Down Expand Up @@ -32,8 +32,8 @@ requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.ruff]
select = ["E", "F", "W", "C", "N", "Q"]
ignore = ["E501"] # ignore line length for example
lint.select = ["E", "F", "W", "C", "N", "Q"]
lint.ignore = ["E501"] # ignore line length for example
line-length = 88

# Exclude some directories from linting
Expand Down
4 changes: 2 additions & 2 deletions src/slotbooker/utils/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from selenium.webdriver.chrome.service import Service


def get_driver(chromedriver: str,env:str="prd") -> object:
def get_driver(chromedriver: str, env: str = "prd") -> object:
"""Sets the Google ChromeDriver with headless support enabled
Args:
Expand All @@ -19,7 +19,7 @@ def get_driver(chromedriver: str,env:str="prd") -> object:
options.add_experimental_option("detach", True)
if env != "dev":
options.add_argument("--headless") # needs to be set to run in docker image

# added for lambda | if run locally not working.
# options.add_argument("--window-size=1280x1696")
# options.add_argument("--single-process")
Expand Down
2 changes: 1 addition & 1 deletion src/slotbooker/utils/gmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import smtplib


def send_logs_to_mail(filename: str,response:str) -> None:
def send_logs_to_mail(filename: str, response: str) -> None:
"""Send an email with the content of the specified file as the email body.
Args:
Expand Down
10 changes: 6 additions & 4 deletions src/slotbooker/utils/html_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ def format_to_html(body) -> str:
info_match = regex_info.search(line)
warning_match = regex_warning.search(line)
error_match = regex_error.search(line)

if timestamp_match:
timestamp = timestamp_match.group(1)

if info_match:
log_type = "Info"
message = info_match.group(1)
Expand All @@ -78,8 +78,10 @@ def format_to_html(body) -> str:
else:
log_type = "Unknown"
message = ""

html_rows += f"<tr><td>{timestamp}</td><td>{log_type}</td><td>{message}</td></tr>"

html_rows += (
f"<tr><td>{timestamp}</td><td>{log_type}</td><td>{message}</td></tr>"
)

# Complete HTML content
html_content = html_template.format(html_rows)
Expand Down
3 changes: 2 additions & 1 deletion src/slotbooker/utils/settings.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import os


# Function to set credentials
def set_credentials():
input_username = input("Insert username: ")
input_password = input("Insert password: ")

# Set environment variables
os.environ["OCTIV_USERNAME"] = input_username
os.environ["OCTIV_PASSWORD"] = input_password

0 comments on commit 70a2337

Please sign in to comment.