-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format and add linting rules/github action
Signed-off-by: jamshale <jamiehalebc@gmail.com>
- Loading branch information
Showing
18 changed files
with
303 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Ruff Code Formatter and Linting Check | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Ruff Format and Lint Check | ||
uses: astral-sh/ruff-action@v3 | ||
with: | ||
src: "./server" | ||
version: "0.9.1" | ||
args: "format --check" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
"""This module contains dependencies used by the FastAPI application.""" | ||
|
||
from fastapi import HTTPException | ||
from config import settings | ||
|
||
from app.plugins import AskarStorage | ||
|
||
|
||
async def identifier_available(did: str): | ||
"""Check if a DID identifier is available.""" | ||
if await AskarStorage().fetch("didDocument", did): | ||
raise HTTPException(status_code=409, detail="Identifier unavailable.") | ||
|
||
|
||
async def did_document_exists(did: str): | ||
"""Check if a DID document exists.""" | ||
if not await AskarStorage().fetch("didDocument", did): | ||
raise HTTPException(status_code=404, detail="Ressource not found.") | ||
raise HTTPException(status_code=404, detail="Resource not found.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.