Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup ruff formater #175

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading