Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

use ruff #992

Merged
merged 8 commits into from
Apr 12, 2024
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
33 changes: 0 additions & 33 deletions .flake8

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
docker-compose up -d --build backend
- name: Lint the code
run: |
docker-compose run --rm backend black --check .
docker-compose run --rm backend flake8
docker-compose run --rm backend ruff format --check
docker-compose run --rm backend ruff check . --output-format=github
- name: Check for missing migrations
run: docker-compose run --rm backend python manage.py makemigrations --check --dry-run --no-input
- name: Run pytest
Expand Down
18 changes: 0 additions & 18 deletions .pre-commit-config.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ etc.

```bash
# linting
flake8
ruff check
# format code
black .
ruff format .
# running tests
pytest
# create migrations
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ stop: ## Stop the development server

.PHONY: lint
lint: ## Lint the project
@docker-compose exec backend sh -c "black --check . && flake8"
@docker-compose run --rm backend sh -c "ruff format --check . && ruff check . --output-format=full"

.PHONY: format-code
format-code: ## Format the backend code
@docker-compose exec backend sh -c "black . && isort ."
@docker-compose run --rm backend sh -c "ruff format . && ruff check . --fix"

.PHONY: test
test: ## Test the project
@docker-compose exec backend sh -c "black . && isort . && pytest --no-cov-on-fail --cov"
@docker-compose run --rm backend sh -c "ruff format . && ruff lint . --fix && pytest --no-cov-on-fail --cov"

.PHONY: bash
bash: ## Shell into the backend
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://github.com/adfinis/timed-backend/workflows/Test/badge.svg)](https://github.com/adfinis/timed-backend/actions?query=workflow%3A%22Test%22)
[![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen.svg)](https://github.com/adfinis/timed-backend/blob/master/setup.cfg)
[![Pyup](https://pyup.io/repos/github/adfinis/timed-backend/shield.svg)](https://pyup.io/account/repos/github/adfinis/timed-backend/)
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/adfinis/timed-backend)
[![Ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/adfinis/timed-backend)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)

Timed timetracking software REST API built with Django
Expand Down
Loading
Loading