Skip to content

Commit

Permalink
Update hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Jun 19, 2024
1 parent f5264f6 commit 2ba84b5
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 69 deletions.
25 changes: 8 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exclude: ".yarn/|yarn.lock|\\.min\\.(css|js)$"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-builtin-literals
Expand All @@ -14,35 +14,26 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.16.0
rev: 1.18.0
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.2"
rev: "v0.4.9"
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
args: [--list-different, --no-semi]
exclude: "^conf/|.*\\.html$"
- repo: https://github.com/biomejs/pre-commit
rev: "v0.1.0"
rev: "v0.4.0"
hooks:
- id: biome-check
additional_dependencies: ["@biomejs/[email protected]"]
additional_dependencies: ["@biomejs/[email protected]"]
args: [--unsafe]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.7.0
rev: 2.1.3
hooks:
- id: pyproject-fmt
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
rev: v0.18
hooks:
- id: validate-pyproject
19 changes: 16 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"$schema": "https://biomejs.dev/schemas/1.8.1/schema.json",
"organizeImports": {
"enabled": false
},
Expand All @@ -13,12 +13,25 @@
"semicolons": "asNeeded"
}
},
"css": {
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noForEach": "off"
"noForEach": "off",
"useOptionalChain": "off"
},
"suspicious": {
"noAssignInExpressions": "off"
}
}
}
Expand Down
8 changes: 2 additions & 6 deletions content_editor/static/content_editor/content_editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ html {
border: 1px solid var(--hairline-color, #e8e8e8);
border-bottom: none;
user-select: none;
transition:
0.15s background,
0.15s color;
transition: 0.15s background, 0.15s color;
}

.tabs > .active {
Expand Down Expand Up @@ -90,9 +88,7 @@ html {
padding: 7px;
margin: 0;
background-color: var(--darkened-bg, #f8f8f8);
transition:
0.15s background,
0.15s color;
transition: 0.15s background, 0.15s color;

white-space: nowrap;
overflow: hidden;
Expand Down
81 changes: 38 additions & 43 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ requires = [
name = "django-content-editor"
description = "Editing structured content"
readme = "README.rst"
license = {text = "BSD-3-Clause"}
license = { text = "BSD-3-Clause" }
authors = [
{ name = "Matthias Kestenholz", email = "[email protected]" },
{ name = "Matthias Kestenholz", email = "[email protected]" },
]
requires-python = ">=3.8"
classifiers = [
Expand All @@ -35,84 +35,79 @@ dynamic = [
"version",
]
dependencies = [
"Django>=3.2",
"django>=3.2",
"django-js-asset",
]
[project.optional-dependencies]
tests = [
optional-dependencies.tests = [
"coverage",
]
[project.urls]
Homepage = "https://github.com/matthiask/django-content-editor/"
urls.Homepage = "https://github.com/matthiask/django-content-editor/"

[tool.hatch.build]
include = ["content_editor/"]
include = [
"content_editor/",
]

[tool.hatch.version]
path = "content_editor/__init__.py"

[tool.ruff]
fix = true
show-fixes = true
target-version = "py38"

[tool.ruff.lint]
extend-select = [
# pyflakes, pycodestyle
"F", "E", "W",
# mmcabe
"C90",
# isort
"I",
# pep8-naming
"N",
# pyupgrade
"UP",
# flake8-2020
"YTT",
# flake8-boolean-trap
"FBT",
# flake8-bugbear
"B",
fix = true
show-fixes = true
lint.extend-select = [
# flake8-builtins
"A",
# flake8-bugbear
"B",
# flake8-comprehensions
"C4",
# mmcabe
"C90",
# flake8-django
"DJ",
"E",
# pyflakes, pycodestyle
"F",
# flake8-boolean-trap
"FBT",
# flake8-logging-format
"G",
# flake8-pie
"PIE",
# flake8-simplify
"SIM",
# isort
"I",
# flake8-gettext
"INT",
# pep8-naming
"N",
# pygrep-hooks
"PGH",
# flake8-pie
"PIE",
# pylint
"PL",
# unused noqa
"RUF100",
# flake8-simplify
"SIM",
# pyupgrade
"UP",
"W",
# flake8-2020
"YTT",
]
extend-ignore = [
lint.extend-ignore = [
# Allow zip() without strict=
"B905",
# No line length errors
"E501",
]

[tool.ruff.lint.isort]
combine-as-imports = true
lines-after-imports = 2

[tool.ruff.lint.mccabe]
max-complexity = 15

[tool.ruff.lint.per-file-ignores]
"*/migrat*/*" = [
lint.per-file-ignores."*/migrat*/*" = [
# Allow using PascalCase model names in migrations
"N806",
# Ignore the fact that migration files are invalid module names
"N999",
]
lint.isort.combine-as-imports = true
lint.isort.lines-after-imports = 2
lint.mccabe.max-complexity = 15

0 comments on commit 2ba84b5

Please sign in to comment.