Skip to content

Commit

Permalink
feat[ci/cd]: add ruff text formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
iamogab committed Nov 26, 2024
1 parent 4f6d313 commit 1bb2dce
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Code Format Checker
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Install Ruff
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Run Ruff Format
run: |
ruff format --line-length 120 --check . --exclude xray_api,app/db/migrations/versions
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Backend is built using FastAPI and uses SQLAlchemy as the ORM for database opera
### Python Code Formatting
To maintain consistency in the codebase, we require all code to be formatted using
```bash
autopep8 <file> --max-line-length 120
ruff format --line-length 120 --check . --exclude xray_api,app/db/migrations/versions
```

## Frontend
Expand Down

0 comments on commit 1bb2dce

Please sign in to comment.