Skip to content

Commit

Permalink
Setup ruff formater (#175)
Browse files Browse the repository at this point in the history
* style(api): format through ruff
* build(pre-commit): setup ruff formatted

closes: #163
  • Loading branch information
Lee-W authored Nov 30, 2023
1 parent 87cce4f commit 5870441
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
13 changes: 7 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ repos:
additional_dependencies: [black>=22.10.0]
types: [markdown]

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.1.3'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.6'
hooks:
- id: ruff
args:
- --config=./pyproject.toml
types: [python]
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
Expand Down
5 changes: 0 additions & 5 deletions airflow/ruff.toml

This file was deleted.

1 change: 1 addition & 0 deletions api/ask_astro/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ZendeskConfig:

class SlackAppConfig:
"Contains the config variables for the Slack app."

client_id = os.environ.get("SLACK_CLIENT_ID")
client_secret = os.environ.get("SLACK_CLIENT_SECRET")
signing_secret = os.environ.get("SLACK_SIGNING_SECRET")
Expand Down
6 changes: 4 additions & 2 deletions api/ask_astro/services/questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ async def _update_firestore_request(request: AskAstroRequest) -> None:
:param request: The AskAstroRequest object to update in Firestore.
"""
await firestore_client.collection(FirestoreCollections.requests).document(str(request.uuid)).set(
request.to_firestore()
await (
firestore_client.collection(FirestoreCollections.requests)
.document(str(request.uuid))
.set(request.to_firestore())
)


Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ extend-select = [
"A", # flake8-builtins
"UP", # pyupgrade
]
extend-ignore = ["A002", "C901"]
extend-ignore = ["A002", "C901", "ISC001"]


# Exclude a variety of commonly ignored directories.
extend-exclude = [
Expand Down

0 comments on commit 5870441

Please sign in to comment.