Skip to content
This repository was archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Switch flake8+isort out for ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelhwilliams committed Dec 8, 2024
1 parent 0a6fcee commit 0794d56
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 125 deletions.
22 changes: 8 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
repos:
- repo: https://github.com/ambv/black
rev: 24.3.0
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version. If bumping this, please also bump requirements-dev.in
rev: v0.7.4
hooks:
- id: black
language_version: python3
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies: [Flake8-pyproject]
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-ast
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.24.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion app/blueprints/assessments/models/applicants_response.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flake8: noqa

import re
from abc import ABC
from abc import abstractmethod
Expand Down
2 changes: 1 addition & 1 deletion config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flake8: noqa

import os

FLASK_ENV = os.getenv("FLASK_ENV")
Expand Down
31 changes: 23 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,43 @@ dependencies = [
"xhtml2pdf==0.2.16",
]

[tool.isort]
profile = "black"
force_single_line = "true"
[tool.ruff]
line-length = 120

[tool.flake8]
max-line-length = 120
count = true
target-version = "py310"

[tool.ruff.lint]
select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C90", # mccabe cyclomatic complexity
"G", # flake8-logging-format
]
ignore = []
exclude = [
"db/migrations/versions/",
"venv*",
".venv*",
"__pycache__",
]
mccabe.max-complexity = 12

[tool.uv]

[dependency-groups]
dev = [
"beautifulsoup4==4.12.2",
"black==24.8.0",
"boto3==1.35.7",
"debugpy==1.8.5",
"deepdiff==8.0.0",
"flake8-pyproject==1.2.3",
"invoke==2.2.0",
"pre-commit==4.0.1",
"pytest==8.3.2",
"pytest-env==1.1.3",
"pytest-flask==1.3.0",
"pytest-mock==3.14.0",
"ruff>=0.8.2",
]
2 changes: 1 addition & 1 deletion tests/api_data/example_application_answers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flake8: noqa


test_application_answers = {
"feasibility": {
Expand Down
2 changes: 1 addition & 1 deletion tests/api_data/example_get_full_application.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flake8: noqa

mock_full_application_json = {
"application_id": "1b43e6c2-581a-4e35-b88b-26e212db64cf",
"application_json_md5": "f5e70b95e16d1b58c79c70aabb7f1fd7",
Expand Down
2 changes: 1 addition & 1 deletion tests/api_data/test_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flake8: noqa

# There is config for any linked information shared across the mock api queries
# General config
from dataclasses import dataclass
Expand Down
126 changes: 28 additions & 98 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0794d56

Please sign in to comment.