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

chore: add configuration files #2

Merged
merged 3 commits into from
Jul 25, 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
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 120
max-complexity = 10
exclude = .git,__pycache__,*/migrations/*,.venv
2 changes: 1 addition & 1 deletion .github/workflows/linting-and-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
test:
runs-on: ubuntu-latest
name: Flagsmith Workflows Unit Tests
name: Linting and Formatting

steps:
- name: Cloning repo
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.venv/
.env
.idea/
*.pyc
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
repos:
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 7.1.0
hooks:
- id: flake8
- repo: https://github.com/python-poetry/poetry
rev: 1.7.1
hooks:
- id: poetry-check
- id: poetry-lock
args: ['--check']
7 changes: 4 additions & 3 deletions common/features/serializers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from django.apps import apps
from drf_writable_nested.serializers import WritableNestedModelSerializer
from rest_framework import serializers

from django.apps import apps

from common.features.multivariate.serializers import MultivariateFeatureStateValueSerializer
from common.features.multivariate.serializers import (
MultivariateFeatureStateValueSerializer,
)


class FeatureStateValueSerializer(serializers.ModelSerializer):
Expand Down
4 changes: 3 additions & 1 deletion common/features/versioning/serializers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from common.features.serializers import CreateSegmentOverrideFeatureStateSerializer
from common.features.serializers import (
CreateSegmentOverrideFeatureStateSerializer,
)


class EnvironmentFeatureVersionFeatureStateSerializer(
Expand Down
91 changes: 53 additions & 38 deletions poetry.lock

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

36 changes: 33 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,40 @@ djangorestframework = "*"
drf-writable-nested = "*"

[tool.poetry.group.dev.dependencies]
pre-commit = "^3.0.4"
flake8 = "~6.0.0"
black = "~23.7.0"
pre-commit = "*"
flake8 = "*"
black = "*"
isort = "*"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 88
target-version = ['py311', 'py312']
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| migrations
)/
'''

[tool.isort]
use_parentheses=true
multi_line_output=3
include_trailing_comma=true
line_length=79
known_first_party=['flagsmith','api','app','core','features','environments']
known_third_party=['django', 'rest_framework', 'saml2', 'drf_yasg2', 'pytest']
skip = ['migrations', '.venv']
Loading